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 | |
parent | 03b6e6e58d9dd5f3068288653810db3c15fde929 (diff) | |
parent | e92b297cc72ade7a58eaec7e01c906d856f8ab6e (diff) |
Merge branch 'ipmi' into release
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 27 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 20 |
2 files changed, 43 insertions, 4 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); |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index c4bacc6ec450..3a3643c6a579 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -57,6 +57,7 @@ | |||
57 | #include <asm/irq.h> | 57 | #include <asm/irq.h> |
58 | #include <linux/interrupt.h> | 58 | #include <linux/interrupt.h> |
59 | #include <linux/rcupdate.h> | 59 | #include <linux/rcupdate.h> |
60 | #include <linux/ipmi.h> | ||
60 | #include <linux/ipmi_smi.h> | 61 | #include <linux/ipmi_smi.h> |
61 | #include <asm/io.h> | 62 | #include <asm/io.h> |
62 | #include "ipmi_si_sm.h" | 63 | #include "ipmi_si_sm.h" |
@@ -107,10 +108,6 @@ enum si_type { | |||
107 | }; | 108 | }; |
108 | static char *si_to_str[] = { "kcs", "smic", "bt" }; | 109 | static char *si_to_str[] = { "kcs", "smic", "bt" }; |
109 | 110 | ||
110 | enum ipmi_addr_src { | ||
111 | SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS, | ||
112 | SI_PCI, SI_DEVICETREE, SI_DEFAULT | ||
113 | }; | ||
114 | static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI", | 111 | static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI", |
115 | "ACPI", "SMBIOS", "PCI", | 112 | "ACPI", "SMBIOS", "PCI", |
116 | "device-tree", "default" }; | 113 | "device-tree", "default" }; |
@@ -291,6 +288,7 @@ struct smi_info { | |||
291 | struct task_struct *thread; | 288 | struct task_struct *thread; |
292 | 289 | ||
293 | struct list_head link; | 290 | struct list_head link; |
291 | union ipmi_smi_info_union addr_info; | ||
294 | }; | 292 | }; |
295 | 293 | ||
296 | #define smi_inc_stat(smi, stat) \ | 294 | #define smi_inc_stat(smi, stat) \ |
@@ -1186,6 +1184,18 @@ static int smi_start_processing(void *send_info, | |||
1186 | return 0; | 1184 | return 0; |
1187 | } | 1185 | } |
1188 | 1186 | ||
1187 | static int get_smi_info(void *send_info, struct ipmi_smi_info *data) | ||
1188 | { | ||
1189 | struct smi_info *smi = send_info; | ||
1190 | |||
1191 | data->addr_src = smi->addr_source; | ||
1192 | data->dev = smi->dev; | ||
1193 | data->addr_info = smi->addr_info; | ||
1194 | get_device(smi->dev); | ||
1195 | |||
1196 | return 0; | ||
1197 | } | ||
1198 | |||
1189 | static void set_maintenance_mode(void *send_info, int enable) | 1199 | static void set_maintenance_mode(void *send_info, int enable) |
1190 | { | 1200 | { |
1191 | struct smi_info *smi_info = send_info; | 1201 | struct smi_info *smi_info = send_info; |
@@ -1197,6 +1207,7 @@ static void set_maintenance_mode(void *send_info, int enable) | |||
1197 | static struct ipmi_smi_handlers handlers = { | 1207 | static struct ipmi_smi_handlers handlers = { |
1198 | .owner = THIS_MODULE, | 1208 | .owner = THIS_MODULE, |
1199 | .start_processing = smi_start_processing, | 1209 | .start_processing = smi_start_processing, |
1210 | .get_smi_info = get_smi_info, | ||
1200 | .sender = sender, | 1211 | .sender = sender, |
1201 | .request_events = request_events, | 1212 | .request_events = request_events, |
1202 | .set_maintenance_mode = set_maintenance_mode, | 1213 | .set_maintenance_mode = set_maintenance_mode, |
@@ -2157,6 +2168,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev, | |||
2157 | printk(KERN_INFO PFX "probing via ACPI\n"); | 2168 | printk(KERN_INFO PFX "probing via ACPI\n"); |
2158 | 2169 | ||
2159 | handle = acpi_dev->handle; | 2170 | handle = acpi_dev->handle; |
2171 | info->addr_info.acpi_info.acpi_handle = handle; | ||
2160 | 2172 | ||
2161 | /* _IFT tells us the interface type: KCS, BT, etc */ | 2173 | /* _IFT tells us the interface type: KCS, BT, etc */ |
2162 | status = acpi_evaluate_integer(handle, "_IFT", NULL, &tmp); | 2174 | status = acpi_evaluate_integer(handle, "_IFT", NULL, &tmp); |