ACPI_HP(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’» acpi_hp β€” the ACPI extras driver for HP laptops πŸ’–

okay so real talk, this one's from the Kernel Interfaces Manual (ACPI_HP(4)), and it's basically the little driver that lets your HP laptop spill its BIOS tea to userspace. let's get into it 🫢


✨ NAME ✨

acpi_hp β€” the ACPI extras driver for HP laptops. that's it, that's the vibe πŸ’…


🌸 SYNOPSIS 🌸

to compile this driver into the kernel (main character energy, no modules), drop this line into your kernel configuration file:

device acpi_hp

or, if you'd rather load it as a module at boot time (lowkey easier ngl), put this line in loader.conf(5):

acpi_hp_load="YES"

πŸ¦‹ DESCRIPTION πŸ¦‹

so the acpi_hp driver gives you support for all the ACPI-controlled features hanging out on HP laptops that use a WMI enabled BIOS β€” think HP Compaq 8510p and 6510p, those girlies.

the whole point of this driver is to hand you an interface β€” reachable via sysctl(8), devd(8) and devfs(8) β€” so your applications can find out and change the status of all kinds of laptop components and BIOS settings. iconic, honestly.

πŸŽ€ devd(8) Events πŸŽ€

the devd events that devd(8) receives carry this info:

system     "ACPI"
subsystem  "HP"
type       The source of the event in the ACPI namespace.  The
           value depends on the model.
notify     Event code (see below).

and here are the event codes, no cap:

  • 0xc0 β€” WLAN on air status changed to 0 (not on air)
  • 0xc1 β€” WLAN on air status changed to 1 (on air)
  • 0xd0 β€” Bluetooth on air status changed to 0 (not on air)
  • 0xd1 β€” Bluetooth on air status changed to 1 (on air)
  • 0xe0 β€” WWAN on air status changed to 0 (not on air)
  • 0xe1 β€” WWAN on air status changed to 1 (on air)

🐚 devfs(8) Device 🐚

you can literally just read /dev/hpcmi to see your current BIOS settings πŸ‘€ the detail level is adjustable by setting the sysctl cmi_detail, as described down below.


✨ SYSCTL VARIABLES ✨

these are the sysctls currently implemented, bestie:

πŸ“Ά WLAN:

  • dev.acpi_hp.0.wlan_enabled β€” toggle WLAN chip activity.
  • dev.acpi_hp.0.wlan_radio β€” (read-only) WLAN radio status (controlled by the hardware switch).
  • dev.acpi_hp.0.wlan_on_air β€” (read-only) WLAN on air (chip enabled, hardware switch enabled + enabled in BIOS).
  • dev.acpi_hp.0.wlan_enabled_if_radio_on β€” if set to 1, the WLAN chip will be enabled if the radio is turned on.
  • dev.acpi_hp.0.wlan_disable_if_radio_off β€” if set to 1, the WLAN chip will be disabled if the radio is turned off.

πŸ’™ Bluetooth:

  • dev.acpi_hp.0.bt_enabled β€” toggle Bluetooth chip activity.
  • dev.acpi_hp.0.bt_radio β€” (read-only) Bluetooth radio status (controlled by the hardware switch).
  • dev.acpi_hp.0.bt_on_air β€” (read-only) Bluetooth on air (chip enabled, hardware switch enabled + enabled in BIOS).
  • dev.acpi_hp.0.bt_enabled_if_radio_on β€” if set to 1, the Bluetooth chip will be enabled if the radio is turned on.
  • dev.acpi_hp.0.bt_disable_if_radio_off β€” if set to 1, the Bluetooth chip will be disabled if the radio is turned off.

🌈 WWAN:

  • dev.acpi_hp.0.wwan_enabled β€” toggle WWAN chip activity.
  • dev.acpi_hp.0.wwan_radio β€” (read-only) WWAN radio status (controlled by the hardware switch).
  • dev.acpi_hp.0.wwan_on_air β€” (read-only) WWAN on air (chip enabled, hardware switch enabled + enabled in BIOS).
  • dev.acpi_hp.0.wwan_enabled_if_radio_on β€” if set to 1, the WWAN chip will be enabled if the radio is turned on.
  • dev.acpi_hp.0.wwan_disable_if_radio_off β€” if set to 1, the WWAN chip will be disabled if the radio is turned off.

πŸ“ Misc:

  • dev.acpi_hp.0.als_enabled β€” toggle the ambient light sensor (ALS).
  • dev.acpi_hp.0.display β€” (read-only) display status (bitmask).
  • dev.acpi_hp.0.hdd_temperature β€” (read-only) HDD temperature.
  • dev.acpi_hp.0.is_docked β€” (read-only) docking station status (1 if docked).
  • dev.acpi_hp.0.cmi_detail β€” bitmask controlling the detail level in /dev/hpcmi output (the values can be ORed, slay):
    • 0x01 β€” show path component of BIOS setting
    • 0x02 β€” show a list of valid options for the BIOS setting
    • 0x04 β€” show additional flags of BIOS setting (ReadOnly etc.)
    • 0x08 β€” query highest BIOS entry instance. this one is broken on many HP models and is therefore disabled by default πŸ’€
  • dev.acpi_hp.0.verbose β€” (read-only) set verbosity level.
defaults for these sysctls can be set in sysctl.conf(5) πŸŽ€

πŸ”₯ HARDWARE πŸ”₯

the acpi_hp driver has been reported to support the following hardware:

  • HP Compaq 8510p
  • HP Compaq nx7300

it should work on most HP laptops that feature a WMI enabled BIOS. fingers crossed fr fr 🀞


πŸ’œ FILES πŸ’œ

  • /dev/hpcmi β€” interface to read BIOS settings.

⭐ EXAMPLES ⭐

turning off LAN when WLAN is on air

you can add the following to devd.conf(5) in order disable the LAN interface when WLAN on air and reenable it if it is not:

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "HP";
        match "notify"          "0xc0";
        action                  "ifconfig em0 up";
};

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "HP";
        match "notify"          "0xc1";
        action                  "ifconfig em0 down";
};

enabling the ambient light sensor

sysctl dev.acpi_hp.0.als_enabled=1

enabling Bluetooth

sysctl dev.acpi_hp.0.bt_enabled=1

getting BIOS settings

cat /dev/hpcmi

and it's giving:

Serial Port                                Disable
Infrared Port                              Enable
Parallel Port                              Disable
Flash Media Reader                         Disable
USB Ports including Express Card slot      Enable
1394 Port                                  Enable
Cardbus Slot                               Disable
Express Card Slot                          Disable
(...)

maxing out the detail level for /dev/hpcmi output

sysctl dev.acpi_hp.0.cmi_detail=7

πŸ‘‘ SEE ALSO πŸ‘‘

acpi(4), acpi_wmi(4), sysctl.conf(5), devd(8), devfs(8), sysctl(8)


🧚 HISTORY 🧚

the acpi_hp device driver first appeared in FreeBSD 8.0. a whole era πŸ’«


πŸŽ€ AUTHORS πŸŽ€

the acpi_hp driver was written by Michael Gmelin <freebsd@grem.de>.

it has been inspired by the hp-wmi driver, which implements a subset of these features (hotkeys) on Linux. cute crossover moment 🐧✨

this manual page was written by Michael Gmelin <freebsd@grem.de>.


πŸ’€ BUGS πŸ’€

this driver is experimental and has only been tested on i386 on an HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN). expect undefined results when operating on different hardware. not me being the guinea pig 😭
  • loading the driver is slow. reading from /dev/hpcmi is even slower. ngl, bring a snack πŸ“
  • additional features like HP specific sensor readings or writing BIOS settings are not supported. sorry bestie, that's a no πŸ™ˆ

that's the whole page! brought to you by the Debian edition, dated June 19, 2015 β€” yeah she's an older icon but she still ate πŸ’…πŸ«Άβœ¨

πŸ“¦ where this page comes from