summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ac.c3
-rw-r--r--drivers/acpi/battery.c3
-rw-r--r--drivers/acpi/bus.c4
-rw-r--r--drivers/acpi/event.c13
-rw-r--r--drivers/acpi/processor_core.c7
-rw-r--r--drivers/acpi/sbs.c1
-rw-r--r--drivers/acpi/thermal.c12
7 files changed, 35 insertions, 8 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index d8b35093527..b53c2cfcafd 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -205,6 +205,9 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
case ACPI_NOTIFY_DEVICE_CHECK:
acpi_ac_get_state(ac);
acpi_bus_generate_event(device, event, (u32) ac->state);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event,
+ (u32) ac->state);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index d7b499fe0cd..9f0bf90afda 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -869,6 +869,9 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
acpi_battery_notify_update(battery);
acpi_bus_generate_event(device, event,
acpi_battery_present(battery));
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event,
+ acpi_battery_present(battery));
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 6b2658c9624..e5084ececb6 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -292,10 +292,6 @@ int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
if (!device)
return -EINVAL;
- if (acpi_bus_generate_genetlink_event(device, type, data))
- printk(KERN_WARNING PREFIX
- "Failed to generate an ACPI event via genetlink!\n");
-
/* drop event on the floor if no one's listening */
if (!event_is_open)
return 0;
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 95637a4ff78..b7b143288c2 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -147,7 +147,8 @@ static struct genl_multicast_group acpi_event_mcgrp = {
.name = ACPI_GENL_MCAST_GROUP_NAME,
};
-int acpi_bus_generate_genetlink_event(struct acpi_device *device,
+int acpi_bus_generate_netlink_event(const char *device_class,
+ const char *bus_id,
u8 type, int data)
{
struct sk_buff *skb;
@@ -191,8 +192,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device,
memset(event, 0, sizeof(struct acpi_genl_event));
- strcpy(event->device_class, device->pnp.device_class);
- strcpy(event->bus_id, device->dev.bus_id);
+ strcpy(event->device_class, device_class);
+ strcpy(event->bus_id, bus_id);
event->type = type;
event->data = data;
@@ -211,6 +212,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device,
return 0;
}
+EXPORT_SYMBOL(acpi_bus_generate_netlink_event);
+
static int acpi_event_genetlink_init(void)
{
int result;
@@ -228,12 +231,14 @@ static int acpi_event_genetlink_init(void)
}
#else
-int acpi_bus_generate_genetlink_event(struct acpi_device *device, u8 type,
+int acpi_bus_generate_netlink_event(struct acpi_device *device, u8 type,
int data)
{
return 0;
}
+EXPORT_SYMBOL(acpi_generate_netlink_event);
+
static int acpi_event_genetlink_init(void)
{
return -ENODEV;
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 498422343f3..dbc2e5d9d6a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -700,14 +700,21 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
acpi_processor_ppc_has_changed(pr);
acpi_bus_generate_event(device, event,
pr->performance_platform_limit);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event,
+ pr->performance_platform_limit);
break;
case ACPI_PROCESSOR_NOTIFY_POWER:
acpi_processor_cst_has_changed(pr);
acpi_bus_generate_event(device, event, 0);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event, 0);
break;
case ACPI_PROCESSOR_NOTIFY_THROTTLING:
acpi_processor_tstate_has_changed(pr);
acpi_bus_generate_event(device, event, 0);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event, 0);
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 82c3a550016..2d67e92c8ff 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -445,6 +445,7 @@ static int acpi_sbs_generate_event(struct acpi_device *device,
strcpy(acpi_device_bid(device), bid_saved);
strcpy(acpi_device_class(device), class_saved);
+ acpi_bus_generate_netlink_event(class, bid, event, state);
return result;
}
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1e06159fd9c..291758c9a4d 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -487,6 +487,10 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
KELVIN_TO_CELSIUS(tz->temperature));
acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
tz->trips.critical.flags.enabled);
+ acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
+ tz->device->dev.bus_id,
+ ACPI_THERMAL_NOTIFY_CRITICAL,
+ tz->trips.critical.flags.enabled);
orderly_poweroff(true);
@@ -506,6 +510,10 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
tz->trips.hot.flags.enabled);
+ acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
+ tz->device->dev.bus_id,
+ ACPI_THERMAL_NOTIFY_HOT,
+ tz->trips.hot.flags.enabled);
/* TBD: Call user-mode "sleep(S4)" function */
@@ -1150,11 +1158,15 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
acpi_thermal_get_trip_points(tz);
acpi_thermal_check(tz);
acpi_bus_generate_event(device, event, 0);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event, 0);
break;
case ACPI_THERMAL_NOTIFY_DEVICES:
if (tz->flags.devices)
acpi_thermal_get_devices(tz);
acpi_bus_generate_event(device, event, 0);
+ acpi_bus_generate_netlink_event(device->pnp.device_class,
+ device->dev.bus_id, event, 0);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,