aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/event.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2007-07-20 04:41:14 -0400
committerLen Brown <len.brown@intel.com>2007-07-22 01:05:16 -0400
commit9c977a453ed62396d067b75f3f272b3fb1ea3acc (patch)
tree22fe94df2db27b5e6efdcfe9ba307bd671a0bb45 /drivers/acpi/event.c
parentb563d6f30d937510e02541930b1558d0f5759413 (diff)
ACPI: export ACPI events via acpi_mc_group multicast group
This is an incremental patch for the recent genetlink multicast changes. Now ACPI events are exported via generic netlink multicast group. Thanks for Johannes' help on developing this patch Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/event.c')
-rw-r--r--drivers/acpi/event.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index de4def9b5515..dfa5853b17f0 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -132,30 +132,19 @@ enum {
132}; 132};
133#define ACPI_GENL_CMD_MAX (__ACPI_GENL_CMD_MAX - 1) 133#define ACPI_GENL_CMD_MAX (__ACPI_GENL_CMD_MAX - 1)
134 134
135#define ACPI_GENL_NAME "acpi_event" 135#define ACPI_GENL_FAMILY_NAME "acpi_event"
136#define ACPI_GENL_VERSION 0x01 136#define ACPI_GENL_VERSION 0x01
137#define ACPI_GENL_MCAST_GROUP_NAME "acpi_mc_group"
137 138
138static struct genl_family acpi_event_genl_family = { 139static struct genl_family acpi_event_genl_family = {
139 .id = GENL_ID_GENERATE, 140 .id = GENL_ID_GENERATE,
140 .name = ACPI_GENL_NAME, 141 .name = ACPI_GENL_FAMILY_NAME,
141 .version = ACPI_GENL_VERSION, 142 .version = ACPI_GENL_VERSION,
142 .maxattr = ACPI_GENL_ATTR_MAX, 143 .maxattr = ACPI_GENL_ATTR_MAX,
143}; 144};
144 145
145/* .doit: standard command callback */ 146static struct genl_multicast_group acpi_event_mcgrp = {
146static int acpi_genl_cmd_event(struct sk_buff *skb, struct genl_info *info) 147 .name = ACPI_GENL_MCAST_GROUP_NAME,
147{
148 struct acpi_genl_event *event = info->userhdr;
149
150 if (!event)
151 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "ACPI event: NULL\n"));
152
153 return 0;
154}
155
156static struct genl_ops acpi_event_genl_ops = {
157 .cmd = ACPI_GENL_CMD_EVENT,
158 .doit = acpi_genl_cmd_event,
159}; 148};
160 149
161int acpi_bus_generate_genetlink_event(struct acpi_device *device, 150int acpi_bus_generate_genetlink_event(struct acpi_device *device,
@@ -215,7 +204,7 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device,
215 } 204 }
216 205
217 result = 206 result =
218 genlmsg_multicast(skb, 0, acpi_event_genl_family.id, GFP_ATOMIC); 207 genlmsg_multicast(skb, 0, acpi_event_mcgrp.id, GFP_ATOMIC);
219 if (result) 208 if (result)
220 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 209 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
221 "Failed to send a Genetlink message!\n")); 210 "Failed to send a Genetlink message!\n"));
@@ -230,8 +219,8 @@ static int acpi_event_genetlink_init(void)
230 if (result) 219 if (result)
231 return result; 220 return result;
232 221
233 result = 222 result = genl_register_mc_group(&acpi_event_genl_family,
234 genl_register_ops(&acpi_event_genl_family, &acpi_event_genl_ops); 223 &acpi_event_mcgrp);
235 if (result) 224 if (result)
236 genl_unregister_family(&acpi_event_genl_family); 225 genl_unregister_family(&acpi_event_genl_family);
237 226