Lines Matching full:user
178 * The main "user" data structure.
184 * Set to NULL when the user is destroyed, a pointer to myself
196 /* The interface this user is bound to. */
208 static struct ipmi_user *acquire_ipmi_user(struct ipmi_user *user, int *index) in acquire_ipmi_user() argument
209 __acquires(user->release_barrier) in acquire_ipmi_user()
213 *index = srcu_read_lock(&user->release_barrier); in acquire_ipmi_user()
214 ruser = srcu_dereference(user->self, &user->release_barrier); in acquire_ipmi_user()
216 srcu_read_unlock(&user->release_barrier, *index); in acquire_ipmi_user()
220 static void release_ipmi_user(struct ipmi_user *user, int index) in release_ipmi_user() argument
222 srcu_read_unlock(&user->release_barrier, index); in release_ipmi_user()
228 struct ipmi_user *user; member
295 * but may be changed by the user.
337 /* Commands we got from the user that were invalid. */
343 /* Responses from the MC that were delivered to a user. */
346 /* Responses from the MC that were not delivered to a user. */
374 /* The response was delivered to the user. */
401 /* The response was delivered to the user. */
410 /* The command was delivered to the user. */
570 * interface comes in with a NULL user, call this routine with
889 if (!msg->user) { in deliver_response()
907 struct ipmi_user *user = acquire_ipmi_user(msg->user, &index); in deliver_response() local
909 if (user) { in deliver_response()
910 user->handler->ipmi_recv_hndl(msg, user->handler_data); in deliver_response()
911 release_ipmi_user(user, index); in deliver_response()
913 /* User went away, give up. */ in deliver_response()
1106 * We do this verification because the user can be deleted in intf_start_seq_timer()
1136 * We do this verification because the user can be deleted in intf_err_seq()
1158 struct ipmi_user *user = container_of(work, struct ipmi_user, in free_user_work() local
1161 cleanup_srcu_struct(&user->release_barrier); in free_user_work()
1162 vfree(user); in free_user_work()
1168 struct ipmi_user **user) in ipmi_create_user() argument
1219 /* Note that each existing user holds a refcount to the interface. */ in ipmi_create_user()
1233 /* User wants pretimeouts, so make sure to watch for them. */ in ipmi_create_user()
1236 *user = new_user; in ipmi_create_user()
1274 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount); in free_user() local
1277 queue_work(remove_work_wq, &user->remove_work); in free_user()
1280 static void _ipmi_destroy_user(struct ipmi_user *user) in _ipmi_destroy_user() argument
1282 struct ipmi_smi *intf = user->intf; in _ipmi_destroy_user()
1288 if (!acquire_ipmi_user(user, &i)) { in _ipmi_destroy_user()
1290 * The user has already been cleaned up, just make sure in _ipmi_destroy_user()
1293 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1297 rcu_assign_pointer(user->self, NULL); in _ipmi_destroy_user()
1298 release_ipmi_user(user, i); in _ipmi_destroy_user()
1300 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1302 if (user->handler->shutdown) in _ipmi_destroy_user()
1303 user->handler->shutdown(user->handler_data); in _ipmi_destroy_user()
1305 if (user->handler->ipmi_watchdog_pretimeout) in _ipmi_destroy_user()
1308 if (user->gets_events) in _ipmi_destroy_user()
1311 /* Remove the user from the interface's sequence table. */ in _ipmi_destroy_user()
1313 list_del_rcu(&user->link); in _ipmi_destroy_user()
1317 && (intf->seq_table[i].recv_msg->user == user)) { in _ipmi_destroy_user()
1326 * Remove the user from the command receiver's table. First in _ipmi_destroy_user()
1334 if (rcvr->user == user) { in _ipmi_destroy_user()
1352 int ipmi_destroy_user(struct ipmi_user *user) in ipmi_destroy_user() argument
1354 _ipmi_destroy_user(user); in ipmi_destroy_user()
1356 kref_put(&user->refcount, free_user); in ipmi_destroy_user()
1362 int ipmi_get_version(struct ipmi_user *user, in ipmi_get_version() argument
1369 user = acquire_ipmi_user(user, &index); in ipmi_get_version()
1370 if (!user) in ipmi_get_version()
1373 rv = bmc_get_device_id(user->intf, NULL, &id, NULL, NULL); in ipmi_get_version()
1378 release_ipmi_user(user, index); in ipmi_get_version()
1384 int ipmi_set_my_address(struct ipmi_user *user, in ipmi_set_my_address() argument
1390 user = acquire_ipmi_user(user, &index); in ipmi_set_my_address()
1391 if (!user) in ipmi_set_my_address()
1398 user->intf->addrinfo[channel].address = address; in ipmi_set_my_address()
1400 release_ipmi_user(user, index); in ipmi_set_my_address()
1406 int ipmi_get_my_address(struct ipmi_user *user, in ipmi_get_my_address() argument
1412 user = acquire_ipmi_user(user, &index); in ipmi_get_my_address()
1413 if (!user) in ipmi_get_my_address()
1420 *address = user->intf->addrinfo[channel].address; in ipmi_get_my_address()
1422 release_ipmi_user(user, index); in ipmi_get_my_address()
1428 int ipmi_set_my_LUN(struct ipmi_user *user, in ipmi_set_my_LUN() argument
1434 user = acquire_ipmi_user(user, &index); in ipmi_set_my_LUN()
1435 if (!user) in ipmi_set_my_LUN()
1442 user->intf->addrinfo[channel].lun = LUN & 0x3; in ipmi_set_my_LUN()
1444 release_ipmi_user(user, index); in ipmi_set_my_LUN()
1450 int ipmi_get_my_LUN(struct ipmi_user *user, in ipmi_get_my_LUN() argument
1456 user = acquire_ipmi_user(user, &index); in ipmi_get_my_LUN()
1457 if (!user) in ipmi_get_my_LUN()
1464 *address = user->intf->addrinfo[channel].lun; in ipmi_get_my_LUN()
1466 release_ipmi_user(user, index); in ipmi_get_my_LUN()
1472 int ipmi_get_maintenance_mode(struct ipmi_user *user) in ipmi_get_maintenance_mode() argument
1477 user = acquire_ipmi_user(user, &index); in ipmi_get_maintenance_mode()
1478 if (!user) in ipmi_get_maintenance_mode()
1481 spin_lock_irqsave(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1482 mode = user->intf->maintenance_mode; in ipmi_get_maintenance_mode()
1483 spin_unlock_irqrestore(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1484 release_ipmi_user(user, index); in ipmi_get_maintenance_mode()
1497 int ipmi_set_maintenance_mode(struct ipmi_user *user, int mode) in ipmi_set_maintenance_mode() argument
1501 struct ipmi_smi *intf = user->intf; in ipmi_set_maintenance_mode()
1503 user = acquire_ipmi_user(user, &index); in ipmi_set_maintenance_mode()
1504 if (!user) in ipmi_set_maintenance_mode()
1533 release_ipmi_user(user, index); in ipmi_set_maintenance_mode()
1539 int ipmi_set_gets_events(struct ipmi_user *user, bool val) in ipmi_set_gets_events() argument
1542 struct ipmi_smi *intf = user->intf; in ipmi_set_gets_events()
1547 user = acquire_ipmi_user(user, &index); in ipmi_set_gets_events()
1548 if (!user) in ipmi_set_gets_events()
1554 if (user->gets_events == val) in ipmi_set_gets_events()
1557 user->gets_events = val; in ipmi_set_gets_events()
1574 while (user->gets_events && !list_empty(&intf->waiting_events)) { in ipmi_set_gets_events()
1587 msg->user = user; in ipmi_set_gets_events()
1588 kref_get(&user->refcount); in ipmi_set_gets_events()
1598 release_ipmi_user(user, index); in ipmi_set_gets_events()
1636 int ipmi_register_for_cmd(struct ipmi_user *user, in ipmi_register_for_cmd() argument
1641 struct ipmi_smi *intf = user->intf; in ipmi_register_for_cmd()
1645 user = acquire_ipmi_user(user, &index); in ipmi_register_for_cmd()
1646 if (!user) in ipmi_register_for_cmd()
1657 rcvr->user = user; in ipmi_register_for_cmd()
1675 release_ipmi_user(user, index); in ipmi_register_for_cmd()
1681 int ipmi_unregister_for_cmd(struct ipmi_user *user, in ipmi_unregister_for_cmd() argument
1686 struct ipmi_smi *intf = user->intf; in ipmi_unregister_for_cmd()
1691 user = acquire_ipmi_user(user, &index); in ipmi_unregister_for_cmd()
1692 if (!user) in ipmi_unregister_for_cmd()
1702 if (rcvr->user == user) { in ipmi_unregister_for_cmd()
1714 release_ipmi_user(user, index); in ipmi_unregister_for_cmd()
1887 * We don't let the user do these, since we manage in i_ipmi_req_sysintf()
1986 * It's a response, so use the user's sequence in i_ipmi_req_ipmb()
2114 * It's a response, so use the user's sequence in i_ipmi_req_lan()
2186 * Separate from ipmi_request so that the user does not have to be
2191 static int i_ipmi_request(struct ipmi_user *user, in i_ipmi_request() argument
2238 recv_msg->user = user; in i_ipmi_request()
2239 if (user) in i_ipmi_request()
2241 kref_get(&user->refcount); in i_ipmi_request()
2293 int ipmi_request_settime(struct ipmi_user *user, in ipmi_request_settime() argument
2305 if (!user) in ipmi_request_settime()
2308 user = acquire_ipmi_user(user, &index); in ipmi_request_settime()
2309 if (!user) in ipmi_request_settime()
2312 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_settime()
2314 rv = i_ipmi_request(user, in ipmi_request_settime()
2315 user->intf, in ipmi_request_settime()
2327 release_ipmi_user(user, index); in ipmi_request_settime()
2332 int ipmi_request_supply_msgs(struct ipmi_user *user, in ipmi_request_supply_msgs() argument
2344 if (!user) in ipmi_request_supply_msgs()
2347 user = acquire_ipmi_user(user, &index); in ipmi_request_supply_msgs()
2348 if (!user) in ipmi_request_supply_msgs()
2351 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_supply_msgs()
2353 rv = i_ipmi_request(user, in ipmi_request_supply_msgs()
2354 user->intf, in ipmi_request_supply_msgs()
2366 release_ipmi_user(user, index); in ipmi_request_supply_msgs()
3382 void ipmi_poll_interface(struct ipmi_user *user) in ipmi_poll_interface() argument
3384 ipmi_poll(user->intf); in ipmi_poll_interface()
3616 struct ipmi_user *user = in ipmi_unregister_smi() local
3620 _ipmi_destroy_user(user); in ipmi_unregister_smi()
3707 struct ipmi_user *user = NULL; in handle_ipmb_get_msg_cmd() local
3729 user = rcvr->user; in handle_ipmb_get_msg_cmd()
3730 kref_get(&user->refcount); in handle_ipmb_get_msg_cmd()
3732 user = NULL; in handle_ipmb_get_msg_cmd()
3735 if (user == NULL) { in handle_ipmb_get_msg_cmd()
3736 /* We didn't find a user, deliver an error response. */ in handle_ipmb_get_msg_cmd()
3775 kref_put(&user->refcount, free_user); in handle_ipmb_get_msg_cmd()
3788 recv_msg->user = user; in handle_ipmb_get_msg_cmd()
3887 struct ipmi_user *user = NULL; in handle_lan_get_msg_cmd() local
3909 user = rcvr->user; in handle_lan_get_msg_cmd()
3910 kref_get(&user->refcount); in handle_lan_get_msg_cmd()
3912 user = NULL; in handle_lan_get_msg_cmd()
3915 if (user == NULL) { in handle_lan_get_msg_cmd()
3916 /* We didn't find a user, just give up. */ in handle_lan_get_msg_cmd()
3932 kref_put(&user->refcount, free_user); in handle_lan_get_msg_cmd()
3948 recv_msg->user = user; in handle_lan_get_msg_cmd()
3986 struct ipmi_user *user = NULL; in handle_oem_get_msg_cmd() local
4016 user = rcvr->user; in handle_oem_get_msg_cmd()
4017 kref_get(&user->refcount); in handle_oem_get_msg_cmd()
4019 user = NULL; in handle_oem_get_msg_cmd()
4022 if (user == NULL) { in handle_oem_get_msg_cmd()
4023 /* We didn't find a user, just give up. */ in handle_oem_get_msg_cmd()
4041 kref_put(&user->refcount, free_user); in handle_oem_get_msg_cmd()
4055 recv_msg->user = user; in handle_oem_get_msg_cmd()
4102 struct ipmi_user *user; in handle_read_event_rsp() local
4124 * Allocate and fill in one message for every user that is in handle_read_event_rsp()
4128 list_for_each_entry_rcu(user, &intf->users, link) { in handle_read_event_rsp()
4129 if (!user->gets_events) in handle_read_event_rsp()
4152 recv_msg->user = user; in handle_read_event_rsp()
4153 kref_get(&user->refcount); in handle_read_event_rsp()
4321 * deliver a send message response to the user. in handle_one_recv_msg()
4479 struct ipmi_user *user; in handle_new_recv_msgs() local
4483 list_for_each_entry_rcu(user, &intf->users, link) { in handle_new_recv_msgs()
4484 if (user->handler->ipmi_watchdog_pretimeout) in handle_new_recv_msgs()
4485 user->handler->ipmi_watchdog_pretimeout( in handle_new_recv_msgs()
4486 user->handler_data); in handle_new_recv_msgs()
4839 rv->user = NULL; in ipmi_alloc_recv_msg()
4848 if (msg->user && !oops_in_progress) in ipmi_free_recv_msg()
4849 kref_put(&msg->user->refcount, free_user); in ipmi_free_recv_msg()
5082 struct ipmi_user *user; in panic_event() local
5119 list_for_each_entry_rcu(user, &intf->users, link) { in panic_event()
5120 if (user->handler->ipmi_panic_handler) in panic_event()
5121 user->handler->ipmi_panic_handler( in panic_event()
5122 user->handler_data); in panic_event()