Lines Matching full:user
194 * The main "user" data structure.
200 * Set to NULL when the user is destroyed, a pointer to myself
212 /* The interface this user is bound to. */
222 static struct ipmi_user *acquire_ipmi_user(struct ipmi_user *user, int *index) in acquire_ipmi_user() argument
223 __acquires(user->release_barrier) in acquire_ipmi_user()
227 *index = srcu_read_lock(&user->release_barrier); in acquire_ipmi_user()
228 ruser = srcu_dereference(user->self, &user->release_barrier); in acquire_ipmi_user()
230 srcu_read_unlock(&user->release_barrier, *index); in acquire_ipmi_user()
234 static void release_ipmi_user(struct ipmi_user *user, int index) in release_ipmi_user() argument
236 srcu_read_unlock(&user->release_barrier, index); in release_ipmi_user()
242 struct ipmi_user *user; member
309 * but may be changed by the user.
350 /* Commands we got from the user that were invalid. */
356 /* Responses from the MC that were delivered to a user. */
359 /* Responses from the MC that were not delivered to a user. */
387 /* The response was delivered to the user. */
414 /* The response was delivered to the user. */
423 /* The command was delivered to the user. */
581 * interface comes in with a NULL user, call this routine with
898 if (!msg->user) { in deliver_response()
916 struct ipmi_user *user = acquire_ipmi_user(msg->user, &index); in deliver_response() local
918 if (user) { in deliver_response()
919 user->handler->ipmi_recv_hndl(msg, user->handler_data); in deliver_response()
920 release_ipmi_user(user, index); in deliver_response()
922 /* User went away, give up. */ in deliver_response()
1115 * We do this verification because the user can be deleted in intf_start_seq_timer()
1145 * We do this verification because the user can be deleted in intf_err_seq()
1167 struct ipmi_user *user = container_of(work, struct ipmi_user, in free_user_work() local
1170 cleanup_srcu_struct(&user->release_barrier); in free_user_work()
1171 kfree(user); in free_user_work()
1177 struct ipmi_user **user) in ipmi_create_user() argument
1223 /* Note that each existing user holds a refcount to the interface. */ in ipmi_create_user()
1237 /* User wants pretimeouts, so make sure to watch for them. */ in ipmi_create_user()
1240 *user = new_user; in ipmi_create_user()
1278 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount); in free_user() local
1281 schedule_work(&user->remove_work); in free_user()
1284 static void _ipmi_destroy_user(struct ipmi_user *user) in _ipmi_destroy_user() argument
1286 struct ipmi_smi *intf = user->intf; in _ipmi_destroy_user()
1292 if (!acquire_ipmi_user(user, &i)) { in _ipmi_destroy_user()
1294 * The user has already been cleaned up, just make sure in _ipmi_destroy_user()
1297 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1301 rcu_assign_pointer(user->self, NULL); in _ipmi_destroy_user()
1302 release_ipmi_user(user, i); in _ipmi_destroy_user()
1304 synchronize_srcu(&user->release_barrier); in _ipmi_destroy_user()
1306 if (user->handler->shutdown) in _ipmi_destroy_user()
1307 user->handler->shutdown(user->handler_data); in _ipmi_destroy_user()
1309 if (user->handler->ipmi_watchdog_pretimeout) in _ipmi_destroy_user()
1312 if (user->gets_events) in _ipmi_destroy_user()
1315 /* Remove the user from the interface's sequence table. */ in _ipmi_destroy_user()
1317 list_del_rcu(&user->link); in _ipmi_destroy_user()
1321 && (intf->seq_table[i].recv_msg->user == user)) { in _ipmi_destroy_user()
1330 * Remove the user from the command receiver's table. First in _ipmi_destroy_user()
1337 if (rcvr->user == user) { in _ipmi_destroy_user()
1354 int ipmi_destroy_user(struct ipmi_user *user) in ipmi_destroy_user() argument
1356 _ipmi_destroy_user(user); in ipmi_destroy_user()
1358 kref_put(&user->refcount, free_user); in ipmi_destroy_user()
1364 int ipmi_get_version(struct ipmi_user *user, in ipmi_get_version() argument
1371 user = acquire_ipmi_user(user, &index); in ipmi_get_version()
1372 if (!user) in ipmi_get_version()
1375 rv = bmc_get_device_id(user->intf, NULL, &id, NULL, NULL); in ipmi_get_version()
1380 release_ipmi_user(user, index); in ipmi_get_version()
1386 int ipmi_set_my_address(struct ipmi_user *user, in ipmi_set_my_address() argument
1392 user = acquire_ipmi_user(user, &index); in ipmi_set_my_address()
1393 if (!user) in ipmi_set_my_address()
1400 user->intf->addrinfo[channel].address = address; in ipmi_set_my_address()
1402 release_ipmi_user(user, index); in ipmi_set_my_address()
1408 int ipmi_get_my_address(struct ipmi_user *user, in ipmi_get_my_address() argument
1414 user = acquire_ipmi_user(user, &index); in ipmi_get_my_address()
1415 if (!user) in ipmi_get_my_address()
1422 *address = user->intf->addrinfo[channel].address; in ipmi_get_my_address()
1424 release_ipmi_user(user, index); in ipmi_get_my_address()
1430 int ipmi_set_my_LUN(struct ipmi_user *user, in ipmi_set_my_LUN() argument
1436 user = acquire_ipmi_user(user, &index); in ipmi_set_my_LUN()
1437 if (!user) in ipmi_set_my_LUN()
1444 user->intf->addrinfo[channel].lun = LUN & 0x3; in ipmi_set_my_LUN()
1446 release_ipmi_user(user, index); in ipmi_set_my_LUN()
1452 int ipmi_get_my_LUN(struct ipmi_user *user, in ipmi_get_my_LUN() argument
1458 user = acquire_ipmi_user(user, &index); in ipmi_get_my_LUN()
1459 if (!user) in ipmi_get_my_LUN()
1466 *address = user->intf->addrinfo[channel].lun; in ipmi_get_my_LUN()
1468 release_ipmi_user(user, index); in ipmi_get_my_LUN()
1474 int ipmi_get_maintenance_mode(struct ipmi_user *user) in ipmi_get_maintenance_mode() argument
1479 user = acquire_ipmi_user(user, &index); in ipmi_get_maintenance_mode()
1480 if (!user) in ipmi_get_maintenance_mode()
1483 spin_lock_irqsave(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1484 mode = user->intf->maintenance_mode; in ipmi_get_maintenance_mode()
1485 spin_unlock_irqrestore(&user->intf->maintenance_mode_lock, flags); in ipmi_get_maintenance_mode()
1486 release_ipmi_user(user, index); in ipmi_get_maintenance_mode()
1499 int ipmi_set_maintenance_mode(struct ipmi_user *user, int mode) in ipmi_set_maintenance_mode() argument
1503 struct ipmi_smi *intf = user->intf; in ipmi_set_maintenance_mode()
1505 user = acquire_ipmi_user(user, &index); in ipmi_set_maintenance_mode()
1506 if (!user) in ipmi_set_maintenance_mode()
1535 release_ipmi_user(user, index); in ipmi_set_maintenance_mode()
1541 int ipmi_set_gets_events(struct ipmi_user *user, bool val) in ipmi_set_gets_events() argument
1544 struct ipmi_smi *intf = user->intf; in ipmi_set_gets_events()
1549 user = acquire_ipmi_user(user, &index); in ipmi_set_gets_events()
1550 if (!user) in ipmi_set_gets_events()
1556 if (user->gets_events == val) in ipmi_set_gets_events()
1559 user->gets_events = val; in ipmi_set_gets_events()
1576 while (user->gets_events && !list_empty(&intf->waiting_events)) { in ipmi_set_gets_events()
1589 msg->user = user; in ipmi_set_gets_events()
1590 kref_get(&user->refcount); in ipmi_set_gets_events()
1600 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()
3363 void ipmi_poll_interface(struct ipmi_user *user) in ipmi_poll_interface() argument
3365 ipmi_poll(user->intf); in ipmi_poll_interface()
3596 struct ipmi_user *user = in ipmi_unregister_smi() local
3600 _ipmi_destroy_user(user); in ipmi_unregister_smi()
3687 struct ipmi_user *user = NULL; in handle_ipmb_get_msg_cmd() local
3709 user = rcvr->user; in handle_ipmb_get_msg_cmd()
3710 kref_get(&user->refcount); in handle_ipmb_get_msg_cmd()
3712 user = NULL; in handle_ipmb_get_msg_cmd()
3715 if (user == NULL) { in handle_ipmb_get_msg_cmd()
3716 /* We didn't find a user, deliver an error response. */ in handle_ipmb_get_msg_cmd()
3755 kref_put(&user->refcount, free_user); in handle_ipmb_get_msg_cmd()
3768 recv_msg->user = user; in handle_ipmb_get_msg_cmd()
3867 struct ipmi_user *user = NULL; in handle_lan_get_msg_cmd() local
3889 user = rcvr->user; in handle_lan_get_msg_cmd()
3890 kref_get(&user->refcount); in handle_lan_get_msg_cmd()
3892 user = NULL; in handle_lan_get_msg_cmd()
3895 if (user == NULL) { in handle_lan_get_msg_cmd()
3896 /* We didn't find a user, just give up. */ in handle_lan_get_msg_cmd()
3912 kref_put(&user->refcount, free_user); in handle_lan_get_msg_cmd()
3928 recv_msg->user = user; in handle_lan_get_msg_cmd()
3966 struct ipmi_user *user = NULL; in handle_oem_get_msg_cmd() local
3996 user = rcvr->user; in handle_oem_get_msg_cmd()
3997 kref_get(&user->refcount); in handle_oem_get_msg_cmd()
3999 user = NULL; in handle_oem_get_msg_cmd()
4002 if (user == NULL) { in handle_oem_get_msg_cmd()
4003 /* We didn't find a user, just give up. */ in handle_oem_get_msg_cmd()
4021 kref_put(&user->refcount, free_user); in handle_oem_get_msg_cmd()
4035 recv_msg->user = user; in handle_oem_get_msg_cmd()
4082 struct ipmi_user *user; in handle_read_event_rsp() local
4104 * Allocate and fill in one message for every user that is in handle_read_event_rsp()
4108 list_for_each_entry_rcu(user, &intf->users, link) { in handle_read_event_rsp()
4109 if (!user->gets_events) in handle_read_event_rsp()
4132 recv_msg->user = user; in handle_read_event_rsp()
4133 kref_get(&user->refcount); in handle_read_event_rsp()
4301 * deliver a send message response to the user. in handle_one_recv_msg()
4459 struct ipmi_user *user; in handle_new_recv_msgs() local
4463 list_for_each_entry_rcu(user, &intf->users, link) { in handle_new_recv_msgs()
4464 if (user->handler->ipmi_watchdog_pretimeout) in handle_new_recv_msgs()
4465 user->handler->ipmi_watchdog_pretimeout( in handle_new_recv_msgs()
4466 user->handler_data); in handle_new_recv_msgs()
4815 rv->user = NULL; in ipmi_alloc_recv_msg()
4824 if (msg->user) in ipmi_free_recv_msg()
4825 kref_put(&msg->user->refcount, free_user); in ipmi_free_recv_msg()
5058 struct ipmi_user *user; in panic_event() local
5095 list_for_each_entry_rcu(user, &intf->users, link) { in panic_event()
5096 if (user->handler->ipmi_panic_handler) in panic_event()
5097 user->handler->ipmi_panic_handler( in panic_event()
5098 user->handler_data); in panic_event()