aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2010-05-03 09:30:17 -0400
committerMatthew Garrett <mjg@redhat.com>2010-05-20 09:46:21 -0400
commita929aae0e0a91d89b60774316ede6c1e2e10dc4e (patch)
tree875cd67cbaf2c7c58c465d96b5118c18ff56f02d /drivers/platform
parent7715348cbe28da80fd5372fd68748e852a9d8468 (diff)
X86 platfrom wmi: Add debug facility to dump WMI data in a readable way
Signed-off-by: Thomas Renninger <trenn@suse.de> CC: platform-driver-x86@vger.kernel.org CC: mjg59@srcf.ucam.org CC: corentin.chary@gmail.com Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/wmi.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index f16768db4468..e4eaa14ed987 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -86,6 +86,11 @@ module_param(debug_event, bool, 0444);
86MODULE_PARM_DESC(debug_event, 86MODULE_PARM_DESC(debug_event,
87 "Log WMI Events [0/1]"); 87 "Log WMI Events [0/1]");
88 88
89static int debug_dump_wdg;
90module_param(debug_dump_wdg, bool, 0444);
91MODULE_PARM_DESC(debug_dump_wdg,
92 "Dump available WMI interfaces [0/1]");
93
89static int acpi_wmi_remove(struct acpi_device *device, int type); 94static int acpi_wmi_remove(struct acpi_device *device, int type);
90static int acpi_wmi_add(struct acpi_device *device); 95static int acpi_wmi_add(struct acpi_device *device);
91static void acpi_wmi_notify(struct acpi_device *device, u32 event); 96static void acpi_wmi_notify(struct acpi_device *device, u32 event);
@@ -482,6 +487,33 @@ const struct acpi_buffer *in)
482} 487}
483EXPORT_SYMBOL_GPL(wmi_set_block); 488EXPORT_SYMBOL_GPL(wmi_set_block);
484 489
490static void wmi_dump_wdg(struct guid_block *g)
491{
492 char guid_string[37];
493
494 wmi_gtoa(g->guid, guid_string);
495 printk(KERN_INFO PREFIX "%s:\n", guid_string);
496 printk(KERN_INFO PREFIX "\tobject_id: %c%c\n",
497 g->object_id[0], g->object_id[1]);
498 printk(KERN_INFO PREFIX "\tnotify_id: %02X\n", g->notify_id);
499 printk(KERN_INFO PREFIX "\treserved: %02X\n", g->reserved);
500 printk(KERN_INFO PREFIX "\tinstance_count: %d\n", g->instance_count);
501 printk(KERN_INFO PREFIX "\tflags: %#x", g->flags);
502 if (g->flags) {
503 printk(" ");
504 if (g->flags & ACPI_WMI_EXPENSIVE)
505 printk("ACPI_WMI_EXPENSIVE ");
506 if (g->flags & ACPI_WMI_METHOD)
507 printk("ACPI_WMI_METHOD ");
508 if (g->flags & ACPI_WMI_STRING)
509 printk("ACPI_WMI_STRING ");
510 if (g->flags & ACPI_WMI_EVENT)
511 printk("ACPI_WMI_EVENT ");
512 }
513 printk("\n");
514
515}
516
485static void wmi_notify_debug(u32 value, void *context) 517static void wmi_notify_debug(u32 value, void *context)
486{ 518{
487 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 519 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -812,6 +844,9 @@ static __init acpi_status parse_wdg(acpi_handle handle)
812 guid_string); 844 guid_string);
813 continue; 845 continue;
814 } 846 }
847 if (debug_dump_wdg)
848 wmi_dump_wdg(&gblock[i]);
849
815 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); 850 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
816 if (!wblock) 851 if (!wblock)
817 return AE_NO_MEMORY; 852 return AE_NO_MEMORY;