Skip to content

Commit 0ecef36

Browse files
pblassmarcan
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 3e74e00 commit 0ecef36

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
@@ -5125,6 +5125,25 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
51255125
settings->inactivity_timeout);
51265126
dev_role = ifp->vif->wdev.iftype;
51275127
mbss = ifp->vif->mbss;
5128+
/* Bring firmware into correct state for AP mode*/
5129+
if (dev_role == NL80211_IFTYPE_AP) {
5130+
brcmf_dbg(TRACE, "set AP mode\n");
5131+
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
5132+
if (err < 0) {
5133+
bphy_err(drvr, "setting AP mode failed %d\n",
5134+
err);
5135+
goto exit;
5136+
}
5137+
5138+
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
5139+
bss_enable.enable = cpu_to_le32(WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE);
5140+
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
5141+
sizeof(bss_enable));
5142+
if (err < 0) {
5143+
bphy_err(drvr, "AP role set error, %d\n", err);
5144+
goto exit;
5145+
}
5146+
}
51285147

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