Wi-Fi HAL

The Wi-Fi framework has three Wi-Fi HAL surfaces represented by three different interfaces. All three interfaces have a HIDL definition, and two of the interfaces are available as stable AIDL packages.

  • Vendor HAL: A HAL surface for Android-specific commands. The HIDL files are in hardware/interfaces/wifi/1.x.
  • Supplicant HAL: A HAL surface for wpa_supplicant. The HIDL files are in hardware/interfaces/supplicant/1.x and the AIDL files are in hardware/interfaces/supplicant/aidl.
  • Hostapd HAL: A HAL surface for hostapd. The HIDL files are in hardware/interfaces/hostapd/1.x and the AIDL files are in hardware/interfaces/hostapd/aidl.

Vendor HAL

The Vendor HAL provides Android-specific commands. It is optional (not required) for infrastructure Station (STA) and Soft AP (SAP) modes to function. However, it is mandatory for Wi-Fi Aware and for Wi-Fi RTT services.

Pre-HIDL (i.e. pre-Android 8.0) Android used a HAL mechanism now called legacy HAL. The Android source code currently provides a default implementation of HIDL using a shim running on top of the legacy HAL.

The legacy HAL headers are located in hardware/libhardware_legacy/include/hardware_legacy/. The legacy HAL based implementation is located in hardware/interfaces/wifi/1.x/default.

Supplicant HAL

The Supplicant HAL provides an interface for the wpa_supplicant daemon. Starting with Android 13, the interface uses AIDL for the HAL definition. For releases before Android 13, interfaces and vendor partitions use HIDL.

The wpa_supplicant source code is located in external/wpa_supplicant_8/wpa_supplicant. The reference implementation provides an AIDL interface, which is implemented in the aidl sub-directory.

Hostapd HAL

The Hostapd HAL provides an interface for the hostapd daemon. Starting with Android 13, the interface uses AIDL for the HAL definition. For releases before Android 13, interfaces and vendor partitions use HIDL.

The hostapd source code is located in external/wpa_supplicant_8/hostapd. The reference implementation provides an AIDL interface, which is implemented in the aidl sub-directory.

Wi-Fi multi-interface concurrency

Different Android devices can support different combinations of Wi-Fi interfaces concurrently. The supported combinations are defined in the HAL and are exposed to the framework. The specification format is defined in android/hardware/interfaces/wifi/1.0/IWifiChip.hal for Wi-Fi HAL 1.5 and lower, and in android/hardware/interfaces/wifi/1.6/IWifiChip.hal for Wi-Fi HAL 1.6 and higher. Wi-Fi HAL version 1.6, available from Android 13, adds the ability to specify a bridged AP interface (dual band simultaneous) as an explicit combination item.

The concurrency specification format is flexible and generic. It can express combinations that aren't yet supported by the framework. To configure a particular combination, use the WIFI_HAL_INTERFACE_COMBINATIONS build flag located in device/<oem>/<device>/BoardConfig-common.mk.

For example, a device can support two STAs and one interface of either NAN (Wi-Fi Aware) or P2P (Wi-Fi Direct) type (but not both). This is expressed in device/<oem>/<device>/BoardConfig-common.mk as:

WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 2}, {{NAN, P2P}, 1}}

Another example is a device that supports a STA with a single AP, or a bridged AP (dual band simultaneous) with no other interfaces. This is represented as:

WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{AP}, 1}}, {{{AP_BRIDGED}, 1}}

Alternatively, the reference HAL has configurations for several combinations that can be activated with (legacy) build flags. For configuration instructions, see: