diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2000-12-24 19:12:10 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2000-12-24 19:12:10 +0000 |
commit | fed3d6603d9a67e06f9dc0862ce01639796041bf (patch) | |
tree | 74a6d218c1851b7235c485357b9e50c3ac2835ee /sys/dev/acpica/acpi_acad.c | |
parent | 8921eca1c09551a049f519d9591eca16ed610dcb (diff) | |
download | FreeBSD-src-fed3d6603d9a67e06f9dc0862ce01639796041bf.zip FreeBSD-src-fed3d6603d9a67e06f9dc0862ce01639796041bf.tar.gz |
Add ioctls to acpi_cmbat and acpi_acad. These use mike's acpi_register_ioctl().
Fix wrong AML method calling in acpi_cmbat.
Diffstat (limited to 'sys/dev/acpica/acpi_acad.c')
-rw-r--r-- | sys/dev/acpica/acpi_acad.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_acad.c b/sys/dev/acpica/acpi_acad.c index 12d254e..4c61225 100644 --- a/sys/dev/acpica/acpi_acad.c +++ b/sys/dev/acpica/acpi_acad.c @@ -51,6 +51,7 @@ static void acpi_acad_get_status(void * ); static void acpi_acad_notify_handler(ACPI_HANDLE , UINT32 ,void *); static int acpi_acad_probe(device_t); static int acpi_acad_attach(device_t); +static int acpi_acad_ioctl(u_long, caddr_t, void *); struct acpi_acad_softc { int status; @@ -106,6 +107,7 @@ acpi_acad_probe(device_t dev) static int acpi_acad_attach(device_t dev) { + int error; ACPI_HANDLE handle = acpi_get_handle(dev); AcpiInstallNotifyHandler(handle, @@ -117,6 +119,12 @@ acpi_acad_attach(device_t dev) acpi_acad_notify_handler, dev); acpi_acad_get_status((void *)dev); + + error = acpi_register_ioctl(ACPIIO_ACAD_GET_STATUS, acpi_acad_ioctl, + device_get_softc(dev)); + if (error) + return (error); + return(0); } @@ -136,3 +144,22 @@ static driver_t acpi_acad_driver = { static devclass_t acpi_acad_devclass; DRIVER_MODULE(acpi_acad,acpi,acpi_acad_driver,acpi_acad_devclass,0,0); + +static int +acpi_acad_ioctl(u_long cmd, caddr_t addr, void *arg) +{ + struct acpi_acad_softc *sc; + + sc = (struct acpi_acad_softc *)arg; + if (sc == NULL) { + return(ENXIO); + } + + switch (cmd) { + case ACPIIO_ACAD_GET_STATUS: + *(int *)addr = sc->status; + break; + } + + return(0); +} |