mac80211: fix IBSS/adhoc mode for brcmfmac
authorBastian Bittorf <bb@npl.de>
Sun, 19 Sep 2021 11:19:36 +0000 (11:19 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 19 Nov 2021 18:27:47 +0000 (18:27 +0000)
On systems using brmcfmac (e.g. Raspberry Pi Zero W) without this fix,
the final setup-call:
iw dev wlan0 ibss join ...

fails with returncode 161 and message:
"command failed: Not supported (-95)"

So this patch calls an explicit:
iw dev wlan0 set type ibss
just prior to the 'ibss join' command.

I have tested several ath9k and mt76xx devices
with different revisions: this patch does not harm.

please also apply to stable branch.

Signed-off-by: Bastian Bittorf <bb@npl.de>
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

index c3cc65d3aa1dbf19f7eff57809a52ff1b9277382..a958773b45f080bcd2a7ab7d020b27b9b4826bba 100644 (file)
@@ -860,6 +860,7 @@ mac80211_setup_adhoc() {
        mcval=
        [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
 
+       iw dev "$ifname" set type ibss
        iw dev "$ifname" ibss join "$ssid" $freq $iw_htmode fixed-freq $bssid \
                beacon-interval $beacon_int \
                ${brstr:+basic-rates $brstr} \