1
0
Fork 0

BoardConfig.mk: set BOARD_WLAN_DEVICE := bcmdhd for generic nl80211 HAL

Without BOARD_WLAN_DEVICE, libwifi-hal's fallback returns
WIFI_ERROR_NOT_SUPPORTED from init_wifi_vendor_hal_func_table, which
causes the AIDL wifi HAL (com.android.hardware.wifi) to fail at startup:

  E android.hardware.wifi-service: Can not initialize the vendor
    function pointer table
  E android.hardware.wifi-service: Wifi HAL start failed

The bcmdhd implementation of init_wifi_vendor_hal_func_table uses
purely generic nl80211 — it scans /sys/class/net/ for phy80211
interfaces, creates netlink sockets, and resolves the nl80211 family
ID via genl_ctrl_resolve().  There are no bcmdhd-specific IOCTLs or
vendor commands in the core startup path (wifi_initialize, wifi_cleanup,
wifi_event_loop, wifi_get_ifaces, wifi_get_iface_name); the vendor
commands are only used for optional advanced features (RTT, NAN, etc.)
that this device does not use.
This commit is contained in:
Brendan Szymanski 2026-07-14 16:18:05 -04:00
parent 66b45a54a7
commit 9ca54ed439

View file

@ -90,10 +90,18 @@ TARGET_COPY_OUT_VENDOR := vendor
# Wifi
# Generic nl80211/cfg80211 only: WiFi comes from USB adapters (mt76, rtw88,
# ath9k_htc, ...). No BOARD_WLAN_DEVICE / private driver-command lib — those
# inject vendor-private commands (bcmdhd's were used previously) that generic
# mac80211 drivers reject.
# BOARD_WLAN_DEVICE := bcmdhd selects the Broadcom wifi HAL implementation.
# Despite its name, bcmdhd's init_wifi_vendor_hal_func_table uses purely
# generic nl80211 — it scans /sys/class/net/ for phy80211 interfaces, creates
# netlink sockets, and resolves the nl80211 family ID. The functions are
# Broadcom-generic, not bcmdhd-specific; any nl80211-compatible adapter
# (mt7921u, rtw88, ath9k_htc, etc.) works fine.
#
# Without BOARD_WLAN_DEVICE, libwifi-hal's fallback returns
# WIFI_ERROR_NOT_SUPPORTED from init_wifi_vendor_hal_func_table, causing the
# AIDL wifi HAL (com.android.hardware.wifi) to fail at startup with "Can not
# initialize the vendor function pointer table".
BOARD_WLAN_DEVICE := bcmdhd
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
#WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true