Skip to content

Commit 5f743dd

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 <[email protected]>
1 parent a40b960 commit 5f743dd

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
@@ -5230,6 +5230,25 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
52305230
settings->inactivity_timeout);
52315231
dev_role = ifp->vif->wdev.iftype;
52325232
mbss = ifp->vif->mbss;
5233+
/* Bring firmware into correct state for AP mode*/
5234+
if (dev_role == NL80211_IFTYPE_AP) {
5235+
brcmf_dbg(TRACE, "set AP mode\n");
5236+
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1);
5237+
if (err < 0) {
5238+
bphy_err(drvr, "setting AP mode failed %d\n",
5239+
err);
5240+
goto exit;
5241+
}
5242+
5243+
bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
5244+
bss_enable.enable = cpu_to_le32(WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE);
5245+
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
5246+
sizeof(bss_enable));
5247+
if (err < 0) {
5248+
bphy_err(drvr, "AP role set error, %d\n", err);
5249+
goto exit;
5250+
}
5251+
}
52335252

52345253
/* store current 11d setting */
52355254
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
@@ -101,6 +101,8 @@
101101
#define WLC_BAND_ALL 3 /* all bands */
102102
#define WLC_BAND_6G 4 /* 6 Ghz */
103103

104+
#define WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE 2
105+
104106
#define CHSPEC_CHANNEL(chspec) ((u8)((chspec) & WL_CHANSPEC_CHAN_MASK))
105107
#define CHSPEC_BAND(chspec) ((chspec) & WL_CHANSPEC_BAND_MASK)
106108

0 commit comments

Comments
 (0)