2018-11-24 17:58:49

by Stefan Wahren

[permalink] [raw]
Subject: brcmfmac: regression using AP mode

Hi guys,

today i wanted to setup an access point on my Raspberry Pi 3 A+ (BCM43455). Unfortunately the hostapd 2.4 shipped with Raspbian failed with recent Linux kernel:

rfkill: initial event: idx=0 type=2 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Using driver-based roaming
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: Disable use_monitor with device_ap_sme since no monitor mode support detected
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x114350 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x114350 match=
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=3)
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Teardown AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211 driver initialization failed.

I was able to bisect this issue down to this commit:

1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")

After reverting this commit hostapd works as expected.

Best regards
Stefan


2018-11-24 21:32:48

by Rafał Miłecki

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

On 2018-11-24 18:58, Stefan Wahren wrote:
> today i wanted to setup an access point on my Raspberry Pi 3 A+
> (BCM43455). Unfortunately the hostapd 2.4 shipped with Raspbian failed
> with recent Linux kernel:
>
> (...)
>
> I was able to bisect this issue down to this commit:
>
> 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
>
> After reverting this commit hostapd works as expected.

It ringed a bell, I did a quick research and found it. It's because of
that ancient hostapd you're using. 2,5 years ago hostapd received a fix
for its discovery of driver capabilities:

commit f4830bed661f4adff51f50a0d37c64ceb748e780
Author: Rafał Miłecki <[email protected]>
Date: Mon Apr 25 17:10:47 2016 +0200

nl80211: Try running without mgmt frame subscription (driver AP SME)

So your problem is the ancient hostapd that can't run with drivers that:
1) Report NL80211_ATTR_DEVICE_AP_SME
2) Don't support subscribing for PROBE_REQ and/or ACTION frames

Technically there is nothing wrong with such drivers and it's just a
hostapd bug (that's why it was fixed long time ago).

Now, you could try *not* reporting NL80211_ATTR_DEVICE_AP_SME but then
hostapd for drivers that:
1) Support monitor mode
2) Don't support subscribing for PROBE_REQ and/or ACTION frames
will hit yet another mode discovery path in and break as well.

That said there is no perfect solution.

brcmfmac *should* set WIPHY_FLAG_HAVE_AP_SME. It's required for a sane
capabilities discovery in hostapd. It's required to make sure other
supplicants can work with brcmfmac as well.

Possibly you can just update hostapd to anything more recent? I'm afraid
the version you're using may suffer from a lot of security issues anyway

2018-11-25 13:14:20

by Stefan Wahren

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

Hi Rafał,

> Rafał Miłecki <[email protected]> hat am 24. November 2018 um 22:23 geschrieben:
>
>
> Possibly you can just update hostapd to anything more recent? I'm afraid
> the version you're using may suffer from a lot of security issues anyway

thanks for your quick reply. I updated hostapd to 2.6.18 from Debian Buster. This makes hostapd work better, but AP mode still does work (kernel output):

[ 6.085594] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 6.085772] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 6.085781] cfg80211: failed to load regulatory.db
[ 6.148788] Console: switching to colour frame buffer device 240x67
[ 6.170518] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 6.197752] vc4-drm soc:gpu: fb0: DRM emulated frame buffer device
[ 6.324425] random: crng init done
[ 6.324438] random: 7 urandom warning(s) missed due to ratelimiting
[ 6.365083] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 6.398502] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[ 6.800404] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0252
[ 9.961790] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 10.026130] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SS
[ 10.272507] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 13.627905] brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52
[ 146.411501] brcmfmac: brcmf_escan_timeout: timer expired
[ 146.862393] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
[ 257.130466] brcmfmac: brcmf_escan_timeout: timer expired
[ 257.581463] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52

Hostapd output:

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
nl80211: Using driver-based roaming
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x543340 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=04
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=0501
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=2): 05 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=0504
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=2): 05 04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=06
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=08
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=09
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=0a
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=11
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=7f
nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=1): 7f
nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it
nl80211: Enable Probe Request reporting nl_preq=0x543340
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x543340 match=
nl80211: Register frame command failed (type=64): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Failed to enable Probe Request frame reporting in AP mode
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Add own interface ifindex 3 (ifidx_reason -1)
nl80211: if_indices[16]: 3(-1)
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 @ 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 @ 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=14 freq=2484 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=34 freq=5170 MHz max_tx_power=8 dBm
Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=38 freq=5190 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=42 freq=5210 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=46 freq=5230 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=52 freq=5260 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=56 freq=5280 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=60 freq=5300 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=64 freq=5320 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=100 freq=5500 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=104 freq=5520 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=108 freq=5540 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=112 freq=5560 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=116 freq=5580 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=120 freq=5600 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=124 freq=5620 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=128 freq=5640 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=132 freq=5660 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=136 freq=5680 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=140 freq=5700 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=144 freq=5720 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=13 freq=2472 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=14 freq=2484 MHz max_tx_power=20 dBm
Completing interface initialization
Mode: IEEE 802.11a Channel: 36 Frequency: 5180 MHz
DFS 0 channels required radar detection
nl80211: Set freq 5180 (ht_enabled=0, vht_enabled=0, bandwidth=20 MHz, cf1=5180 MHz, cf2=0 MHz)
* freq=5180
* vht_enabled=0
* ht_enabled=0
* channel_type=0
RATE[0] rate=60 flags=0x1
RATE[1] rate=90 flags=0x0
RATE[2] rate=120 flags=0x1
RATE[3] rate=180 flags=0x0
RATE[4] rate=240 flags=0x1
RATE[5] rate=360 flags=0x0
RATE[6] rate=480 flags=0x0
RATE[7] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x5448a8 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
nl80211: Station flush failed: ret=-14 (Bad address)
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations

Stefan

2018-11-26 10:11:21

by Arend van Spriel

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

On 11/25/2018 2:14 PM, Stefan Wahren wrote:
> Hi Rafał,
>
>> Rafał Miłecki <[email protected]> hat am 24. November 2018 um 22:23 geschrieben:
>>
>>
>> Possibly you can just update hostapd to anything more recent? I'm afraid
>> the version you're using may suffer from a lot of security issues anyway
>
> thanks for your quick reply. I updated hostapd to 2.6.18 from Debian Buster. This makes hostapd work better, but AP mode still does work (kernel output):
>
> [ 6.085594] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [ 6.085772] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
> [ 6.085781] cfg80211: failed to load regulatory.db
> [ 6.148788] Console: switching to colour frame buffer device 240x67
> [ 6.170518] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 6.197752] vc4-drm soc:gpu: fb0: DRM emulated frame buffer device
> [ 6.324425] random: crng init done
> [ 6.324438] random: 7 urandom warning(s) missed due to ratelimiting
> [ 6.365083] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 6.398502] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
> [ 6.800404] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0252
> [ 9.961790] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> [ 10.026130] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SS
> [ 10.272507] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> [ 13.627905] brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52
> [ 146.411501] brcmfmac: brcmf_escan_timeout: timer expired
> [ 146.862393] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
> [ 257.130466] brcmfmac: brcmf_escan_timeout: timer expired
> [ 257.581463] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
>
> Hostapd output:
>
> random: Trying to read entropy from /dev/random
> Configuration file: /etc/hostapd/hostapd.conf
> nl80211: Using driver-based roaming
> nl80211: TDLS supported
> nl80211: Supported cipher 00-0f-ac:1
> nl80211: Supported cipher 00-0f-ac:5
> nl80211: Supported cipher 00-0f-ac:2
> nl80211: Supported cipher 00-0f-ac:4
> nl80211: Supported cipher 00-0f-ac:6
> nl80211: Using driver-based off-channel TX
> nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
> nl80211: Use separate P2P group interface (driver advertised support)
> nl80211: Enable multi-channel concurrent (driver advertised support)
> nl80211: use P2P_DEVICE support
> nl80211: interface wlan0 in phy phy0
> nl80211: Set mode ifindex 3 iftype 3 (AP)
> nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
> nl80211: Subscribe to mgmt frames with AP handle 0x543340 (device SME)
> nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x543340 match=04
> nl80211: Register frame command failed (type=208): ret=-22 (Invalid argument)

Probably the mgmt_stypes is not properly set:

if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type)))
return -EINVAL;

which makes sense as brcmfmac has following:

static const struct ieee80211_txrx_stypes
brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
[NL80211_IFTYPE_STATION] = {
.tx = 0xffff,
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
},
[NL80211_IFTYPE_P2P_CLIENT] = {
.tx = 0xffff,
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
},
[NL80211_IFTYPE_P2P_GO] = {
.tx = 0xffff,
.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
BIT(IEEE80211_STYPE_DISASSOC >> 4) |
BIT(IEEE80211_STYPE_AUTH >> 4) |
BIT(IEEE80211_STYPE_DEAUTH >> 4) |
BIT(IEEE80211_STYPE_ACTION >> 4)
},
[NL80211_IFTYPE_P2P_DEVICE] = {
.tx = 0xffff,
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
}
};

So no AP listed here. I suspect Rafał was focusing on "device_ap_sme=1
use_monitor=1" scenario. You can try adding AP entry with similar rx
bits as P2P_GO above.

Regards,
Arend

2018-11-26 18:14:14

by Stefan Wahren

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

Hi Arend,

> Arend van Spriel <[email protected]> hat am 26. November 2018 um 11:11 geschrieben:
>
> So no AP listed here. I suspect Rafał was focusing on "device_ap_sme=1
> use_monitor=1" scenario. You can try adding AP entry with similar rx
> bits as P2P_GO above.

thanks this make all driver errors like "setting AP mode failed -52" disappear, but now hostapd 2.6 seems to stuck in a loop during establishing the link:

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd-5GHz.conf
nl80211: Using driver-based roaming
nl80211: TDLS supported
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x589348 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=0501
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=0504
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x589348 match=7f
nl80211: Enable Probe Request reporting nl_preq=0x5891d8
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x5891d8 match=
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Add own interface ifindex 3 (ifidx_reason -1)
nl80211: if_indices[16]: 3(-1)
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=DE (DFS-ETSI)
nl80211: 2400-2483 @ 40 MHz 20 mBm
nl80211: 5150-5250 @ 80 MHz 20 mBm (no outdoor)
nl80211: 5250-5350 @ 80 MHz 20 mBm (no outdoor) (DFS)
nl80211: 5470-5725 @ 160 MHz 26 mBm (DFS)
nl80211: 5725-5875 @ 80 MHz 13 mBm
nl80211: 57000-66000 @ 2160 MHz 40 mBm
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=34 freq=5170 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=38 freq=5190 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=42 freq=5210 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=46 freq=5230 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=20 dBm
Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=13 dBm
Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=13 dBm
Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=13 dBm
Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=13 dBm
Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=13 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=12 freq=2467 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=13 freq=2472 MHz max_tx_power=20 dBm
Completing interface initialization
Mode: IEEE 802.11a Channel: 36 Frequency: 5180 MHz
DFS 0 channels required radar detection
nl80211: Set freq 5180 (ht_enabled=0, vht_enabled=0, bandwidth=20 MHz, cf1=5180 MHz, cf2=0 MHz)
* freq=5180
* vht_enabled=0
* ht_enabled=0
* channel_type=0
RATE[0] rate=60 flags=0x1
RATE[1] rate=90 flags=0x0
RATE[2] rate=120 flags=0x1
RATE[3] rate=180 flags=0x0
RATE[4] rate=240 flags=0x1
RATE[5] rate=360 flags=0x0
RATE[6] rate=480 flags=0x0
RATE[7] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x58a8a8 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
nl80211: Station flush failed: ret=-14 (Bad address)
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> 0 (Success)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=0)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=2)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=3)
Using interface wlan0 with hwaddr b8:27:eb:6c:5e:c9 and ssid "rpi3aplus"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=9):
72 70 69 33 61 70 6c 75 73 rpi3aplus
PSK (ASCII passphrase) - hexdump_ascii(len=12): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Got 20/20 bytes from /dev/random
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=60): 80 00 00 00 ff ff ff ff ff ff b8 27 eb 6c 5e c9 b8 27 eb 6c 5e c9 00 00 00 00 00 00 00 00 00 00 64 00 11 00 00 09 72 70 69 33 61 70 6c 75 73 01 08 8c 12 98 24 b0 48 60 6c 03 01 24
nl80211: Beacon tail - hexdump(len=28): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00 7f 04 00 00 00 02
nl80211: ifindex=3
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=9):
72 70 69 33 61 70 6c 75 73 rpi3aplus
* beacon_int=100
* dtim_period=2
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x1
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x10
nl80211: group_cipher=0x10
nl80211: beacon_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: proberesp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: assocresp_ies - hexdump(len=6): 7f 04 00 00 00 02
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=3 addr=0x5397a4 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
broadcast key
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: Setup of interface done.
ctrl_iface not configured!
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=5 linkmode=0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
nl80211: Set IF_OPER_UP again based on ifi_flags and expected operstate
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
VLAN: vlan_newlink(wlan0)
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=5 linkmode=0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
nl80211: Set IF_OPER_UP again based on ifi_flags and expected operstate
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
VLAN: vlan_newlink(wlan0)
VLAN: RTM_NEWLINK: ifi_index=3 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)

2018-11-28 20:14:04

by Stefan Wahren

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

Hi,

> Stefan Wahren <[email protected]> hat am 26. November 2018 um 19:14 geschrieben:
>
>
> Hi Arend,
>
> > Arend van Spriel <[email protected]> hat am 26. November 2018 um 11:11 geschrieben:
> >
> > So no AP listed here. I suspect Rafał was focusing on "device_ap_sme=1
> > use_monitor=1" scenario. You can try adding AP entry with similar rx
> > bits as P2P_GO above.
>
> thanks this make all driver errors like "setting AP mode failed -52" disappear, but now hostapd 2.6 seems to stuck in a loop during establishing the link:
>

i increased the debug level of brcmfmac to 0x5 and i'm getting this while booting:

[ 5.288806] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 5.289167] brcmfmac: brcmf_chip_recognition found AXI chip: BCM4345/6
[ 5.293319] brcmfmac: brcmf_chip_cores_check [1 ] core 0x800:51 base 0x18000000 wrap 0x18100000
[ 5.293333] brcmfmac: brcmf_chip_cores_check [2 ] core 0x812:54 base 0x18001000 wrap 0x18101000
[ 5.293344] brcmfmac: brcmf_chip_cores_check [3 ] core 0x83e:9 base 0x18002000 wrap 0x18102000
[ 5.293353] brcmfmac: brcmf_chip_cores_check [4 ] core 0x83c:14 base 0x18003000 wrap 0x18103000
[ 5.293362] brcmfmac: brcmf_chip_cores_check [5 ] core 0x829:21 base 0x18004000 wrap 0x18104000
[ 5.293371] brcmfmac: brcmf_chip_cores_check [6 ] core 0x135:0 base 0x00000000 wrap 0x18107000
[ 5.293379] brcmfmac: brcmf_chip_cores_check [7 ] core 0x240:0 base 0x00000000 wrap 0x00000000
[ 5.295574] brcmfmac: brcmf_chip_get_raminfo RAM: base=0x198000 size=819200 (0xc8000) sr=0 (0x0)
[ 5.295686] brcmfmac: brcmf_chip_setup ccrev=51, pmurev=27, pmucaps=0x39d05f1b
[ 5.295698] brcmfmac: brcmf_get_module_param Enter, bus=0, chip=17221, rev=6
[ 5.295765] brcmfmac: brcmf_sdio_drivestrengthinit No SDIO driver strength init needed for chip BCM4345/6 rev 6 pmurev 27
[ 5.296204] brcmfmac: brcmf_sdio_probe completed!!
[ 5.296219] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 5.413840] brcmfmac: brcmf_sdio_verifymemory Compare RAM dl & ul at 0x00198000; size=600487
[ 5.442090] random: crng init done
[ 5.442105] random: 7 urandom warning(s) missed due to ratelimiting
[ 5.539438] brcmfmac: brcmf_sdio_verifymemory Compare RAM dl & ul at 0x0025f940; size=1728
[ 5.636378] brcmfmac: brcmf_sdio_firmware_callback enable F2: err=0
[ 5.636577] brcmfmac: brcmf_bus_change_state ignoring transition, bus not attached yet
[ 5.636819] brcmfmac: brcmf_add_if allocate netdev interface
[ 5.637199] brcmfmac: brcmf_sdio_readshared sdpcm_shared address 0x001FF350
[ 5.638014] brcmfmac: brcmf_sdio_readshared sdpcm_shared address 0x001FF350
[ 5.641788] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 5.665557] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[ 5.666203] brcmfmac: brcmf_c_preinit_dcmds CLM version = API: 12.2 Data: 9.10.105 Compiler: 1.29.4 ClmImport: 1.36.3 Creation: 2018-03-09 18:56:28
[ 5.673860] brcmfmac: brcmf_feat_firmware_capabilities [ ap sta wme 802.11d 802.11h rm cqa cac dualband ampdu ampdu_tx ampdu_rx amsdurx tdls radio_pwrsave btamp p2p proptxstatus mchan p2po anqpo vht-prop-rates dfrts txpwrcache stbc-tx stbc-rx-1ss epno pfnx wnm bsstrans mfp ]
[ 5.673890] brcmfmac: brcmf_feat_firmware_capabilities enabling feature: MCHAN
[ 5.673899] brcmfmac: brcmf_feat_firmware_capabilities enabling feature: P2P
[ 5.674522] brcmfmac: brcmf_feat_iovar_int_get enabling feature: PNO
[ 5.675854] brcmfmac: brcmf_feat_iovar_int_get enabling feature: TDLS
[ 5.676955] brcmfmac: brcmf_feat_iovar_int_get enabling feature: MFP
[ 5.678014] brcmfmac: brcmf_feat_iovar_int_get enabling feature: FWSUP
[ 5.678066] brcmfmac: brcmf_fws_attach FWS queueing will be avoided
[ 5.678920] brcmfmac: brcmf_cfg80211_attach Registering custom regulatory
[ 5.681508] brcmfmac: brcmf_setup_wiphybands nmode=1, vhtmode=1, bw_cap=(1, 7)
[ 5.684720] brcmfmac: brcmf_setup_wiphybands nchain=1
[ 5.721118] brcmfmac: check_vif_up device is not ready : status (0)
[ 5.721190] brcmfmac: brcmf_net_attach wlan0: Broadcom Dongle Host Driver
[ 5.844422] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0252
[ 10.845747] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.612740] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.613251] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.614724] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.616385] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.637118] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
[ 11.638643] brcmfmac: brcmf_config_dongle power save set to enabled
[ 11.639137] brcmfmac: brcmf_dongle_roam Internal Roaming = On
[ 11.640504] brcmfmac: brcmf_cfg80211_change_iface IF Type = Infra
[ 11.642531] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 11.642545] brcmfmac: brcmf_cfg80211_set_power_mgmt power save enabled
[ 11.767278] brcmfmac: brcmf_p2p_add_vif adding vif "p2p-dev-wlan0" (type=10)
[ 11.789469] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
[ 11.791667] brcmfmac: brcmf_add_if allocate non-netdev interface
[ 11.792237] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.792260] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.912572] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.913704] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.913881] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.914027] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.915150] brcmfmac: check_vif_up device is not ready : status (0)
[ 11.915230] brcmfmac: check_vif_up device is not ready : status (0)
[ 14.706985] brcmfmac: brcmf_cfg80211_connect ie (29d9d630), ie_len (28)
[ 17.638253] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 19.655039] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 21.780277] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 24.744917] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 24.995983] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 25.246750] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 25.446303] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 26.569338] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 28.692076] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)

and this after starting hostapd 2.6:

[ 207.921068] brcmfmac: brcmf_btcoex_set_mode DHCP session ends
[ 207.921352] brcmfmac: brcmf_cfg80211_change_iface IF Type = AP
[ 209.114209] brcmfmac: brcmf_set_mpc MPC : 0
[ 209.143594] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
[ 211.049412] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 213.051521] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 218.084704] brcmfmac: brcmf_escan_timeout: timer expired
[ 218.531282] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
[ 218.531776] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
[ 218.532228] brcmfmac: brcmf_set_mpc MPC : 1
[ 218.533962] brcmfmac: brcmf_cfg80211_change_iface IF Type = Infra
[ 218.537955] brcmfmac: brcmf_cfg80211_connect ie (537583ca), ie_len (28)
[ 223.410796] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 225.526035] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 227.705830] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 227.956466] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 228.207019] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 228.407567] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 229.521312] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
[ 231.621031] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)

2018-11-29 10:42:19

by James Hughes

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

On Wed, 28 Nov 2018 at 20:14, Stefan Wahren <[email protected]> wrote:
>
> Hi,
>
> > Stefan Wahren <[email protected]> hat am 26. November 2018 um 19:14 geschrieben:
> >
> >
> > Hi Arend,
> >
> > > Arend van Spriel <[email protected]> hat am 26. November 2018 um 11:11 geschrieben:
> > >
> > > So no AP listed here. I suspect Rafał was focusing on "device_ap_sme=1
> > > use_monitor=1" scenario. You can try adding AP entry with similar rx
> > > bits as P2P_GO above.
> >
> > thanks this make all driver errors like "setting AP mode failed -52" disappear, but now hostapd 2.6 seems to stuck in a loop during establishing the link:
> >
>
> i increased the debug level of brcmfmac to 0x5 and i'm getting this while booting:
>
> [ 5.288806] brcmfmac: F1 signature read @0x18000000=0x15264345
> [ 5.289167] brcmfmac: brcmf_chip_recognition found AXI chip: BCM4345/6
> [ 5.293319] brcmfmac: brcmf_chip_cores_check [1 ] core 0x800:51 base 0x18000000 wrap 0x18100000
> [ 5.293333] brcmfmac: brcmf_chip_cores_check [2 ] core 0x812:54 base 0x18001000 wrap 0x18101000
> [ 5.293344] brcmfmac: brcmf_chip_cores_check [3 ] core 0x83e:9 base 0x18002000 wrap 0x18102000
> [ 5.293353] brcmfmac: brcmf_chip_cores_check [4 ] core 0x83c:14 base 0x18003000 wrap 0x18103000
> [ 5.293362] brcmfmac: brcmf_chip_cores_check [5 ] core 0x829:21 base 0x18004000 wrap 0x18104000
> [ 5.293371] brcmfmac: brcmf_chip_cores_check [6 ] core 0x135:0 base 0x00000000 wrap 0x18107000
> [ 5.293379] brcmfmac: brcmf_chip_cores_check [7 ] core 0x240:0 base 0x00000000 wrap 0x00000000
> [ 5.295574] brcmfmac: brcmf_chip_get_raminfo RAM: base=0x198000 size=819200 (0xc8000) sr=0 (0x0)
> [ 5.295686] brcmfmac: brcmf_chip_setup ccrev=51, pmurev=27, pmucaps=0x39d05f1b
> [ 5.295698] brcmfmac: brcmf_get_module_param Enter, bus=0, chip=17221, rev=6
> [ 5.295765] brcmfmac: brcmf_sdio_drivestrengthinit No SDIO driver strength init needed for chip BCM4345/6 rev 6 pmurev 27
> [ 5.296204] brcmfmac: brcmf_sdio_probe completed!!
> [ 5.296219] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 5.413840] brcmfmac: brcmf_sdio_verifymemory Compare RAM dl & ul at 0x00198000; size=600487
> [ 5.442090] random: crng init done
> [ 5.442105] random: 7 urandom warning(s) missed due to ratelimiting
> [ 5.539438] brcmfmac: brcmf_sdio_verifymemory Compare RAM dl & ul at 0x0025f940; size=1728
> [ 5.636378] brcmfmac: brcmf_sdio_firmware_callback enable F2: err=0
> [ 5.636577] brcmfmac: brcmf_bus_change_state ignoring transition, bus not attached yet
> [ 5.636819] brcmfmac: brcmf_add_if allocate netdev interface
> [ 5.637199] brcmfmac: brcmf_sdio_readshared sdpcm_shared address 0x001FF350
> [ 5.638014] brcmfmac: brcmf_sdio_readshared sdpcm_shared address 0x001FF350
> [ 5.641788] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
> [ 5.665557] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
> [ 5.666203] brcmfmac: brcmf_c_preinit_dcmds CLM version = API: 12.2 Data: 9.10.105 Compiler: 1.29.4 ClmImport: 1.36.3 Creation: 2018-03-09 18:56:28
> [ 5.673860] brcmfmac: brcmf_feat_firmware_capabilities [ ap sta wme 802.11d 802.11h rm cqa cac dualband ampdu ampdu_tx ampdu_rx amsdurx tdls radio_pwrsave btamp p2p proptxstatus mchan p2po anqpo vht-prop-rates dfrts txpwrcache stbc-tx stbc-rx-1ss epno pfnx wnm bsstrans mfp ]
> [ 5.673890] brcmfmac: brcmf_feat_firmware_capabilities enabling feature: MCHAN
> [ 5.673899] brcmfmac: brcmf_feat_firmware_capabilities enabling feature: P2P
> [ 5.674522] brcmfmac: brcmf_feat_iovar_int_get enabling feature: PNO
> [ 5.675854] brcmfmac: brcmf_feat_iovar_int_get enabling feature: TDLS
> [ 5.676955] brcmfmac: brcmf_feat_iovar_int_get enabling feature: MFP
> [ 5.678014] brcmfmac: brcmf_feat_iovar_int_get enabling feature: FWSUP
> [ 5.678066] brcmfmac: brcmf_fws_attach FWS queueing will be avoided
> [ 5.678920] brcmfmac: brcmf_cfg80211_attach Registering custom regulatory
> [ 5.681508] brcmfmac: brcmf_setup_wiphybands nmode=1, vhtmode=1, bw_cap=(1, 7)
> [ 5.684720] brcmfmac: brcmf_setup_wiphybands nchain=1
> [ 5.721118] brcmfmac: check_vif_up device is not ready : status (0)
> [ 5.721190] brcmfmac: brcmf_net_attach wlan0: Broadcom Dongle Host Driver
> [ 5.844422] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0252
> [ 10.845747] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.612740] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.613251] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.614724] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.616385] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.637118] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
> [ 11.638643] brcmfmac: brcmf_config_dongle power save set to enabled
> [ 11.639137] brcmfmac: brcmf_dongle_roam Internal Roaming = On
> [ 11.640504] brcmfmac: brcmf_cfg80211_change_iface IF Type = Infra
> [ 11.642531] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> [ 11.642545] brcmfmac: brcmf_cfg80211_set_power_mgmt power save enabled
> [ 11.767278] brcmfmac: brcmf_p2p_add_vif adding vif "p2p-dev-wlan0" (type=10)
> [ 11.789469] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
> [ 11.791667] brcmfmac: brcmf_add_if allocate non-netdev interface
> [ 11.792237] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.792260] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.912572] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.913704] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.913881] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.914027] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.915150] brcmfmac: check_vif_up device is not ready : status (0)
> [ 11.915230] brcmfmac: check_vif_up device is not ready : status (0)
> [ 14.706985] brcmfmac: brcmf_cfg80211_connect ie (29d9d630), ie_len (28)
> [ 17.638253] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> [ 19.655039] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 21.780277] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 24.744917] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 24.995983] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 25.246750] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 25.446303] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 26.569338] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 28.692076] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)

I wonder if the test on line 302 ish in core.c should be <=. The head
delta is 0, which actually means its doesn't need to be increased in
size.

if (skb_headroom(skb) < drvr->hdrlen || skb_header_cloned(skb)) {
<<<< should be <=
head_delta = max_t(int, drvr->hdrlen - skb_headroom(skb), 0);

Don't think this could be the cause of the problem though.

>
> and this after starting hostapd 2.6:
>
> [ 207.921068] brcmfmac: brcmf_btcoex_set_mode DHCP session ends
> [ 207.921352] brcmfmac: brcmf_cfg80211_change_iface IF Type = AP
> [ 209.114209] brcmfmac: brcmf_set_mpc MPC : 0
> [ 209.143594] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
> [ 211.049412] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 213.051521] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 218.084704] brcmfmac: brcmf_escan_timeout: timer expired
> [ 218.531282] brcmfmac: brcmf_add_if netdev:wlan0 ignore IF event
> [ 218.531776] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
> [ 218.532228] brcmfmac: brcmf_set_mpc MPC : 1
> [ 218.533962] brcmfmac: brcmf_cfg80211_change_iface IF Type = Infra
> [ 218.537955] brcmfmac: brcmf_cfg80211_connect ie (537583ca), ie_len (28)
> [ 223.410796] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 225.526035] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 227.705830] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 227.956466] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 228.207019] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 228.407567] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 229.521312] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)
> [ 231.621031] brcmfmac: brcmf_netdev_start_xmit wlan0: insufficient headroom (0)

2018-12-07 10:29:16

by Stefan Wahren

[permalink] [raw]
Subject: Re: brcmfmac: regression using AP mode

Hi,

Am 26.11.18 um 11:11 schrieb Arend van Spriel:
> On 11/25/2018 2:14 PM, Stefan Wahren wrote:
>> Hi Rafał,
>>
>>> Rafał Miłecki <[email protected]> hat am 24. November 2018 um 22:23
>>> geschrieben:
>>>
>>>
>>> Possibly you can just update hostapd to anything more recent? I'm
>>> afraid
>>> the version you're using may suffer from a lot of security issues
>>> anyway
>>
>> thanks for your quick reply. I updated hostapd to 2.6.18 from Debian
>> Buster. This makes hostapd work better, but AP mode still does work
>> (kernel output):
>>
>> [    6.085594] cfg80211: Loaded X.509 cert 'sforshee:
>> 00b28ddf47aef9cea7'
>> [    6.085772] platform regulatory.0: Direct firmware load for
>> regulatory.db failed with error -2
>> [    6.085781] cfg80211: failed to load regulatory.db
>> [    6.148788] Console: switching to colour frame buffer device 240x67
>> [    6.170518] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43455-sdio for chip BCM4345/6
>> [    6.197752] vc4-drm soc:gpu: fb0: DRM emulated frame buffer device
>> [    6.324425] random: crng init done
>> [    6.324438] random: 7 urandom warning(s) missed due to ratelimiting
>> [    6.365083] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43455-sdio for chip BCM4345/6
>> [    6.398502] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6
>> wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
>> [    6.800404] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0252
>> [    9.961790] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
>> [   10.026130] Adding 102396k swap on /var/swap.  Priority:-2
>> extents:1 across:102396k SS
>> [   10.272507] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
>> [   13.627905] brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode
>> failed -52
>> [  146.411501] brcmfmac: brcmf_escan_timeout: timer expired
>> [  146.862393] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
>> [  257.130466] brcmfmac: brcmf_escan_timeout: timer expired
>> [  257.581463] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
>>
>> Hostapd output:
>>
>> random: Trying to read entropy from /dev/random
>> Configuration file: /etc/hostapd/hostapd.conf
>> nl80211: Using driver-based roaming
>> nl80211: TDLS supported
>> nl80211: Supported cipher 00-0f-ac:1
>> nl80211: Supported cipher 00-0f-ac:5
>> nl80211: Supported cipher 00-0f-ac:2
>> nl80211: Supported cipher 00-0f-ac:4
>> nl80211: Supported cipher 00-0f-ac:6
>> nl80211: Using driver-based off-channel TX
>> nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
>> nl80211: Use separate P2P group interface (driver advertised support)
>> nl80211: Enable multi-channel concurrent (driver advertised support)
>> nl80211: use P2P_DEVICE support
>> nl80211: interface wlan0 in phy phy0
>> nl80211: Set mode ifindex 3 iftype 3 (AP)
>> nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
>> nl80211: Subscribe to mgmt frames with AP handle 0x543340 (device SME)
>> nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION)
>> nl_handle=0x543340 match=04
>> nl80211: Register frame command failed (type=208): ret=-22 (Invalid
>> argument)
>
> Probably the mgmt_stypes is not properly set:
>
>         if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx &
> BIT(mgmt_type)))
>                 return -EINVAL;
>
> which makes sense as brcmfmac has following:
>
> static const struct ieee80211_txrx_stypes
> brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
>         [NL80211_IFTYPE_STATION] = {
>                 .tx = 0xffff,
>                 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
>                       BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
>         },
>         [NL80211_IFTYPE_P2P_CLIENT] = {
>                 .tx = 0xffff,
>                 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
>                       BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
>         },
>         [NL80211_IFTYPE_P2P_GO] = {
>                 .tx = 0xffff,
>                 .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
>                       BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
>                       BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
>                       BIT(IEEE80211_STYPE_DISASSOC >> 4) |
>                       BIT(IEEE80211_STYPE_AUTH >> 4) |
>                       BIT(IEEE80211_STYPE_DEAUTH >> 4) |
>                       BIT(IEEE80211_STYPE_ACTION >> 4)
>         },
>         [NL80211_IFTYPE_P2P_DEVICE] = {
>                 .tx = 0xffff,
>                 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
>                       BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
>         }
> };
>
> So no AP listed here. I suspect Rafał was focusing on "device_ap_sme=1
> use_monitor=1" scenario. You can try adding AP entry with similar rx
> bits as P2P_GO above.

please ignore my last mail, i forgot to terminate wpa_supplicant before :-(

Your suggestion works with hostapd 2.6. I could prepare a patch but i'm
not sure about the proper commit log.

Stefan

>
> Regards,
> Arend