Lines Matching full:user

154 /* The default maximum number of message a user may have outstanding. */
158 "The most message a user may have outstanding.");
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. */
210 static struct ipmi_user *acquire_ipmi_user(struct ipmi_user *user, int *index) in acquire_ipmi_user() argument
211 __acquires(user->release_barrier) in acquire_ipmi_user()
215 *index = srcu_read_lock(&user->release_barrier); in acquire_ipmi_user()
216 ruser = srcu_dereference(user->self, &user->release_barrier); in acquire_ipmi_user()
218 srcu_read_unlock(&user->release_barrier, *index); in acquire_ipmi_user()
222 static void release_ipmi_user(struct ipmi_user *user, int index) in release_ipmi_user() argument
224 srcu_read_unlock(&user->release_barrier, index); in release_ipmi_user()
230 struct ipmi_user *user; member
297 * but may be changed by the user.
339 /* Commands we got from the user that were invalid. */
345 /* Responses from the MC that were delivered to a user. */
348 /* Responses from the MC that were not delivered to a user. */
376 /* The response was delivered to the user. */
403 /* The response was delivered to the user. */
412 /* The command was delivered to the user. */
576 * interface comes in with a NULL user, call this routine with
926 if (!msg->user) { in deliver_response()
942 atomic_dec(&msg->user->nr_msgs); in deliver_response()
945 struct ipmi_user *user = acquire_ipmi_user(msg->user, &index); in deliver_response() local
947 if (user) { in deliver_response()
948 atomic_dec(&user->nr_msgs); in deliver_response()
949 user->handler->ipmi_recv_hndl(msg, user->handler_data); in deliver_response()
950 release_ipmi_user(user, index); in deliver_response()
952 /* User went away, give up. */ in deliver_response()
1145 * We do this verification because the user can be deleted in intf_start_seq_timer()
1175 * We do this verification because the user can be deleted in intf_err_seq()
1197 struct ipmi_user *user = container_of(work, struct ipmi_user, in free_user_work() local
1200 cleanup_srcu_struct(&user->release_barrier); in free_user_work()
1201 vfree(user); in free_user_work()
1207 struct ipmi_user **user) in ipmi_create_user() argument
1263 /* Note that each existing user holds a refcount to the interface. */ in ipmi_create_user()
1278 /* User wants pretimeouts, so make sure to watch for them. */ in ipmi_create_user()
1281 *user = new_user; in ipmi_create_user()
1320 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount); in free_user() local
1323 queue_work(remove_work_wq, &user->remove_work); in free_user()
1326 static void _ipmi_destroy_user(struct ipmi_user *user) in _ipmi_destroy_user() argument
1328 struct ipmi_smi *intf = user->intf; in _ipmi_destroy_user()
1334 if (!acquire_ipmi_user(user, &i)) { in _ipmi_destroy_user()
1336 * The user has already been cleaned up, just make sure in _ipmi_destroy_user()
1339 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1343 rcu_assign_pointer(user->self, NULL); in _ipmi_destroy_user()
1344 release_ipmi_user(user, i); in _ipmi_destroy_user()
1346 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1348 if (user->handler->shutdown) in _ipmi_destroy_user()
1349 user->handler->shutdown(user->handler_data); in _ipmi_destroy_user()
1351 if (user->handler->ipmi_watchdog_pretimeout) in _ipmi_destroy_user()
1354 if (user->gets_events) in _ipmi_destroy_user()
1357 /* Remove the user from the interface's sequence table. */ in _ipmi_destroy_user()
1359 list_del_rcu(&user->link); in _ipmi_destroy_user()
1364 && (intf->seq_table[i].recv_msg->user == user)) { in _ipmi_destroy_user()
1373 * Remove the user from the command receiver's table. First in _ipmi_destroy_user()
1381 if (rcvr->user == user) { in _ipmi_destroy_user()
1399 int ipmi_destroy_user(struct ipmi_user *user) in ipmi_destroy_user() argument
1401 _ipmi_destroy_user(user); in ipmi_destroy_user()
1403 kref_put(&user->refcount, free_user); in ipmi_destroy_user()
1409 int ipmi_get_version(struct ipmi_user *user, in ipmi_get_version() argument
1416 user = acquire_ipmi_user(user, &index); in ipmi_get_version()
1417 if (!user) in ipmi_get_version()
1420 rv = bmc_get_device_id(user->intf, NULL, &id, NULL, NULL); in ipmi_get_version()
1425 release_ipmi_user(user, index); in ipmi_get_version()
1431 int ipmi_set_my_address(struct ipmi_user *user, in ipmi_set_my_address() argument
1437 user = acquire_ipmi_user(user, &index); in ipmi_set_my_address()
1438 if (!user) in ipmi_set_my_address()
1445 user->intf->addrinfo[channel].address = address; in ipmi_set_my_address()
1447 release_ipmi_user(user, index); in ipmi_set_my_address()
1453 int ipmi_get_my_address(struct ipmi_user *user, in ipmi_get_my_address() argument
1459 user = acquire_ipmi_user(user, &index); in ipmi_get_my_address()
1460 if (!user) in ipmi_get_my_address()
1467 *address = user->intf->addrinfo[channel].address; in ipmi_get_my_address()
1469 release_ipmi_user(user, index); in ipmi_get_my_address()
1475 int ipmi_set_my_LUN(struct ipmi_user *user, in ipmi_set_my_LUN() argument
1481 user = acquire_ipmi_user(user, &index); in ipmi_set_my_LUN()
1482 if (!user) in ipmi_set_my_LUN()
1489 user->intf->addrinfo[channel].lun = LUN & 0x3; in ipmi_set_my_LUN()
1491 release_ipmi_user(user, index); in ipmi_set_my_LUN()
1497 int ipmi_get_my_LUN(struct ipmi_user *user, in ipmi_get_my_LUN() argument
1503 user = acquire_ipmi_user(user, &index); in ipmi_get_my_LUN()
1504 if (!user) in ipmi_get_my_LUN()
1511 *address = user->intf->addrinfo[channel].lun; in ipmi_get_my_LUN()
1513 release_ipmi_user(user, index); in ipmi_get_my_LUN()
1519 int ipmi_get_maintenance_mode(struct ipmi_user *user) in ipmi_get_maintenance_mode() argument
1524 user = acquire_ipmi_user(user, &index); in ipmi_get_maintenance_mode()
1525 if (!user) in ipmi_get_maintenance_mode()
1528 spin_lock_irqsave(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1529 mode = user->intf->maintenance_mode; in ipmi_get_maintenance_mode()
1530 spin_unlock_irqrestore(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1531 release_ipmi_user(user, index); in ipmi_get_maintenance_mode()
1544 int ipmi_set_maintenance_mode(struct ipmi_user *user, int mode) in ipmi_set_maintenance_mode() argument
1548 struct ipmi_smi *intf = user->intf; in ipmi_set_maintenance_mode()
1550 user = acquire_ipmi_user(user, &index); in ipmi_set_maintenance_mode()
1551 if (!user) in ipmi_set_maintenance_mode()
1580 release_ipmi_user(user, index); in ipmi_set_maintenance_mode()
1586 int ipmi_set_gets_events(struct ipmi_user *user, bool val) in ipmi_set_gets_events() argument
1589 struct ipmi_smi *intf = user->intf; in ipmi_set_gets_events()
1594 user = acquire_ipmi_user(user, &index); in ipmi_set_gets_events()
1595 if (!user) in ipmi_set_gets_events()
1601 if (user->gets_events == val) in ipmi_set_gets_events()
1604 user->gets_events = val; in ipmi_set_gets_events()
1621 while (user->gets_events && !list_empty(&intf->waiting_events)) { in ipmi_set_gets_events()
1634 msg->user = user; in ipmi_set_gets_events()
1635 kref_get(&user->refcount); in ipmi_set_gets_events()
1645 release_ipmi_user(user, index); in ipmi_set_gets_events()
1683 int ipmi_register_for_cmd(struct ipmi_user *user, in ipmi_register_for_cmd() argument
1688 struct ipmi_smi *intf = user->intf; in ipmi_register_for_cmd()
1692 user = acquire_ipmi_user(user, &index); in ipmi_register_for_cmd()
1693 if (!user) in ipmi_register_for_cmd()
1704 rcvr->user = user; in ipmi_register_for_cmd()
1722 release_ipmi_user(user, index); in ipmi_register_for_cmd()
1728 int ipmi_unregister_for_cmd(struct ipmi_user *user, in ipmi_unregister_for_cmd() argument
1733 struct ipmi_smi *intf = user->intf; in ipmi_unregister_for_cmd()
1738 user = acquire_ipmi_user(user, &index); in ipmi_unregister_for_cmd()
1739 if (!user) in ipmi_unregister_for_cmd()
1749 if (rcvr->user == user) { in ipmi_unregister_for_cmd()
1761 release_ipmi_user(user, index); in ipmi_unregister_for_cmd()
1935 * We don't let the user do these, since we manage in i_ipmi_req_sysintf()
2034 * It's a response, so use the user's sequence in i_ipmi_req_ipmb()
2214 * It's a response, so use the user's sequence in i_ipmi_req_lan()
2286 * Separate from ipmi_request so that the user does not have to be
2291 static int i_ipmi_request(struct ipmi_user *user, in i_ipmi_request() argument
2309 if (user) { in i_ipmi_request()
2310 if (atomic_add_return(1, &user->nr_msgs) > max_msgs_per_user) { in i_ipmi_request()
2346 recv_msg->user = user; in i_ipmi_request()
2347 if (user) in i_ipmi_request()
2349 kref_get(&user->refcount); in i_ipmi_request()
2389 if (rv && user) in i_ipmi_request()
2390 atomic_dec(&user->nr_msgs); in i_ipmi_request()
2407 int ipmi_request_settime(struct ipmi_user *user, in ipmi_request_settime() argument
2419 if (!user) in ipmi_request_settime()
2422 user = acquire_ipmi_user(user, &index); in ipmi_request_settime()
2423 if (!user) in ipmi_request_settime()
2426 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_settime()
2428 rv = i_ipmi_request(user, in ipmi_request_settime()
2429 user->intf, in ipmi_request_settime()
2441 release_ipmi_user(user, index); in ipmi_request_settime()
2446 int ipmi_request_supply_msgs(struct ipmi_user *user, in ipmi_request_supply_msgs() argument
2458 if (!user) in ipmi_request_supply_msgs()
2461 user = acquire_ipmi_user(user, &index); in ipmi_request_supply_msgs()
2462 if (!user) in ipmi_request_supply_msgs()
2465 rv = check_addr(user->intf, addr, &saddr, &lun); in ipmi_request_supply_msgs()
2467 rv = i_ipmi_request(user, in ipmi_request_supply_msgs()
2468 user->intf, in ipmi_request_supply_msgs()
2480 release_ipmi_user(user, index); in ipmi_request_supply_msgs()
3501 void ipmi_poll_interface(struct ipmi_user *user) in ipmi_poll_interface() argument
3503 ipmi_poll(user->intf); in ipmi_poll_interface()
3524 struct ipmi_user *user; in nr_msgs_show() local
3529 list_for_each_entry_rcu(user, &intf->users, link) in nr_msgs_show()
3530 count += atomic_read(&user->nr_msgs); in nr_msgs_show()
3786 struct ipmi_user *user = in ipmi_unregister_smi() local
3790 _ipmi_destroy_user(user); in ipmi_unregister_smi()
3877 struct ipmi_user *user = NULL; in handle_ipmb_get_msg_cmd() local
3899 user = rcvr->user; in handle_ipmb_get_msg_cmd()
3900 kref_get(&user->refcount); in handle_ipmb_get_msg_cmd()
3902 user = NULL; in handle_ipmb_get_msg_cmd()
3905 if (user == NULL) { in handle_ipmb_get_msg_cmd()
3906 /* We didn't find a user, deliver an error response. */ in handle_ipmb_get_msg_cmd()
3946 kref_put(&user->refcount, free_user); in handle_ipmb_get_msg_cmd()
3959 recv_msg->user = user; in handle_ipmb_get_msg_cmd()
3988 struct ipmi_user *user = NULL; in handle_ipmb_direct_rcv_cmd() local
3998 user = rcvr->user; in handle_ipmb_direct_rcv_cmd()
3999 kref_get(&user->refcount); in handle_ipmb_direct_rcv_cmd()
4001 user = NULL; in handle_ipmb_direct_rcv_cmd()
4004 if (user == NULL) { in handle_ipmb_direct_rcv_cmd()
4005 /* We didn't find a user, deliver an error response. */ in handle_ipmb_direct_rcv_cmd()
4037 kref_put(&user->refcount, free_user); in handle_ipmb_direct_rcv_cmd()
4051 recv_msg->user = user; in handle_ipmb_direct_rcv_cmd()
4177 struct ipmi_user *user = NULL; in handle_lan_get_msg_cmd() local
4199 user = rcvr->user; in handle_lan_get_msg_cmd()
4200 kref_get(&user->refcount); in handle_lan_get_msg_cmd()
4202 user = NULL; in handle_lan_get_msg_cmd()
4205 if (user == NULL) { in handle_lan_get_msg_cmd()
4206 /* We didn't find a user, just give up. */ in handle_lan_get_msg_cmd()
4222 kref_put(&user->refcount, free_user); in handle_lan_get_msg_cmd()
4238 recv_msg->user = user; in handle_lan_get_msg_cmd()
4276 struct ipmi_user *user = NULL; in handle_oem_get_msg_cmd() local
4306 user = rcvr->user; in handle_oem_get_msg_cmd()
4307 kref_get(&user->refcount); in handle_oem_get_msg_cmd()
4309 user = NULL; in handle_oem_get_msg_cmd()
4312 if (user == NULL) { in handle_oem_get_msg_cmd()
4313 /* We didn't find a user, just give up. */ in handle_oem_get_msg_cmd()
4331 kref_put(&user->refcount, free_user); in handle_oem_get_msg_cmd()
4345 recv_msg->user = user; in handle_oem_get_msg_cmd()
4392 struct ipmi_user *user; in handle_read_event_rsp() local
4414 * Allocate and fill in one message for every user that is in handle_read_event_rsp()
4418 list_for_each_entry_rcu(user, &intf->users, link) { in handle_read_event_rsp()
4419 if (!user->gets_events) in handle_read_event_rsp()
4442 recv_msg->user = user; in handle_read_event_rsp()
4443 kref_get(&user->refcount); in handle_read_event_rsp()
4638 * deliver a send message response to the user. in handle_one_recv_msg()
4796 struct ipmi_user *user; in handle_new_recv_msgs() local
4800 list_for_each_entry_rcu(user, &intf->users, link) { in handle_new_recv_msgs()
4801 if (user->handler->ipmi_watchdog_pretimeout) in handle_new_recv_msgs()
4802 user->handler->ipmi_watchdog_pretimeout( in handle_new_recv_msgs()
4803 user->handler_data); in handle_new_recv_msgs()
5158 rv->user = NULL; in ipmi_alloc_recv_msg()
5167 if (msg->user && !oops_in_progress) in ipmi_free_recv_msg()
5168 kref_put(&msg->user->refcount, free_user); in ipmi_free_recv_msg()
5401 struct ipmi_user *user; in panic_event() local
5438 list_for_each_entry_rcu(user, &intf->users, link) { in panic_event()
5439 if (user->handler->ipmi_panic_handler) in panic_event()
5440 user->handler->ipmi_panic_handler( in panic_event()
5441 user->handler_data); in panic_event()