Wi-Fi HAL

The Wi-Fi framework has three Wi-Fi HAL surfaces represented by three different interfaces. For devices running Android 14 or higher, all three interfaces are available as stable AIDL packages. These interfaces were previously defined using HIDL.

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

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.

In Android 14 and higher, the Vendor HAL interface is defined using AIDL. In Android 13 and lower, the Vendor HAL interface is defined using HIDL.

Pre-HIDL (that is before Android 8.0) Android used a HAL mechanism now called legacy HAL. The Android source code currently provides a default implementation of AIDL or 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/aidl/default for AIDL and hardware/interfaces/wifi/1.x/default for HIDL.

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 hardware/interfaces/wifi/aidl/android/hardware/wifi/IWifiChip.aidl for the AIDL Wi-Fi HAL, android/hardware/interfaces/wifi/1.6/IWifiChip.hal for Wi-Fi HAL 1.6, and android/hardware/interfaces/wifi/1.0/IWifiChip.hal for Wi-Fi HAL 1.5 and lower.

The AIDL HAL, available for Android 14 and higher, and Wi-Fi HAL version 1.6, available in Android 13 add 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: