brcmfmac problems

Hauke Mehrtens hauke at hauke-m.de
Mon Nov 22 15:18:34 PST 2021


Hi,

I tried brcmfmac on a Raspberry Pi 4 with OpenWrt master and ran into 
some problems.

By default the following /etc/config/wireless is generated:
----------
config wifi-device 'radio0'
         option type 'mac80211'
         option path 
'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
         option channel '36'
         option band '5g'
         option htmode 'VHT80'
         option disabled '1'

config wifi-iface 'default_radio0'
         option device 'radio0'
         option network 'lan'
         option mode 'ap'
         option ssid 'OpenWrt'
         option encryption 'none'
----------

When I activate this configuration I get some error messages:
	uci set wireless. at wifi-device[0].disabled=0
------------------
19:34:43 2021 daemon.notice netifd: radio0 (1261): command failed: No 
error information (-524)
19:34:43 2021 daemon.notice netifd: radio0 (1261): command failed: I/O 
error (-5)
19:34:44 2021 daemon.notice hostapd: Configuration file: 
/var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
19:34:44 2021 kern.info kernel: [   25.561489] br-lan: port 2(wlan0) 
entered blocking state
19:34:44 2021 kern.info kernel: [   25.566824] br-lan: port 2(wlan0) 
entered disabled state
19:34:44 2021 daemon.notice hostapd: wlan0: interface state 
UNINITIALIZED->HT_SCAN
19:34:44 2021 kern.info kernel: [   25.572438] device wlan0 entered 
promiscuous mode
19:34:44 2021 daemon.err hostapd: nl80211: kernel reports: (extension) 
channel is disabled
19:34:44 2021 daemon.err hostapd: Could not set channel for kernel driver
19:34:44 2021 daemon.err hostapd: Interface initialization failed
19:34:44 2021 daemon.notice hostapd: wlan0: interface state 
HT_SCAN->DISABLED
19:34:44 2021 daemon.notice hostapd: wlan0: AP-DISABLED
19:34:45 2021 daemon.err odhcpd[746]: Failed to send to 
ff02::1%lan at br-lan (Address not available)
19:34:45 2021 daemon.notice netifd: Wireless device 'radio0' is now up
------------------

The "command failed" error messages are not a problem, they are caused 
by these iw commands:
	iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
and
	iw phy "$phy" set txpower auto

The real problem is this here:
	19:34:44 2021 daemon.err hostapd: nl80211: kernel reports: (extension) 
channel is disabled

The driver supports the following frequencies:
------------------
iw phy phy0 info
......
              Frequencies:
                      * 5170 MHz [34] (disabled)
                      * 5180 MHz [36] (20.0 dBm)
                      * 5190 MHz [38] (disabled)
                      * 5200 MHz [40] (20.0 dBm)
                      * 5210 MHz [42] (disabled)
                      * 5220 MHz [44] (20.0 dBm)
                      * 5230 MHz [46] (disabled)
                      * 5240 MHz [48] (20.0 dBm)
                      * 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
                      * 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
                      * 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
                      * 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
......
-------------------

My hostapd configuration in /tmp/run/hostapd-phy0.conf contains this 
setting:
	vht_oper_centr_freq_seg0_idx=42
This channel is not allows by the firmware used on this chip.

When I set the htmode to VHT20, it does not use 
vht_oper_centr_freq_seg0_idx and hostapd get further.
	uci set wireless. at wifi-device[0].htmode="VHT20"

It would be nice if the default configuration would work, we could 
detect if the vht center frequency is not allowed and use VHT20 
otherwise, but I do not really know how to implement this here:
package/kernel/mac80211/files/lib/wifi/mac80211.sh


Now I get the next problem. ;-)

----------------
19:48:13 2021 kern.info kernel: [   40.258130] device wlan0 entered 
promiscuous mode
19:48:13 2021 daemon.err hostapd: Failed to initialize QoS Map
19:48:13 2021 daemon.warn hostapd: wlan0: Could not connect to kernel driver
19:48:13 2021 daemon.err hostapd: Interface initialization failed
19:48:13 2021 daemon.notice hostapd: wlan0: interface state 
UNINITIALIZED->DISABLED
19:48:13 2021 daemon.notice hostapd: wlan0: AP-DISABLED
----------------

The brcmfmac driver does not implement the set_qos_map callback and 
hostapd fails. If this feature is supported by the driver it is returned 
by the iw-full in "iw phy phy0 info".

When I deactivate the iw_qos_map_set the wifi interface finally starts up:
	uci set wireless. at wifi-iface[0].iw_qos_map_set="none"

When I use psk2 encryption I am able to connect to the AP, I haven't 
tried open AP.

When I use the sae-mixed encryption, I am unable to connect to the AP 
with an old Intel card and a Pixel 3A phone. When when I change it back 
to psk2 I am still unable to connect. I have to reboot the Raspberry Pi 
4 to make the AP work again.

I do not really plan to further debug this I just want to document my 
findings. This was done with OpenWrt r18161.

Hauke



More information about the openwrt-devel mailing list