Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
wmi.c File Reference
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/list.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

Go to the source code of this file.

Data Structures

struct  guid_block
 
struct  wmi_block
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define ACPI_WMI_CLASS   "wmi"
 
#define ACPI_WMI_EXPENSIVE   0x1
 
#define ACPI_WMI_METHOD   0x2 /* GUID is a method */
 
#define ACPI_WMI_STRING   0x4 /* GUID takes & returns a string */
 
#define ACPI_WMI_EVENT   0x8 /* GUID is an event */
 

Functions

 ACPI_MODULE_NAME ("wmi")
 
 MODULE_AUTHOR ("Carlos Corbacho")
 
 MODULE_DESCRIPTION ("ACPI-WMI Mapping Driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug_event, bool, 0444)
 
 MODULE_PARM_DESC (debug_event,"Log WMI Events [0/1]")
 
 module_param (debug_dump_wdg, bool, 0444)
 
 MODULE_PARM_DESC (debug_dump_wdg,"Dump available WMI interfaces [0/1]")
 
 MODULE_DEVICE_TABLE (acpi, wmi_device_ids)
 
acpi_status wmi_evaluate_method (const char *guid_string, u8 instance, u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
 
 EXPORT_SYMBOL_GPL (wmi_evaluate_method)
 
acpi_status wmi_query_block (const char *guid_string, u8 instance, struct acpi_buffer *out)
 
 EXPORT_SYMBOL_GPL (wmi_query_block)
 
acpi_status wmi_set_block (const char *guid_string, u8 instance, const struct acpi_buffer *in)
 
 EXPORT_SYMBOL_GPL (wmi_set_block)
 
acpi_status wmi_install_notify_handler (const char *guid, wmi_notify_handler handler, void *data)
 
 EXPORT_SYMBOL_GPL (wmi_install_notify_handler)
 
acpi_status wmi_remove_notify_handler (const char *guid)
 
 EXPORT_SYMBOL_GPL (wmi_remove_notify_handler)
 
acpi_status wmi_get_event_data (u32 event, struct acpi_buffer *out)
 
 EXPORT_SYMBOL_GPL (wmi_get_event_data)
 
bool wmi_has_guid (const char *guid_string)
 
 EXPORT_SYMBOL_GPL (wmi_has_guid)
 
 subsys_initcall (acpi_wmi_init)
 
 module_exit (acpi_wmi_exit)
 

Macro Definition Documentation

#define ACPI_WMI_CLASS   "wmi"

Definition at line 48 of file wmi.c.

#define ACPI_WMI_EVENT   0x8 /* GUID is an event */

Definition at line 83 of file wmi.c.

#define ACPI_WMI_EXPENSIVE   0x1

Definition at line 80 of file wmi.c.

#define ACPI_WMI_METHOD   0x2 /* GUID is a method */

Definition at line 81 of file wmi.c.

#define ACPI_WMI_STRING   0x4 /* GUID takes & returns a string */

Definition at line 82 of file wmi.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 30 of file wmi.c.

Function Documentation

ACPI_MODULE_NAME ( "wmi"  )
EXPORT_SYMBOL_GPL ( wmi_evaluate_method  )
EXPORT_SYMBOL_GPL ( wmi_query_block  )
EXPORT_SYMBOL_GPL ( wmi_set_block  )
EXPORT_SYMBOL_GPL ( wmi_install_notify_handler  )
EXPORT_SYMBOL_GPL ( wmi_remove_notify_handler  )
EXPORT_SYMBOL_GPL ( wmi_get_event_data  )
EXPORT_SYMBOL_GPL ( wmi_has_guid  )
MODULE_AUTHOR ( "Carlos Corbacho"  )
MODULE_DESCRIPTION ( "ACPI-WMI Mapping Driver"  )
MODULE_DEVICE_TABLE ( acpi  ,
wmi_device_ids   
)
module_exit ( acpi_wmi_exit  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug_event  ,
bool  ,
0444   
)
module_param ( debug_dump_wdg  ,
bool  ,
0444   
)
MODULE_PARM_DESC ( debug_event  ,
"Log WMI Events "  [0/1] 
)
MODULE_PARM_DESC ( debug_dump_wdg  ,
"Dump available WMI interfaces "  [0/1] 
)
subsys_initcall ( acpi_wmi_init  )
acpi_status wmi_evaluate_method ( const char guid_string,
u8  instance,
u32  method_id,
const struct acpi_buffer in,
struct acpi_buffer out 
)

wmi_evaluate_method - Evaluate a WMI method : 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba : Instance index : Method ID to call &in: Buffer containing input for the method call &out: Empty buffer to return the method results

Call an ACPI-WMI method

Definition at line 293 of file wmi.c.

acpi_status wmi_get_event_data ( u32  event,
struct acpi_buffer out 
)

wmi_get_event_data - Get WMI data associated with an event

: Event to find : Buffer to hold event data. out->pointer should be freed with kfree()

Returns extra data associated with an event in WMI.

Definition at line 640 of file wmi.c.

bool wmi_has_guid ( const char guid_string)

wmi_has_guid - Check if a GUID is available : 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba

Check if a given GUID is defined by _WDG

Definition at line 673 of file wmi.c.

acpi_status wmi_install_notify_handler ( const char guid,
wmi_notify_handler  handler,
void data 
)

wmi_install_notify_handler - Register handler for WMI events : Function to handle notifications : Data to be returned to handler when event is fired

Register a handler for events sent to the ACPI-WMI mapper device.

Definition at line 549 of file wmi.c.

acpi_status wmi_query_block ( const char guid_string,
u8  instance,
struct acpi_buffer out 
)

wmi_query_block - Return contents of a WMI block : 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba : Instance index &out: Empty buffer to return the contents of the data block to

Return the contents of an ACPI-WMI data block to a buffer

Definition at line 351 of file wmi.c.

acpi_status wmi_remove_notify_handler ( const char guid)

wmi_uninstall_notify_handler - Unregister handler for WMI events

Unregister handler for events sent to the ACPI-WMI mapper device.

Definition at line 591 of file wmi.c.

acpi_status wmi_set_block ( const char guid_string,
u8  instance,
const struct acpi_buffer in 
)

wmi_set_block - Write to a WMI block : 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba : Instance index &in: Buffer containing new values for the data block

Write the contents of the input buffer to an ACPI-WMI data block

Definition at line 434 of file wmi.c.