Skip to content

Commit a3e0272

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 59b26ae commit a3e0272

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
@@ -5158,6 +5158,25 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
51585158
settings->inactivity_timeout);
51595159
dev_role = ifp->vif->wdev.iftype;
51605160
mbss = ifp->vif->mbss;
5161+
/* Bring firmware into correct state for AP mode*/
5162+
if (dev_role == NL80211_IFTYPE_AP) {
5163+
brcmf_dbg(TRACE, "set AP mode\n");
5164+
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
5165+
if (err < 0) {
5166+
bphy_err(drvr, "setting AP mode failed %d\n",
5167+
err);
5168+
goto exit;
5169+
}
5170+
5171+
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
5172+
bss_enable.enable = cpu_to_le32(WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE);
5173+
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
5174+
sizeof(bss_enable));
5175+
if (err < 0) {
5176+
bphy_err(drvr, "AP role set error, %d\n", err);
5177+
goto exit;
5178+
}
5179+
}
51615180

51625181
/* store current 11d setting */
51635182
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)