Skip to content

Commit d358795

Browse files
WenChieh-Fengjmberg-intel
authored andcommitted
wifi: brcmfmac: support AP isolation to restrict reachability between stations
hostapd & wpa_supplicant userspace daemons exposes an AP mode specific config file parameter "ap_isolate" to the user, which is used to control low-level bridging of frames between the stations associated in the BSS. In driver, handle this user setting in the newly defined cfg80211_ops function brcmf_cfg80211_change_bss() by enabling "ap_isolate" IOVAR in the firmware. In AP mode, the "ap_isolate" value from the cfg80211 layer represents, 0 = allow low-level bridging of frames between associated stations 1 = restrict low-level bridging of frames to isolate associated stations -1 = do not change existing setting Signed-off-by: Wright Feng <[email protected]> Signed-off-by: Chi-hsien Lin <[email protected]> Signed-off-by: Gokul Sivakumar <[email protected]> [arend: indicate ap_isolate support in struct wiphy::bss_param_support] Signed-off-by: Arend van Spriel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 4f652a3 commit d358795

File tree

1 file changed

+23
-0
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5958,6 +5958,26 @@ static int brcmf_cfg80211_del_pmk(struct wiphy *wiphy, struct net_device *dev,
59585958
return brcmf_set_pmk(ifp, NULL, 0);
59595959
}
59605960

5961+
static int brcmf_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev,
5962+
struct bss_parameters *params)
5963+
{
5964+
struct brcmf_if *ifp = netdev_priv(dev);
5965+
int ret = 0;
5966+
5967+
/* In AP mode, the "ap_isolate" value represents
5968+
* 0 = allow low-level bridging of frames between associated stations
5969+
* 1 = restrict low-level bridging of frames to isolate associated stations
5970+
* -1 = do not change existing setting
5971+
*/
5972+
if (params->ap_isolate >= 0) {
5973+
ret = brcmf_fil_iovar_int_set(ifp, "ap_isolate", params->ap_isolate);
5974+
if (ret < 0)
5975+
brcmf_err("ap_isolate iovar failed: ret=%d\n", ret);
5976+
}
5977+
5978+
return ret;
5979+
}
5980+
59615981
static struct cfg80211_ops brcmf_cfg80211_ops = {
59625982
.add_virtual_intf = brcmf_cfg80211_add_iface,
59635983
.del_virtual_intf = brcmf_cfg80211_del_iface,
@@ -6005,6 +6025,7 @@ static struct cfg80211_ops brcmf_cfg80211_ops = {
60056025
.update_connect_params = brcmf_cfg80211_update_conn_params,
60066026
.set_pmk = brcmf_cfg80211_set_pmk,
60076027
.del_pmk = brcmf_cfg80211_del_pmk,
6028+
.change_bss = brcmf_cfg80211_change_bss,
60086029
};
60096030

60106031
struct cfg80211_ops *brcmf_cfg80211_get_ops(struct brcmf_mp_device *settings)
@@ -7659,6 +7680,8 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
76597680
BIT(NL80211_BSS_SELECT_ATTR_BAND_PREF) |
76607681
BIT(NL80211_BSS_SELECT_ATTR_RSSI_ADJUST);
76617682

7683+
wiphy->bss_param_support = WIPHY_BSS_PARAM_AP_ISOLATE;
7684+
76627685
wiphy->flags |= WIPHY_FLAG_NETNS_OK |
76637686
WIPHY_FLAG_PS_ON_BY_DEFAULT |
76647687
WIPHY_FLAG_HAVE_AP_SME |

0 commit comments

Comments
 (0)