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. */
206 static struct ipmi_user *acquire_ipmi_user(struct ipmi_user *user, int *index) in acquire_ipmi_user() argument
207 __acquires(user->release_barrier) in acquire_ipmi_user()
211 *index = srcu_read_lock(&user->release_barrier); in acquire_ipmi_user()
212 ruser = srcu_dereference(user->self, &user->release_barrier); in acquire_ipmi_user()
214 srcu_read_unlock(&user->release_barrier, *index); in acquire_ipmi_user()
218 static void release_ipmi_user(struct ipmi_user *user, int index) in release_ipmi_user() argument
220 srcu_read_unlock(&user->release_barrier, index); in release_ipmi_user()
226 struct ipmi_user *user; member
293 * but may be changed by the user.
335 /* Commands we got from the user that were invalid. */
341 /* Responses from the MC that were delivered to a user. */
344 /* Responses from the MC that were not delivered to a user. */
372 /* The response was delivered to the user. */
399 /* The response was delivered to the user. */
408 /* The command was delivered to the user. */
568 * interface comes in with a NULL user, call this routine with
887 if (!msg->user) { in deliver_response()
905 struct ipmi_user *user = acquire_ipmi_user(msg->user, &index); in deliver_response() local
907 if (user) { in deliver_response()
908 user->handler->ipmi_recv_hndl(msg, user->handler_data); in deliver_response()
909 release_ipmi_user(user, index); in deliver_response()
911 /* User went away, give up. */ in deliver_response()
1104 * We do this verification because the user can be deleted in intf_start_seq_timer()
1134 * We do this verification because the user can be deleted in intf_err_seq()
1156 struct ipmi_user *user = container_of(work, struct ipmi_user, in free_user_work() local
1159 cleanup_srcu_struct(&user->release_barrier); in free_user_work()
1160 vfree(user); in free_user_work()
1166 struct ipmi_user **user) in ipmi_create_user() argument
1217 /* Note that each existing user holds a refcount to the interface. */ in ipmi_create_user()
1231 /* User wants pretimeouts, so make sure to watch for them. */ in ipmi_create_user()
1234 *user = new_user; in ipmi_create_user()
1272 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount); in free_user() local
1275 schedule_work(&user->remove_work); in free_user()
1278 static void _ipmi_destroy_user(struct ipmi_user *user) in _ipmi_destroy_user() argument
1280 struct ipmi_smi *intf = user->intf; in _ipmi_destroy_user()
1286 if (!acquire_ipmi_user(user, &i)) { in _ipmi_destroy_user()
1288 * The user has already been cleaned up, just make sure in _ipmi_destroy_user()
1291 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1295 rcu_assign_pointer(user->self, NULL); in _ipmi_destroy_user()
1296 release_ipmi_user(user, i); in _ipmi_destroy_user()
1298 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1300 if (user->handler->shutdown) in _ipmi_destroy_user()
1301 user->handler->shutdown(user->handler_data); in _ipmi_destroy_user()
1303 if (user->handler->ipmi_watchdog_pretimeout) in _ipmi_destroy_user()
1306 if (user->gets_events) in _ipmi_destroy_user()
1309 /* Remove the user from the interface's sequence table. */ in _ipmi_destroy_user()
1311 list_del_rcu(&user->link); in _ipmi_destroy_user()
1315 && (intf->seq_table[i].recv_msg->user == user)) { in _ipmi_destroy_user()
1324 * Remove the user from the command receiver's table. First in _ipmi_destroy_user()
1332 if (rcvr->user == user) { in _ipmi_destroy_user()
1350 int ipmi_destroy_user(struct ipmi_user *user) in ipmi_destroy_user() argument
1352 _ipmi_destroy_user(user); in ipmi_destroy_user()
1354 kref_put(&user->refcount, free_user); in ipmi_destroy_user()
1360 int ipmi_get_version(struct ipmi_user *user, in ipmi_get_version() argument
1367 user = acquire_ipmi_user(user, &index); in ipmi_get_version()
1368 if (!user) in ipmi_get_version()
1371 rv = bmc_get_device_id(user->intf, NULL, &id, NULL, NULL); in ipmi_get_version()
1376 release_ipmi_user(user, index); in ipmi_get_version()
1382 int ipmi_set_my_address(struct ipmi_user *user, in ipmi_set_my_address() argument
1388 user = acquire_ipmi_user(user, &index); in ipmi_set_my_address()
1389 if (!user) in ipmi_set_my_address()
1396 user->intf->addrinfo[channel].address = address; in ipmi_set_my_address()
1398 release_ipmi_user(user, index); in ipmi_set_my_address()
1404 int ipmi_get_my_address(struct ipmi_user *user, in ipmi_get_my_address() argument
1410 user = acquire_ipmi_user(user, &index); in ipmi_get_my_address()
1411 if (!user) in ipmi_get_my_address()
1418 *address = user->intf->addrinfo[channel].address; in ipmi_get_my_address()
1420 release_ipmi_user(user, index); in ipmi_get_my_address()
1426 int ipmi_set_my_LUN(struct ipmi_user *user, in ipmi_set_my_LUN() argument
1432 user = acquire_ipmi_user(user, &index); in ipmi_set_my_LUN()
1433 if (!user) in ipmi_set_my_LUN()
1440 user->intf->addrinfo[channel].lun = LUN & 0x3; in ipmi_set_my_LUN()
1442 release_ipmi_user(user, index); in ipmi_set_my_LUN()
1448 int ipmi_get_my_LUN(struct ipmi_user *user, in ipmi_get_my_LUN() argument
1454 user = acquire_ipmi_user(user, &index); in ipmi_get_my_LUN()
1455 if (!user) in ipmi_get_my_LUN()
1462 *address = user->intf->addrinfo[channel].lun; in ipmi_get_my_LUN()
1464 release_ipmi_user(user, index); in ipmi_get_my_LUN()
1470 int ipmi_get_maintenance_mode(struct ipmi_user *user) in ipmi_get_maintenance_mode() argument
1475 user = acquire_ipmi_user(user, &index); in ipmi_get_maintenance_mode()
1476 if (!user) in ipmi_get_maintenance_mode()
1479 spin_lock_irqsave(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1480 mode = user->intf->maintenance_mode; in ipmi_get_maintenance_mode()
1481 spin_unlock_irqrestore(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1482 release_ipmi_user(user, index); in ipmi_get_maintenance_mode()
1495 int ipmi_set_maintenance_mode(struct ipmi_user *user, int mode) in ipmi_set_maintenance_mode() argument
1499 struct ipmi_smi *intf = user->intf; in ipmi_set_maintenance_mode()
1501 user = acquire_ipmi_user(user, &index); in ipmi_set_maintenance_mode()
1502 if (!user) in ipmi_set_maintenance_mode()
1531 release_ipmi_user(user, index); in ipmi_set_maintenance_mode()
1537 int ipmi_set_gets_events(struct ipmi_user *user, bool val) in ipmi_set_gets_events() argument
1540 struct ipmi_smi *intf = user->intf; in ipmi_set_gets_events()
1545 user = acquire_ipmi_user(user, &index); in ipmi_set_gets_events()
1546 if (!user) in ipmi_set_gets_events()
1552 if (user->gets_events == val) in ipmi_set_gets_events()
1555 user->gets_events = val; in ipmi_set_gets_events()
1572 while (user->gets_events && !list_empty(&intf->waiting_events)) { in ipmi_set_gets_events()
1585 msg->user = user; in ipmi_set_gets_events()
1586 kref_get(&user->refcount); in ipmi_set_gets_events()
1596 release_ipmi_user(user, index); in ipmi_set_gets_events()
1634 int ipmi_register_for_cmd(struct ipmi_user *user, in ipmi_register_for_cmd() argument
1639 struct ipmi_smi *intf = user->intf; in ipmi_register_for_cmd()
1643 user = acquire_ipmi_user(user, &index); in ipmi_register_for_cmd()
1644 if (!user) in ipmi_register_for_cmd()
1655 rcvr->user = user; in ipmi_register_for_cmd()
1673 release_ipmi_user(user, index); in ipmi_register_for_cmd()
1679 int ipmi_unregister_for_cmd(struct ipmi_user *user, in ipmi_unregister_for_cmd() argument
1684 struct ipmi_smi *intf = user->intf; in ipmi_unregister_for_cmd()
1689 user = acquire_ipmi_user(user, &index); in ipmi_unregister_for_cmd()
1690 if (!user) in ipmi_unregister_for_cmd()
1700 if (rcvr->user == user) { in ipmi_unregister_for_cmd()
1712 release_ipmi_user(user, index); in ipmi_unregister_for_cmd()
1885 * We don't let the user do these, since we manage in i_ipmi_req_sysintf()
1984 * It's a response, so use the user's sequence in i_ipmi_req_ipmb()
2112 * It's a response, so use the user's sequence in i_ipmi_req_lan()
2184 * Separate from ipmi_request so that the user does not have to be
2189 static int i_ipmi_request(struct ipmi_user *user, in i_ipmi_request() argument
2236 recv_msg->user = user; in i_ipmi_request()
2237 if (user) in i_ipmi_request()
2239 kref_get(&user->refcount); in i_ipmi_request()
2291 int ipmi_request_settime(struct ipmi_user *user, in ipmi_request_settime() argument
2303 if (!user) in ipmi_request_settime()
2306 user = acquire_ipmi_user(user, &index); in ipmi_request_settime()
2307 if (!user) in ipmi_request_settime()
2310 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_settime()
2312 rv = i_ipmi_request(user, in ipmi_request_settime()
2313 user->intf, in ipmi_request_settime()
2325 release_ipmi_user(user, index); in ipmi_request_settime()
2330 int ipmi_request_supply_msgs(struct ipmi_user *user, in ipmi_request_supply_msgs() argument
2342 if (!user) in ipmi_request_supply_msgs()
2345 user = acquire_ipmi_user(user, &index); in ipmi_request_supply_msgs()
2346 if (!user) in ipmi_request_supply_msgs()
2349 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_supply_msgs()
2351 rv = i_ipmi_request(user, in ipmi_request_supply_msgs()
2352 user->intf, in ipmi_request_supply_msgs()
2364 release_ipmi_user(user, index); in ipmi_request_supply_msgs()
3380 void ipmi_poll_interface(struct ipmi_user *user) in ipmi_poll_interface() argument
3382 ipmi_poll(user->intf); in ipmi_poll_interface()
3614 struct ipmi_user *user = in ipmi_unregister_smi() local
3618 _ipmi_destroy_user(user); in ipmi_unregister_smi()
3705 struct ipmi_user *user = NULL; in handle_ipmb_get_msg_cmd() local
3727 user = rcvr->user; in handle_ipmb_get_msg_cmd()
3728 kref_get(&user->refcount); in handle_ipmb_get_msg_cmd()
3730 user = NULL; in handle_ipmb_get_msg_cmd()
3733 if (user == NULL) { in handle_ipmb_get_msg_cmd()
3734 /* We didn't find a user, deliver an error response. */ in handle_ipmb_get_msg_cmd()
3773 kref_put(&user->refcount, free_user); in handle_ipmb_get_msg_cmd()
3786 recv_msg->user = user; in handle_ipmb_get_msg_cmd()
3885 struct ipmi_user *user = NULL; in handle_lan_get_msg_cmd() local
3907 user = rcvr->user; in handle_lan_get_msg_cmd()
3908 kref_get(&user->refcount); in handle_lan_get_msg_cmd()
3910 user = NULL; in handle_lan_get_msg_cmd()
3913 if (user == NULL) { in handle_lan_get_msg_cmd()
3914 /* We didn't find a user, just give up. */ in handle_lan_get_msg_cmd()
3930 kref_put(&user->refcount, free_user); in handle_lan_get_msg_cmd()
3946 recv_msg->user = user; in handle_lan_get_msg_cmd()
3984 struct ipmi_user *user = NULL; in handle_oem_get_msg_cmd() local
4014 user = rcvr->user; in handle_oem_get_msg_cmd()
4015 kref_get(&user->refcount); in handle_oem_get_msg_cmd()
4017 user = NULL; in handle_oem_get_msg_cmd()
4020 if (user == NULL) { in handle_oem_get_msg_cmd()
4021 /* We didn't find a user, just give up. */ in handle_oem_get_msg_cmd()
4039 kref_put(&user->refcount, free_user); in handle_oem_get_msg_cmd()
4053 recv_msg->user = user; in handle_oem_get_msg_cmd()
4100 struct ipmi_user *user; in handle_read_event_rsp() local
4122 * Allocate and fill in one message for every user that is in handle_read_event_rsp()
4126 list_for_each_entry_rcu(user, &intf->users, link) { in handle_read_event_rsp()
4127 if (!user->gets_events) in handle_read_event_rsp()
4150 recv_msg->user = user; in handle_read_event_rsp()
4151 kref_get(&user->refcount); in handle_read_event_rsp()
4319 * deliver a send message response to the user. in handle_one_recv_msg()
4477 struct ipmi_user *user; in handle_new_recv_msgs() local
4481 list_for_each_entry_rcu(user, &intf->users, link) { in handle_new_recv_msgs()
4482 if (user->handler->ipmi_watchdog_pretimeout) in handle_new_recv_msgs()
4483 user->handler->ipmi_watchdog_pretimeout( in handle_new_recv_msgs()
4484 user->handler_data); in handle_new_recv_msgs()
4833 rv->user = NULL; in ipmi_alloc_recv_msg()
4842 if (msg->user) in ipmi_free_recv_msg()
4843 kref_put(&msg->user->refcount, free_user); in ipmi_free_recv_msg()
5076 struct ipmi_user *user; in panic_event() local
5113 list_for_each_entry_rcu(user, &intf->users, link) { in panic_event()
5114 if (user->handler->ipmi_panic_handler) in panic_event()
5115 user->handler->ipmi_panic_handler( in panic_event()
5116 user->handler_data); in panic_event()