Android 8.1 brcmfmac backport cannot create wlan0 interface

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ej
Level 1
Level 1
10 sign-ins 5 questions asked 5 sign-ins

Hello,

We are trying to use the brcmfmac backports driver for a CYW43455 on and Allwinner BSP using Android 8.1 + Kernel 4.9. We were previously using the bcmdhd driver + hal (using libhardware_legacy) provided by the Allwinner BSP. We have built the brcmfmac backport kernel modules (v5.4.18-2020_0925), and the firmware (provided by our vendor AzureWave) is being loaded successfully:

6,7572,90624538,-;brcmfmac: brcmf_fw_alloc_request: using /system/vendor/modules/fw_cyw43455 for chip BCM4345/6
6,7574,90677612,-;brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Aug 16 2020 21:23:41 version 7.45.203 (r724662 CY) FWID 01-4cfc72ea

However the wlan0 network device is not available, and the WifiVenorHal fails to load:

02-24 23:00:31.013 1990 2239 D WifiService: setWifiEnabled: true pid=22334, uid=0, package=com.android.shell
02-24 23:00:31.013 1990 2239 I WifiService: setWifiEnabled package=com.android.shell uid=0 enable=true
02-24 23:00:31.014 1990 2116 D WifiStateMachine: setting operational mode to 1
02-24 23:00:31.014 1990 2116 D WifiStateMachine: setting operational mode to 1
02-24 23:00:31.015 1990 2117 D WifiStateMachine: InitialState !CMD_SET_OPERATIONAL_MODE rt=10880343/10880343 1 0
02-24 23:00:31.015 1990 2117 D WifiStateMachine: InitialState !CMD_START_SUPPLICANT rt=10880343/10880343 0 0
02-24 23:00:31.015 1990 2117 D HalDeviceManager: isSupportedInternal
02-24 23:00:31.017 1990 2117 D HalDeviceManager: startWifi
02-24 23:00:31.018 1682 1682 I android.hardware.wifi@1.0-service: Wifi HAL started
02-24 23:00:31.018 1990 2101 D HalDeviceManager: IWifiEventCallback.onStart
02-24 23:00:31.018 1990 2117 D HalDeviceManager: initIWifiChipDebugListeners
02-24 23:00:31.019 1990 2117 D HalDeviceManager: getChipIds=[0]
02-24 23:00:31.021 1990 2117 D HalDeviceManager: createIface: ifaceType=0
02-24 23:00:31.022 1990 2117 D HalDeviceManager: getAllChipInfo
02-24 23:00:31.022 1990 2117 D HalDeviceManager: getChipIds=[0]
02-24 23:00:31.027 1990 2117 D HalDeviceManager: validateInterfaceCache
02-24 23:00:31.028 1990 2117 D HalDeviceManager: createIfaceIfPossible: chipInfos=[{chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0)], ifaceType=0
02-24 23:00:31.028 1990 2117 D HalDeviceManager: {.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]} expands to [[1, 0, 1, 0]]
02-24 23:00:31.029 1990 2117 D HalDeviceManager: canIfaceComboSupportRequest: chipInfo={chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0), chipMode={.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, chipIfaceCombo=[I@f320350, ifaceType=0
02-24 23:00:31.029 1990 2117 D HalDeviceManager: compareIfaceCreationData: val1={chipInfo={chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0), chipModeId=0, interfacesToBeRemovedFirst=[]), val2=null
02-24 23:00:31.029 1990 2117 D HalDeviceManager: new proposal accepted
02-24 23:00:31.030 1990 2117 D HalDeviceManager: {.limits = [{.types = [1], .maxIfaces = 1}]} expands to [[0, 1, 0, 0]]
02-24 23:00:31.030 1990 2117 D HalDeviceManager: canIfaceComboSupportRequest: chipInfo={chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0), chipMode={.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}, chipIfaceCombo=[I@dfd924e, ifaceType=0
02-24 23:00:31.030 1990 2117 D HalDeviceManager: Requested type not supported by combo
02-24 23:00:31.031 1990 2117 D HalDeviceManager: compareIfaceCreationData: val1=null, val2={chipInfo={chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0), chipModeId=0, interfacesToBeRemovedFirst=[])
02-24 23:00:31.031 1990 2117 D HalDeviceManager: executeChipReconfiguration: ifaceCreationData={chipInfo={chipId=0, availableModes=[{.id = 0, .availableCombinations = [{.limits = [{.types = [0], .maxIfaces = 1}, {.types = [2], .maxIfaces = 1}]}]}, {.id = 1, .availableCombinations = [{.limits = [{.types = [1], .maxIfaces = 1}]}]}], currentModeIdValid=false, currentModeId=0, ifaces[1].length=0, ifaces[0].length=0, ifaces[2].length=0, ifaces[3].length=0), chipModeId=0, interfacesToBeRemovedFirst=[]), ifaceType=0
02-24 23:00:31.031 1990 2117 D HalDeviceManager: isModeConfigNeeded=true
02-24 23:00:31.032 1682 1682 E android.hardware.wifi@1.0-service: wifi_load_driver: Start to insmod brcmfmac.ko
02-24 23:00:31.032 1682 1682 E android.hardware.wifi@1.0-service: module_arg= nvram_path=/system/vendor/modules/nvram_awcm390sm.txt config_path=/system/vendor/modules/config_awcm390sm.txt
02-24 23:00:31.032 1682 1682 E android.hardware.wifi@1.0-service: module_path= /system/vendor/modules/brcmfmac.ko
02-24 23:00:31.032 1682 1682 I android.hardware.wifi@1.0-service: Open /system/vendor/modules/brcmfmac.ko succuss.
02-24 23:00:31.076 1682 1682 I android.hardware.wifi@1.0-service: Do finit_module ret = 0
02-24 23:00:31.077 1682 1682 I android.hardware.wifi@1.0-service: wifi_driver_fw_path_param = /sys/module/brcmfmac/parameters/alternative_fw_path
02-24 23:00:31.078 1682 1682 E android.hardware.wifi@1.0-service: Could not read interface state for wlan0 (No such device)
02-24 23:00:31.078 1682 1682 E android.hardware.wifi@1.0-service: Failed to set WiFi interface up
02-24 23:00:31.078 1682 1682 E android.hardware.wifi@1.0-service: Failed to start legacy HAL: UNKNOWN
02-24 23:00:31.079 1990 2101 D HalDeviceManager: onChipReconfigureFailure: status=9 (unknown)
02-24 23:00:31.079 1990 2117 E HalDeviceManager: executeChipReconfiguration: configureChip error: 9 (unknown)
02-24 23:00:31.079 1990 2117 E WifiVendorHal: Failed to create STA Iface. Vendor Hal start failed
02-24 23:00:31.079 1990 2117 D HalDeviceManager: stopWifi
02-24 23:00:32.712 1990 2023 D IpManager.wlan0: interfaceAdded(wlan0)
02-24 23:00:33.336 1990 2023 D IpManager.wlan0: interfaceRemoved(wlan0)

What are we missing to create the wlan0 interface?

0 Likes
1 Solution
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Please perform insmod brcmfmac.ko debug=0x7 and attach the dmesg logs. The brcm_net_attach() should indicate the wlan0 interface. Did you try performing ifconfig wlan0 up after driver bring up? The Hostap patch list for supplicant and hostapd is shown in the README document bundled in the FMAC driver package. The older supplicant and hostap may not contain the fixes of that patch list.

View solution in original post

0 Likes
2 Replies
ej
Level 1
Level 1
10 sign-ins 5 questions asked 5 sign-ins

We have worked around this by just delaying for 2 seconds in  libwifi_hal/wifi_hal_common.cpp after the driver insmod, giving the wlan0 device time to come up after brcmfmac.ko is loaded. Is there a more robust way to wait for the bcrmfmac initialization of wlan0 than just a fixed delay?

Also we are not using any of the backport patches to hostapd & wpa_supplicant, and continue to use the wpa_supplocant provided with our oreo BSP. Will we run into issues using the brcmfmac driver with the older hostapd & wpa_supplicant sources?

Thanks!

0 Likes
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Please perform insmod brcmfmac.ko debug=0x7 and attach the dmesg logs. The brcm_net_attach() should indicate the wlan0 interface. Did you try performing ifconfig wlan0 up after driver bring up? The Hostap patch list for supplicant and hostapd is shown in the README document bundled in the FMAC driver package. The older supplicant and hostap may not contain the fixes of that patch list.

0 Likes