cvs commit: src/sys/dev/acpica acpi_battery.c acpiio.h
njl at FreeBSD.org
Sat Oct 22 17:16:42 PDT 2005
njl 2005-10-23 00:16:41 UTC
FreeBSD src repository
sys/dev/acpica acpi_battery.c acpiio.h
Cleanups and support code for importing smart battery support.
* Use ACPI_BATT_UNKNOWN instead of constants
* Use maxunit instead of a count of devices since we may have sparse
battery devices in the future. Only userland should be using unit
numbers anyway, so provide a translation function. (Kernel use of
batteries should be restricted to looking up a device_t and calling
* Don't check acpi_BatteryIsPresent() in acpi_battery. Leave it up to
the hardware-specific driver (i.e. cmbat) since smart batteries seem
to not report the "battery present" flag.
* Convert mA to mW if the battery uses those units. CM-batteries only
used mW so this deficiency went unnoticed.
* Clean strings reported in the battery info from any control chars.
* Only dereference the unit from ioctl_arg if the full struct is present.
Unit wouldn't have been used later if it wasn't present but this is
cleaner. Translate the unit if it's not ACPI_BATTERY_ALL_UNITS.
* bzero structs before returning them to usermode for future compat.
Most of this work was submitted by Hans Petter Selasky and then majorly
reworked by myself.
Submitted by: Hans Petter Selasky <hselasky / c2i.net>
Revision Changes Path
1.20 +120 -29 src/sys/dev/acpica/acpi_battery.c
1.16 +4 -1 src/sys/dev/acpica/acpiio.h
More information about the cvs-src