diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 05:03:13 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 05:03:13 -0500 |
commit | 4b63bd35eb4e7959b0f7be17634689d34311524b (patch) | |
tree | 2dad174e4ef8cbe5ef86541a8496b5f97dcf35d1 /drivers/char/ipmi/ipmi_msghandler.c | |
parent | 03b6e6e58d9dd5f3068288653810db3c15fde929 (diff) | |
parent | e92b297cc72ade7a58eaec7e01c906d856f8ab6e (diff) | |
download | talos-obmc-linux-4b63bd35eb4e7959b0f7be17634689d34311524b.tar.gz talos-obmc-linux-4b63bd35eb4e7959b0f7be17634689d34311524b.zip |
Merge branch 'ipmi' into release
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: } EXPORT_SYMBOL(ipmi_create_user); +int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data) +{ + int rv = 0; + ipmi_smi_t intf; + struct ipmi_smi_handlers *handlers; + + mutex_lock(&ipmi_interfaces_mutex); + list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { + if (intf->intf_num == if_num) + goto found; + } + /* Not found, return an error */ + rv = -EINVAL; + mutex_unlock(&ipmi_interfaces_mutex); + return rv; + +found: + handlers = intf->handlers; + rv = -ENOSYS; + if (handlers->get_smi_info) + rv = handlers->get_smi_info(intf->send_info, data); + mutex_unlock(&ipmi_interfaces_mutex); + + return rv; +} +EXPORT_SYMBOL(ipmi_get_smi_info); + static void free_user(struct kref *ref) { ipmi_user_t user = container_of(ref, struct ipmi_user, refcount); |