2 # Copyright (c) 2009 Michael Gmelin
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 # $FreeBSD: src/sys/dev/acpi_support/acpi_wmi_if.m,v 1.2 2009/06/30 09:51:41 rpaulo Exp $
30 #include <sys/types.h>
31 #include <contrib/dev/acpica/include/acpi.h>
36 # Default implementation for acpi_wmi_generic_provides_guid_string().
40 acpi_wmi_generic_provides_guid_string(device_t dev, const char* guid_string)
48 # Check if given GUID exists in WMI
49 # Returns number of instances (max_instace+1) or 0 if guid doesn't exist
51 # device_t dev: Device to probe
52 # const char* guid_string: String form of the GUID
54 METHOD int provides_guid_string {
56 const char* guid_string;
57 } DEFAULT acpi_wmi_generic_provides_guid_string;
60 # Evaluate a WMI method call
62 # device_t dev: Device to use
63 # const char* guid_string: String form of the GUID
64 # UINT8 instance: instance id
65 # UINT32 method_id: method to call
66 # const ACPI_BUFFER* in: input data
67 # ACPI_BUFFER* out: output buffer
69 METHOD ACPI_STATUS evaluate_call {
71 const char *guid_string;
74 const ACPI_BUFFER *in;
79 # Get content of a WMI block
81 # device_t dev: Device to use
82 # const char* guid_string: String form of the GUID
83 # UINT8 instance: instance id
84 # ACPI_BUFFER* out: output buffer
86 METHOD ACPI_STATUS get_block {
88 const char *guid_string;
93 # Write to a WMI data block
95 # device_t dev: Device to use
96 # const char* guid_string: String form of the GUID
97 # UINT8 instance: instance id
98 # const ACPI_BUFFER* in: input data
100 METHOD ACPI_STATUS set_block {
102 const char *guid_string;
104 const ACPI_BUFFER *in;
108 # Install wmi event handler
110 # device_t dev: Device to use
111 # const char* guid_string: String form of the GUID
112 # ACPI_NOTIFY_HANDLER handler: Handler
113 # void* data: Payload
115 METHOD ACPI_STATUS install_event_handler {
117 const char *guid_string;
118 ACPI_NOTIFY_HANDLER handler;
123 # Remove wmi event handler
125 # device_t dev: Device to use
126 # const char* guid_string: String form of the GUID
128 METHOD ACPI_STATUS remove_event_handler {
130 const char *guid_string;
135 # Get event data associated to an event
137 # device_t dev: Device to use
138 # UINT32 event_id: event id
139 # ACPI_BUFFER* out: output buffer
141 METHOD ACPI_STATUS get_event_data {