ReactOS 0.4.15-dev-7942-gd23573b
cmbatt.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS ACPI-Compliant Control Method Battery
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/drivers/bus/acpi/cmbatt/cmbatt.h
5 * PURPOSE: Main Header File
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9#ifndef _CMBATT_PCH_
10#define _CMBATT_PCH_
11
12#include <wdm.h>
13#include <batclass.h>
14#include <wmilib.h>
15#include <wdmguid.h>
16
17#define IOCTL_BATTERY_QUERY_UNIQUE_ID \
18 CTL_CODE(FILE_DEVICE_BATTERY, 0x101, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x294404
19
20#define IOCTL_BATTERY_QUERY_STA \
21 CTL_CODE(FILE_DEVICE_BATTERY, 0x102, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x294408
22
23#define IOCTL_BATTERY_QUERY_PSR \
24 CTL_CODE(FILE_DEVICE_BATTERY, 0x103, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x29440C
25
26#define IOCTL_BATTERY_SET_TRIP_POINT \
27 CTL_CODE(FILE_DEVICE_BATTERY, 0x104, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x294410
28
29#define IOCTL_BATTERY_QUERY_BIF \
30 CTL_CODE(FILE_DEVICE_BATTERY, 0x105, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x294414
31
32#define IOCTL_BATTERY_QUERY_BST \
33 CTL_CODE(FILE_DEVICE_BATTERY, 0x106, METHOD_BUFFERED, FILE_READ_ACCESS) // 0x294418
34
35#define CMBATT_GENERIC_STATUS 0x01
36#define CMBATT_GENERIC_INFO 0x02
37#define CMBATT_GENERIC_WARNING 0x04
38#define CMBATT_ACPI_WARNING 0x08
39#define CMBATT_POWER_INFO 0x10
40#define CMBATT_PNP_INFO 0x20
41#define CMBATT_ACPI_ENTRY_EXIT 0x40
42#define CMBATT_PNP_ENTRY_EXIT 0x200
43#define CMBATT_ACPI_ASSERT 0x400
44
46{
50
51#define ACPI_BUS_CHECK 0x00
52#define ACPI_DEVICE_CHECK 0x01
53
54#define ACPI_STA_PRESENT 0x01
55#define ACPI_STA_ENABLED 0x02
56#define ACPI_STA_SHOW_UI 0x04
57#define ACPI_STA_FUNCTIONAL 0x08
58#define ACPI_STA_BATTERY_PRESENT 0x10
59
60#define ACPI_BATT_NOTIFY_STATUS 0x80
61#define ACPI_BATT_NOTIFY_INFO 0x81
62
63#define ACPI_BATT_STAT_DISCHARG 0x0001
64#define ACPI_BATT_STAT_CHARGING 0x0002
65#define ACPI_BATT_STAT_CRITICAL 0x0004
66
67#define CM_MAX_VALUE 0x7FFFFFFF
68#define CM_UNKNOWN_VALUE 0xFFFFFFFF
69
70typedef struct _ACPI_BST_DATA
71{
77
78#define ACPI_BATT_POWER_UNIT_WATTS 0x0
79#define ACPI_BATT_POWER_UNIT_AMPS 0x1
80
81typedef struct _ACPI_BIF_DATA
82{
97
98#define CMBATT_AR_NOTIFY 0x01
99#define CMBATT_AR_INSERT 0x02
100#define CMBATT_AR_REMOVE 0x04
101
103{
148
150NTAPI
153 PIRP Irp
154);
155
157NTAPI
160 PIRP Irp
161);
162
164NTAPI
168);
169
171NTAPI
174 PIRP Irp
175);
176
178NTAPI
180 PCMBATT_DEVICE_EXTENSION DeviceExtension,
181 PACPI_BST_DATA BstData
182);
183
185NTAPI
188 PULONG PsrData
189);
190
192NTAPI
195 PULONG StaData
196);
197
199NTAPI
201 PCMBATT_DEVICE_EXTENSION DeviceExtension,
202 PACPI_BIF_DATA BifData
203);
204
206NTAPI
208 PCMBATT_DEVICE_EXTENSION DeviceExtension,
209 ULONG AlarmValue
210);
211
212VOID
213NTAPI
215 IN PCMBATT_DEVICE_EXTENSION DeviceExtension,
216 IN ULONG NotifyValue
217);
218
220NTAPI
222 PCMBATT_DEVICE_EXTENSION DeviceExtension
223);
224
226NTAPI
228 PCMBATT_DEVICE_EXTENSION DeviceExtension
229);
230
232NTAPI
235 PULONG UniqueId
236);
237
239NTAPI
242 IN ULONG Tag,
248);
249
251NTAPI
253 IN PCMBATT_DEVICE_EXTENSION DeviceExtension,
254 IN ULONG Tag,
256);
257
259NTAPI
261 IN PCMBATT_DEVICE_EXTENSION DeviceExtension,
264);
265
267NTAPI
269 IN PCMBATT_DEVICE_EXTENSION DeviceExtension
270);
271
273NTAPI
275 IN PCMBATT_DEVICE_EXTENSION DeviceExtension,
277);
278
280extern ULONG CmBattDebug;
281
282#endif /* _CMBATT_PCH_ */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:188
_In_ ULONG _In_ PBATTERY_NOTIFY BatteryNotify
Definition: batclass.h:216
_Out_ PULONG BatteryTag
Definition: batclass.h:173
_In_ ULONG _Out_ PBATTERY_STATUS BatteryStatus
Definition: batclass.h:199
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG AtRate
Definition: batclass.h:185
enum _BATTERY_QUERY_INFORMATION_LEVEL BATTERY_QUERY_INFORMATION_LEVEL
Definition: bufpool.h:45
NTSTATUS NTAPI CmBattSetTripPpoint(PCMBATT_DEVICE_EXTENSION DeviceExtension, ULONG AlarmValue)
PDEVICE_OBJECT AcAdapterPdo
Definition: cmbatt.c:23
struct _ACPI_BST_DATA * PACPI_BST_DATA
NTSTATUS NTAPI CmBattGetStaData(PDEVICE_OBJECT DeviceObject, PULONG StaData)
NTSTATUS NTAPI CmBattGetPsrData(PDEVICE_OBJECT DeviceObject, PULONG PsrData)
struct _ACPI_BIF_DATA ACPI_BIF_DATA
NTSTATUS NTAPI CmBattGetUniqueId(PDEVICE_OBJECT DeviceObject, PULONG UniqueId)
NTSTATUS NTAPI CmBattPowerDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
ULONG CmBattDebug
Definition: cmbatt.c:17
struct _ACPI_BIF_DATA * PACPI_BIF_DATA
NTSTATUS NTAPI CmBattGetBifData(PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BIF_DATA BifData)
Definition: cmexec.c:325
NTSTATUS NTAPI CmBattGetBstData(PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BST_DATA BstData)
Definition: cmexec.c:334
struct _CMBATT_DEVICE_EXTENSION * PCMBATT_DEVICE_EXTENSION
NTSTATUS NTAPI CmBattDisableStatusNotify(IN PCMBATT_DEVICE_EXTENSION DeviceExtension)
Definition: cmbatt.c:595
NTSTATUS NTAPI CmBattQueryStatus(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG Tag, IN PBATTERY_STATUS BatteryStatus)
Definition: cmbatt.c:1214
NTSTATUS NTAPI CmBattPnpDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI CmBattQueryInformation(IN PCMBATT_DEVICE_EXTENSION FdoExtension, IN ULONG Tag, IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel, IN OPTIONAL LONG AtRate, IN PVOID Buffer, IN ULONG BufferLength, OUT PULONG ReturnedLength)
Definition: cmbatt.c:1001
struct _ACPI_BST_DATA ACPI_BST_DATA
VOID NTAPI CmBattNotifyHandler(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG NotifyValue)
Definition: cmbatt.c:142
NTSTATUS NTAPI CmBattAddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI CmBattSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI CmBattWmiRegistration(PCMBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CmBattQueryTag(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, OUT PULONG Tag)
Definition: cmbatt.c:536
NTSTATUS NTAPI CmBattWmiDeRegistration(PCMBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CmBattSetStatusNotify(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG BatteryTag, IN PBATTERY_NOTIFY BatteryNotify)
Definition: cmbatt.c:636
struct _CMBATT_DEVICE_EXTENSION CMBATT_DEVICE_EXTENSION
enum _CMBATT_EXTENSION_TYPE CMBATT_EXTENSION_TYPE
_CMBATT_EXTENSION_TYPE
Definition: cmbatt.h:46
@ CmBattAcAdapter
Definition: cmbatt.h:47
@ CmBattBattery
Definition: cmbatt.h:48
_In_ PIRP Irp
Definition: csq.h:116
@ FdoExtension
Definition: precomp.h:48
long LONG
Definition: pedump.c:60
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
CHAR BatteryType[256]
Definition: cmbatt.h:94
ULONG DesignCapacityLow
Definition: cmbatt.h:89
ULONG DesignVoltage
Definition: cmbatt.h:87
CHAR ModelNumber[256]
Definition: cmbatt.h:92
ULONG LastFullCapacity
Definition: cmbatt.h:85
ULONG DesignCapacity
Definition: cmbatt.h:84
CHAR SerialNumber[256]
Definition: cmbatt.h:93
ULONG BatteryTechnology
Definition: cmbatt.h:86
ULONG BatteryCapacityGranularity1
Definition: cmbatt.h:90
ULONG DesignCapacityWarning
Definition: cmbatt.h:88
ULONG BatteryCapacityGranularity2
Definition: cmbatt.h:91
CHAR OemInfo[256]
Definition: cmbatt.h:95
ULONG PowerUnit
Definition: cmbatt.h:83
ULONG PresentRate
Definition: cmbatt.h:73
ULONG RemainingCapacity
Definition: cmbatt.h:74
ULONG PresentVoltage
Definition: cmbatt.h:75
ULONG State
Definition: cmbatt.h:72
PUNICODE_STRING DeviceName
Definition: cmbatt.h:117
POWER_STATE PowerState
Definition: cmbatt.h:112
CMBATT_EXTENSION_TYPE FdoType
Definition: cmbatt.h:104
ULONGLONG InterruptTime
Definition: cmbatt.h:146
PDEVICE_OBJECT PdoDeviceObject
Definition: cmbatt.h:107
WMILIB_CONTEXT WmiLibInfo
Definition: cmbatt.h:113
PDEVICE_OBJECT FdoDeviceObject
Definition: cmbatt.h:106
ACPI_BST_DATA BstData
Definition: cmbatt.h:133
PDEVICE_OBJECT DeviceObject
Definition: cmbatt.h:105
BOOLEAN DelayNotification
Definition: cmbatt.h:119
PDEVICE_OBJECT AttachedDevice
Definition: cmbatt.h:108
IO_REMOVE_LOCK RemoveLock
Definition: cmbatt.h:115
FAST_MUTEX FastMutex
Definition: cmbatt.h:109
ULONG BatteryCapacityGranularity1
Definition: cmbatt.h:141
ULONG BatteryCapacityGranularity2
Definition: cmbatt.h:142
BATTERY_INFORMATION BatteryInformation
Definition: cmbatt.h:140
ACPI_INTERFACE_STANDARD AcpiInterface
Definition: cmbatt.h:118
ACPI_BIF_DATA BifData
Definition: cmbatt.h:134
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
FAST_MUTEX
Definition: extypes.h:17
char CHAR
Definition: xmlstorage.h:175