diff options
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 2fe72f8edf44..38223e93aa98 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -970,6 +970,33 @@ out_kfree: | |||
970 | } | 970 | } |
971 | EXPORT_SYMBOL(ipmi_create_user); | 971 | EXPORT_SYMBOL(ipmi_create_user); |
972 | 972 | ||
973 | int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data) | ||
974 | { | ||
975 | int rv = 0; | ||
976 | ipmi_smi_t intf; | ||
977 | struct ipmi_smi_handlers *handlers; | ||
978 | |||
979 | mutex_lock(&ipmi_interfaces_mutex); | ||
980 | list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { | ||
981 | if (intf->intf_num == if_num) | ||
982 | goto found; | ||
983 | } | ||
984 | /* Not found, return an error */ | ||
985 | rv = -EINVAL; | ||
986 | mutex_unlock(&ipmi_interfaces_mutex); | ||
987 | return rv; | ||
988 | |||
989 | found: | ||
990 | handlers = intf->handlers; | ||
991 | rv = -ENOSYS; | ||
992 | if (handlers->get_smi_info) | ||
993 | rv = handlers->get_smi_info(intf->send_info, data); | ||
994 | mutex_unlock(&ipmi_interfaces_mutex); | ||
995 | |||
996 | return rv; | ||
997 | } | ||
998 | EXPORT_SYMBOL(ipmi_get_smi_info); | ||
999 | |||
973 | static void free_user(struct kref *ref) | 1000 | static void free_user(struct kref *ref) |
974 | { | 1001 | { |
975 | ipmi_user_t user = container_of(ref, struct ipmi_user, refcount); | 1002 | ipmi_user_t user = container_of(ref, struct ipmi_user, refcount); |