summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-12-14 03:35:05 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-12-14 03:35:05 +0000
commit5af393e8e1dbadb833c6f815fe70d2f6921a535d (patch)
treefd9a14c0bde1a93a10e6559f1b1df46638262e0b /sys
parentcd8c4f9c3bc3a2907194bb6c3dd7d8227f3bf072 (diff)
Add the last bits and cleanup advice from dlg.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpibat.h139
1 files changed, 76 insertions, 63 deletions
diff --git a/sys/dev/acpi/acpibat.h b/sys/dev/acpi/acpibat.h
index f11f9374aad..526cea3d839 100644
--- a/sys/dev/acpi/acpibat.h
+++ b/sys/dev/acpi/acpibat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibat.h,v 1.1 2005/12/13 23:19:15 marco Exp $ */
+/* $OpenBSD: acpibat.h,v 1.2 2005/12/14 03:35:04 marco Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -18,26 +18,27 @@
#ifndef __DEV_ACPI_ACPIBAT_H__
#define __DEV_ACPI_ACPIBAT_H__
-#if 0
-Arguments: none
-Results : package _BIF (Battery InFormation)
-Package {
- // ASCIIZ is ASCII character string terminated with a 0x00.
- Power Unit //DWORD
- Design Capacity //DWORD
- Last Full Charge Capacity //DWORD
- Battery Technology //DWORD
- Design Voltage //DWORD
- Design Capacity of Warning //DWORD
- Design Capacity of Low //DWORD
- Battery Capacity Granularity 1 //DWORD
- Battery Capacity Granularity 2 //DWORD
- Model Number //ASCIIZ
- Serial Number //ASCIIZ
- Battery Type //ASCIIZ
- OEM Information //ASCIIZ
-}
-#endif
+/*
+ * _BIF (Battery InFormation)
+ * Arguments: none
+ * Results : package _BIF (Battery InFormation)
+ * Package {
+ * // ASCIIZ is ASCII character string terminated with a 0x00.
+ * Power Unit //DWORD
+ * Design Capacity //DWORD
+ * Last Full Charge Capacity //DWORD
+ * Battery Technology //DWORD
+ * Design Voltage //DWORD
+ * Design Capacity of Warning //DWORD
+ * Design Capacity of Low //DWORD
+ * Battery Capacity Granularity 1 //DWORD
+ * Battery Capacity Granularity 2 //DWORD
+ * Model Number //ASCIIZ
+ * Serial Number //ASCIIZ
+ * Battery Type //ASCIIZ
+ * OEM Information //ASCIIZ
+ * }
+ */
struct acpibat_bif {
u_int32_t bif_power_unit;
#define BIF_POWER_MW 0x00
@@ -56,32 +57,33 @@ struct acpibat_bif {
char bif_data[]; /* 4 strings */
};
-#if 0
-Arguments: none
-Results : DWORD _OSC Definition for Control Method Battery
-#endif
+/*
+ * _OSC Definition for Control Method Battery
+ * Arguments: none
+ * Results : DWORD flags
+ */
#define CMB_OSC_UUID "f18fc78b-0f15-4978-b793-53f833a1d35b"
#define CMB_OSC_GRANULARITY 0x01
#define CMB_OSC_WAKE_ON_LOW 0x02
-#if 0
-Arguments: none
-Results : package _BST (Battery STatus)
-Package {
- Battery State //DWORD
- Battery Present Rate //DWORD
- Battery Remaining Capacity //DWORD
- Battery Present Voltage //DWORD
-}
-
-Per the spec section 10.2.2.3
-Remaining Battery Percentage[%] = (Battery Remaining Capacity [=0 ~ 100] /
- Last Full Charged Capacity[=100]) * 100
-
-Remaining Battery Life [h] = Battery Remaining Capacity [mAh/mWh] /
- Battery Present Rate [=0xFFFFFFFF] = unknown
-
-#endif
+/*
+ * _BST (Battery STatus)
+ * Arguments: none
+ * Results : package _BST (Battery STatus)
+ * Package {
+ * Battery State //DWORD
+ * Battery Present Rate //DWORD
+ * Battery Remaining Capacity //DWORD
+ * Battery Present Voltage //DWORD
+ * }
+ *
+ * Per the spec section 10.2.2.3
+ * Remaining Battery Percentage[%] = (Battery Remaining Capacity [=0 ~ 100] /
+ * Last Full Charged Capacity[=100]) * 100
+ *
+ * Remaining Battery Life [h] = Battery Remaining Capacity [mAh/mWh] /
+ * Battery Present Rate [=0xFFFFFFFF] = unknown
+ */
struct acpibat_bst {
u_int32_t bst_state;
#define BST_DISCHARGE 0x01
@@ -93,34 +95,36 @@ struct acpibat_bst {
u_int32_t bst_voltage;
};
-#if 0
-Arguments: DWORD _BTP (Battery Trip Point) level
-Results : none
-#endif
+/*
+ * _BTP (Battery Trip Point)
+ * Arguments: DWORD level
+ * Results : none
+ */
#define BTP_CLEAR_TRIP_POINT 0x00
-#if 0
-_BTM (Battery TiMe)
-Arguments: DWORD rate of discharge
-Results : DWORD time in seconds or error/unknown
-#endif
+/*
+ * _BTM (Battery TiMe)
+ * Arguments: DWORD rate of discharge
+ * Results : DWORD time in seconds or error/unknown
+ */
#define BTM_CURRENT_RATE 0x00
#define BTM_RATE_TOO_LARGE 0x00
#define BTM_CRITICAL 0x00
#define BTM_UNKNOWN 0xffffffff
-#if 0
-Arguments: none
-Results : package _BMD (Battery Maintenance Data)
-Package {
- Status Flags //DWORD
- Capability Flags //DWORD
- Recalibrate Count //DWORD
- Quick Recalibrate Time //DWORD
- Slow Recalibrate Time //DWORD
-}
-#endif
+/*
+ * _BMD (Battery Maintenance Data)
+ * Arguments: none
+ * Results : package _BMD (Battery Maintenance Data)
+ * Package {
+ * Status Flags //DWORD
+ * Capability Flags //DWORD
+ * Recalibrate Count //DWORD
+ * Quick Recalibrate Time //DWORD
+ * Slow Recalibrate Time //DWORD
+ * }
+ */
struct acpibat_bmd {
u_int32_t bmd_status;
#define BMD_AML_CALIBRATE_CYCLE 0x01
@@ -141,4 +145,13 @@ struct acpibat_bmd {
u_int32_t bmd_slow_recalibrate_time;
};
+/*
+ * _BMC (Battery Maintenance Control)
+ * Arguments: DWORD flags
+ * Results : none
+ */
+#define BMC_AML_CALIBRATE 0x01
+#define BMC_DISABLE_CHARGING 0x02
+#define BMC_ALLOW_AC_DISCHARGE 0x04
+
#endif /* __DEV_ACPI_ACPIBAT_H__ */