summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpiio.h
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2001-06-23 10:38:25 +0000
committeriwasaki <iwasaki@FreeBSD.org>2001-06-23 10:38:25 +0000
commit0a170022469cb414eaf2fe65a3f07b5b0874d123 (patch)
tree2700c24fbec6ebb29d833bcb6825a2497ca61eb9 /sys/dev/acpica/acpiio.h
parentb3aa602e23ece34e47cebfa021714069fe78231a (diff)
downloadFreeBSD-src-0a170022469cb414eaf2fe65a3f07b5b0874d123.zip
FreeBSD-src-0a170022469cb414eaf2fe65a3f07b5b0874d123.tar.gz
Add sysctl interface (Read-only) for temprature, AC-line and Battery.
Patches for acpi_cmbat.c submitted by Munehiro Matsuda.
Diffstat (limited to 'sys/dev/acpica/acpiio.h')
-rw-r--r--sys/dev/acpica/acpiio.h44
1 files changed, 37 insertions, 7 deletions
diff --git a/sys/dev/acpica/acpiio.h b/sys/dev/acpica/acpiio.h
index d98ffed..48439f3 100644
--- a/sys/dev/acpica/acpiio.h
+++ b/sys/dev/acpica/acpiio.h
@@ -34,6 +34,20 @@
#define ACPIIO_DISABLE _IO('P', 2)
#define ACPIIO_SETSLPSTATE _IOW('P', 3, int)
+struct acpi_battdesc {
+ int type; /* battery type: e.g. CMBAT */
+ int phys_unit; /* physical unit of devclass */
+};
+
+#define ACPI_BATT_TYPE_CMBAT 0x0000
+#define ACPI_BATT_TYPE_SMBAT 0x0001
+
+struct acpi_battinfo {
+ int cap; /* percent */
+ int min; /* remianing time */
+ int state; /* battery state */
+};
+
#define ACPI_CMBAT_MAXSTRLEN 32
struct acpi_bif {
u_int32_t unit; /* 0 for mWh, 1 for mAh */
@@ -58,15 +72,31 @@ struct acpi_bst {
u_int32_t volt; /* Present Voltage */
};
-union acpi_cmbat_ioctl_arg {
- int unit;
- struct acpi_bif bif;
- struct acpi_bst bst;
+#define ACPI_BATT_STAT_DISCHARG 0x0001
+#define ACPI_BATT_STAT_CHARGING 0x0002
+#define ACPI_BATT_STAT_CRITICAL 0x0004
+#define ACPI_BATT_STAT_NOT_PRESENT 0x0007
+#define ACPI_BATT_STAT_MAX 0x0007
+
+union acpi_battery_ioctl_arg {
+ int unit; /* argument: logical unit (-1 = overall) */
+
+ struct acpi_battdesc battdesc;
+ struct acpi_battinfo battinfo;
+
+ struct acpi_bif bif; /* for acpi_cmbat */
+ struct acpi_bst bst; /* for acpi_cmbat */
};
-#define ACPIIO_CMBAT_GET_UNITS _IOR('B', 1, int)
-#define ACPIIO_CMBAT_GET_BIF _IOWR('B', 2, union acpi_cmbat_ioctl_arg)
-#define ACPIIO_CMBAT_GET_BST _IOWR('B', 3, union acpi_cmbat_ioctl_arg)
+/* Common battery ioctl */
+#define ACPIIO_BATT_GET_UNITS _IOR('B', 0x01, int)
+#define ACPIIO_BATT_GET_TYPE _IOR('B', 0x02, union acpi_battery_ioctl_arg)
+#define ACPIIO_BATT_GET_BATTINFO _IOWR('B', 0x03, union acpi_battery_ioctl_arg)
+#define ACPIIO_BATT_GET_BATTDESC _IOWR('B', 0x04, union acpi_battery_ioctl_arg)
+
+/* Cotrol Method battery ioctl */
+#define ACPIIO_CMBAT_GET_BIF _IOWR('B', 0x10, union acpi_battery_ioctl_arg)
+#define ACPIIO_CMBAT_GET_BST _IOWR('B', 0x11, union acpi_battery_ioctl_arg)
#define ACPIIO_ACAD_GET_STATUS _IOR('A', 1, int)
OpenPOWER on IntegriCloud