Page MenuHomeFreeBSD

Add _BIX (Battery Information Extended) object support to acpi_cmbat
ClosedPublic

Authored by hrs on Feb 17 2020, 5:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 10:23 AM
Unknown Object (File)
Sun, Apr 7, 1:11 AM
Unknown Object (File)
Sun, Mar 31, 3:18 AM
Unknown Object (File)
Jan 13 2024, 3:22 AM
Unknown Object (File)
Jan 11 2024, 1:24 AM
Unknown Object (File)
Jan 10 2024, 6:36 PM
Unknown Object (File)
Dec 23 2023, 12:30 AM
Unknown Object (File)
Dec 7 2023, 12:04 AM
Subscribers

Details

Summary

Add _BIX (Battery Information Extended) object support.

ACPI Control Method Batteries have a _BIF and/or _BIX object which
provides static properties of the battery. FreeBSD acpi_cmbat module
supports _BIF object only, which was deprecated as of ACPI 4.0. _BIX
is an extended version of _BIF defined in ACPI 4.0 or later.

As of writing, _BIX has two revisions. One is in ACPI 4.0 (rev.0) and
another is in ACPI 6.0 (rev.1). It seems that hardware vendors still
stick to _BIF only or _BIX rev.0 + _BIF for the maximum compatibility.
Microsoft mandates _BIX rev.0 for Windows machines, so there are some
laptop machines with _BIX rev.0 only. In this case, FreeBSD does not
recognize the battery information.

After this change, acpi_cmbat module gets battery information from
_BIX or _BIF object and internally uses _BIX rev.1 data structure as
the primary information store in the kernel. ACPIIO_BATT_GET_BI[FX]
will return an acpi_bi[fx] structure built by using information
obtained from a _BIF or a _BIX object found on the system. The
revision number field can be used to check which field is available.
The acpiconf(8) utility will show additional information if _BIX is
available.

Although ABIs of ACPIIO_BATT_* were changed, the existing APIs for
userland utilities are not changed and the backward-compatible ABIs
are provided. This means that older versions of acpiconf(8) can also
work with the new kernel. The (union acpi_battery_ioctl_arg) was
padded to 256 byte long to avoid another ABI change in the future. A
_BIX object with its revision number >1 will be treated as compatible
with the rev.1 _BIX format.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29447
Build 27324: arc lint + arc unit

Event Timeline

Remove device_printf()s just for debugging.

Almost all comments I had been made prior to this submit in other channel.
A few comment is inline.

share/man/man4/acpi_battery.4
50

ACPI smbus driver does not use smbus(4) framework, but dedicated to acpi_smbat dedicated.

This revision now requires changes to proceed.Feb 18 2020, 3:44 AM

Remove irrelevant references to smbus(4).

hrs marked an inline comment as done.Feb 18 2020, 3:57 AM
This revision is now accepted and ready to land.Feb 18 2020, 4:27 AM