Skip to content

Commit

Permalink
mac80211: fix IBSS/adhoc mode for brcmfmac
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bittorf authored and dangowrt committed Nov 19, 2021
1 parent 0c70c5c commit ea5fce3
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -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} \
Expand Down

3 comments on commit ea5fce3

@PolynomialDivision
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also apply to banana pi r64. However, it still works.

@dangowrt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On mac80211-based drivers this generally shouldn't do any harm, it's just redundant. On less capable drivers offering only cfg80211 (brcmfmac, wil6120, ...) and a single network device the call is needed as removing/adding the interface with a given type always fails, hence the new type is not applied.

@PolynomialDivision
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt Thanks for your response. Yeah but I was also seeing this "command failed: Not supported (-95)" warnings. So I am happy, that this fixed! :)

Please sign in to comment.