summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpiio.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/acpica/acpiio.h')
-rw-r--r--sys/dev/acpica/acpiio.h69
1 files changed, 35 insertions, 34 deletions
diff --git a/sys/dev/acpica/acpiio.h b/sys/dev/acpica/acpiio.h
index 0662a38..a34002d 100644
--- a/sys/dev/acpica/acpiio.h
+++ b/sys/dev/acpica/acpiio.h
@@ -35,41 +35,41 @@
#define ACPIIO_SETSLPSTATE _IOW('P', 3, int)
struct acpi_battdesc {
- int type; /* battery type: e.g. CMBAT */
- int phys_unit; /* physical unit of devclass */
+ 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 */
+ 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 */
- u_int32_t dcap; /* Design Capacity */
- u_int32_t lfcap; /* Last Full capacity */
- u_int32_t btech; /* Battery Technorogy */
- u_int32_t dvol; /* Design voltage (mV) */
- u_int32_t wcap; /* WARN capacity */
- u_int32_t lcap; /* Low capacity */
- u_int32_t gra1; /* Granulity 1(Warn to Low) */
- u_int32_t gra2; /* Granulity 2(Full to Warn) */
- char model[ACPI_CMBAT_MAXSTRLEN]; /* model identifier */
- char serial[ACPI_CMBAT_MAXSTRLEN]; /* Serial number */
- char type[ACPI_CMBAT_MAXSTRLEN]; /* Type */
- char oeminfo[ACPI_CMBAT_MAXSTRLEN]; /* OEM infomation */
+ u_int32_t unit; /* 0 for mWh, 1 for mAh */
+ u_int32_t dcap; /* Design Capacity */
+ u_int32_t lfcap; /* Last Full capacity */
+ u_int32_t btech; /* Battery Technorogy */
+ u_int32_t dvol; /* Design voltage (mV) */
+ u_int32_t wcap; /* WARN capacity */
+ u_int32_t lcap; /* Low capacity */
+ u_int32_t gra1; /* Granulity 1(Warn to Low) */
+ u_int32_t gra2; /* Granulity 2(Full to Warn) */
+ char model[ACPI_CMBAT_MAXSTRLEN]; /* model identifier */
+ char serial[ACPI_CMBAT_MAXSTRLEN]; /* Serial number */
+ char type[ACPI_CMBAT_MAXSTRLEN]; /* Type */
+ char oeminfo[ACPI_CMBAT_MAXSTRLEN]; /* OEM infomation */
};
struct acpi_bst {
- u_int32_t state; /* Battery State */
- u_int32_t rate; /* Present Rate */
- u_int32_t cap; /* Remaining Capacity */
- u_int32_t volt; /* Present Voltage */
+ u_int32_t state; /* Battery State */
+ u_int32_t rate; /* Present Rate */
+ u_int32_t cap; /* Remaining Capacity */
+ u_int32_t volt; /* Present Voltage */
};
#define ACPI_BATT_STAT_DISCHARG 0x0001
@@ -79,28 +79,29 @@ struct acpi_bst {
#define ACPI_BATT_STAT_MAX 0x0007
union acpi_battery_ioctl_arg {
- int unit; /* argument: logical unit (-1 = overall) */
+ int unit; /* argument: logical unit (-1 = overall) */
- struct acpi_battdesc battdesc;
- struct acpi_battinfo battinfo;
+ struct acpi_battdesc battdesc;
+ struct acpi_battinfo battinfo;
- struct acpi_bif bif; /* for acpi_cmbat */
- struct acpi_bst bst; /* for acpi_cmbat */
+ struct acpi_bif bif; /* for acpi_cmbat */
+ struct acpi_bst bst; /* for acpi_cmbat */
};
/* 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_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_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)
+#define ACPIIO_ACAD_GET_STATUS _IOR('A', 1, int)
#ifdef _KERNEL
-extern int acpi_register_ioctl(u_long cmd, int (* fn)(u_long cmd, caddr_t addr, void *arg), void *arg);
-extern void acpi_deregister_ioctl(u_long cmd, int (* fn)(u_long cmd, caddr_t addr, void *arg));
+typedef int (*acpi_ioctl_fn)(u_long cmd, caddr_t addr, void *arg);
+extern int acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg);
+extern void acpi_deregister_ioctl(u_long cmd, acpi_ioctl_fn fn);
#endif
OpenPOWER on IntegriCloud