svn will drive me nuts, part 1/x
[reactos.git] / drivers / bus / acpi / compbatt / compbatt.h
1 /*
2 * PROJECT: ReactOS Composite Battery Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/drivers/bus/acpi/compbatt/compbatt.h
5 * PURPOSE: Main Header File
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 #include <ntddk.h>
10 #include <initguid.h>
11 #include <batclass.h>
12 #include <debug.h>
13
14 typedef struct _COMPBATT_BATTERY_ENTRY
15 {
16 LIST_ENTRY BatteryLink;
17 IO_REMOVE_LOCK RemoveLock;
18 PDEVICE_OBJECT DeviceObject;
19 PIRP Irp;
20 WORK_QUEUE_ITEM WorkItem;
21 BOOLEAN WaitFlag;
22 BATTERY_WAIT_STATUS WaitStatus;
23 union
24 {
25 BATTERY_WAIT_STATUS WorkerWaitStatus;
26 BATTERY_STATUS WorkerStatus;
27 };
28 ULONG Tag;
29 ULONG Flags;
30 BATTERY_INFORMATION BatteryInformation;
31 BATTERY_STATUS BatteryStatus;
32 ULONGLONG InterruptTime;
33 UNICODE_STRING BatteryName;
34 } COMPBATT_BATTERY_ENTRY, *PCOMPBATT_BATTERY_ENTRY;
35
36 typedef struct _COMPBATT_DEVICE_EXTENSION
37 {
38 PVOID ClassData;
39 ULONG NextTag;
40 LIST_ENTRY BatteryList;
41 FAST_MUTEX Lock;
42 ULONG Tag;
43 ULONG Flags;
44 BATTERY_INFORMATION BatteryInformation;
45 BATTERY_STATUS BatteryStatus;
46 ULONGLONG InterruptTime;
47 POWER_STATE PowerState;
48 ULONG LowCapacity;
49 ULONG HighCapacity;
50 PDEVICE_OBJECT AttachedDevice;
51 PDEVICE_OBJECT DeviceObject;
52 PVOID NotificationEntry;
53 } COMPBATT_DEVICE_EXTENSION, *PCOMPBATT_DEVICE_EXTENSION;
54
55 NTSTATUS
56 NTAPI
57 CompBattAddDevice(
58 IN PDRIVER_OBJECT DriverObject,
59 IN PDEVICE_OBJECT PdoDeviceObject
60 );
61
62 NTSTATUS
63 NTAPI
64 CompBattPowerDispatch(
65 IN PDEVICE_OBJECT DeviceObject,
66 IN PIRP Irp
67 );
68
69 NTSTATUS
70 NTAPI
71 CompBattPnpDispatch(
72 IN PDEVICE_OBJECT DeviceObject,
73 IN PIRP Irp
74 );
75
76 NTSTATUS
77 NTAPI
78 CompBattQueryInformation(
79 IN PCOMPBATT_DEVICE_EXTENSION FdoExtension,
80 IN ULONG Tag,
81 IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel,
82 IN OPTIONAL LONG AtRate,
83 IN PVOID Buffer,
84 IN ULONG BufferLength,
85 OUT PULONG ReturnedLength
86 );
87
88 NTSTATUS
89 NTAPI
90 CompBattQueryStatus(
91 IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
92 IN ULONG Tag,
93 IN PBATTERY_STATUS BatteryStatus
94 );
95
96 NTSTATUS
97 NTAPI
98 CompBattSetStatusNotify(
99 IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
100 IN ULONG BatteryTag,
101 IN PBATTERY_NOTIFY BatteryNotify
102 );
103
104 NTSTATUS
105 NTAPI
106 CompBattDisableStatusNotify(
107 IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension
108 );
109
110 NTSTATUS
111 NTAPI
112 CompBattQueryTag(
113 IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension,
114 OUT PULONG Tag
115 );
116
117 extern ULONG CompBattDebug;
118
119 /* EOF */