Skip to content

Commit 17bd762

Browse files
pblassjannau
authored andcommitted
brcmfmac: Fix AP mode
Fix access point mode by bringing firmware into appropriate state before setting up the device. Signed-off-by: Patrick Blass <patrickblass.dev@gmail.com>
1 parent 602852f commit 17bd762

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,6 +5132,25 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
51325132
settings->inactivity_timeout);
51335133
dev_role = ifp->vif->wdev.iftype;
51345134
mbss = ifp->vif->mbss;
5135+
/* Bring firmware into correct state for AP mode*/
5136+
if (dev_role == NL80211_IFTYPE_AP) {
5137+
brcmf_dbg(TRACE, "set AP mode\n");
5138+
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
5139+
if (err < 0) {
5140+
bphy_err(drvr, "setting AP mode failed %d\n",
5141+
err);
5142+
goto exit;
5143+
}
5144+
5145+
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
5146+
bss_enable.enable = cpu_to_le32(WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE);
5147+
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
5148+
sizeof(bss_enable));
5149+
if (err < 0) {
5150+
bphy_err(drvr, "AP role set error, %d\n", err);
5151+
goto exit;
5152+
}
5153+
}
51355154

51365155
/* store current 11d setting */
51375156
if (brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY,

drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
#define WLC_BAND_2G 2 /* 2.4 Ghz */
9595
#define WLC_BAND_ALL 3 /* all bands */
9696

97+
#define WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE 2
98+
9799
#define CHSPEC_CHANNEL(chspec) ((u8)((chspec) & WL_CHANSPEC_CHAN_MASK))
98100
#define CHSPEC_BAND(chspec) ((chspec) & WL_CHANSPEC_BAND_MASK)
99101

0 commit comments

Comments
 (0)