aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 23:15:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 23:15:35 -0500
commit52cfd503ad7176d23a5dd7af3981744feb60622f (patch)
tree0a8aeaaf4acbc86ac682f18632b8070c1c6b7ba1 /drivers/char
parentdc8e7e3ec60bd5ef7868aa88755e9d4c948dc5cc (diff)
parent4263d9a3ae4d15785897d0543bb59316c84ee605 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (59 commits) ACPI / PM: Fix build problems for !CONFIG_ACPI related to NVS rework ACPI: fix resource check message ACPI / Battery: Update information on info notification and resume ACPI: Drop device flag wake_capable ACPI: Always check if _PRW is present before trying to evaluate it ACPI / PM: Check status of power resources under mutexes ACPI / PM: Rename acpi_power_off_device() ACPI / PM: Drop acpi_power_nocheck ACPI / PM: Drop acpi_bus_get_power() Platform / x86: Make fujitsu_laptop use acpi_bus_update_power() ACPI / Fan: Rework the handling of power resources ACPI / PM: Register power resource devices as soon as they are needed ACPI / PM: Register acpi_power_driver early ACPI / PM: Add function for updating device power state consistently ACPI / PM: Add function for device power state initialization ACPI / PM: Introduce __acpi_bus_get_power() ACPI / PM: Introduce function for refcounting device power resources ACPI / PM: Add functions for manipulating lists of power resources ACPI / PM: Prevent acpi_power_get_inferred_state() from making changes ACPICA: Update version to 20101209 ...
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c27
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c23
2 files changed, 45 insertions, 5 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}
971EXPORT_SYMBOL(ipmi_create_user); 971EXPORT_SYMBOL(ipmi_create_user);
972 972
973int 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
989found:
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}
998EXPORT_SYMBOL(ipmi_get_smi_info);
999
973static void free_user(struct kref *ref) 1000static 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 f27c04e18aaa..b6ae6e9a9c5f 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"
@@ -109,10 +110,6 @@ enum si_type {
109}; 110};
110static char *si_to_str[] = { "kcs", "smic", "bt" }; 111static char *si_to_str[] = { "kcs", "smic", "bt" };
111 112
112enum ipmi_addr_src {
113 SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS,
114 SI_PCI, SI_DEVICETREE, SI_DEFAULT
115};
116static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI", 113static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI",
117 "ACPI", "SMBIOS", "PCI", 114 "ACPI", "SMBIOS", "PCI",
118 "device-tree", "default" }; 115 "device-tree", "default" };
@@ -293,6 +290,7 @@ struct smi_info {
293 struct task_struct *thread; 290 struct task_struct *thread;
294 291
295 struct list_head link; 292 struct list_head link;
293 union ipmi_smi_info_union addr_info;
296}; 294};
297 295
298#define smi_inc_stat(smi, stat) \ 296#define smi_inc_stat(smi, stat) \
@@ -1188,6 +1186,18 @@ static int smi_start_processing(void *send_info,
1188 return 0; 1186 return 0;
1189} 1187}
1190 1188
1189static int get_smi_info(void *send_info, struct ipmi_smi_info *data)
1190{
1191 struct smi_info *smi = send_info;
1192
1193 data->addr_src = smi->addr_source;
1194 data->dev = smi->dev;
1195 data->addr_info = smi->addr_info;
1196 get_device(smi->dev);
1197
1198 return 0;
1199}
1200
1191static void set_maintenance_mode(void *send_info, int enable) 1201static void set_maintenance_mode(void *send_info, int enable)
1192{ 1202{
1193 struct smi_info *smi_info = send_info; 1203 struct smi_info *smi_info = send_info;
@@ -1199,6 +1209,7 @@ static void set_maintenance_mode(void *send_info, int enable)
1199static struct ipmi_smi_handlers handlers = { 1209static struct ipmi_smi_handlers handlers = {
1200 .owner = THIS_MODULE, 1210 .owner = THIS_MODULE,
1201 .start_processing = smi_start_processing, 1211 .start_processing = smi_start_processing,
1212 .get_smi_info = get_smi_info,
1202 .sender = sender, 1213 .sender = sender,
1203 .request_events = request_events, 1214 .request_events = request_events,
1204 .set_maintenance_mode = set_maintenance_mode, 1215 .set_maintenance_mode = set_maintenance_mode,
@@ -1930,7 +1941,8 @@ static void __devinit hardcode_find_bmc(void)
1930static int acpi_failure; 1941static int acpi_failure;
1931 1942
1932/* For GPE-type interrupts. */ 1943/* For GPE-type interrupts. */
1933static u32 ipmi_acpi_gpe(void *context) 1944static u32 ipmi_acpi_gpe(acpi_handle gpe_device,
1945 u32 gpe_number, void *context)
1934{ 1946{
1935 struct smi_info *smi_info = context; 1947 struct smi_info *smi_info = context;
1936 unsigned long flags; 1948 unsigned long flags;
@@ -2158,6 +2170,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
2158 printk(KERN_INFO PFX "probing via ACPI\n"); 2170 printk(KERN_INFO PFX "probing via ACPI\n");
2159 2171
2160 handle = acpi_dev->handle; 2172 handle = acpi_dev->handle;
2173 info->addr_info.acpi_info.acpi_handle = handle;
2161 2174
2162 /* _IFT tells us the interface type: KCS, BT, etc */ 2175 /* _IFT tells us the interface type: KCS, BT, etc */
2163 status = acpi_evaluate_integer(handle, "_IFT", NULL, &tmp); 2176 status = acpi_evaluate_integer(handle, "_IFT", NULL, &tmp);