Skip to content

Commit 062505e

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 b870f1e commit 062505e

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

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