diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2015-03-08 09:42:03 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-03-13 09:17:35 -0400 |
commit | 02beaf1a5b8f05ead295d781522b1684dc5e7263 (patch) | |
tree | d1dae7da415c6e09a97a0df4125c21230baf9154 | |
parent | c42da9993a4cc32f48dad89eedf7b7ad4dfd41bc (diff) |
wil6210: support AP isolation
For the AP, configuration may say not to bridge traffic between
wireless clients. This is conveyed from user space (ex: hostapd has
ap_isolate parameter) with NL80211_CMD_SET_BSS, to the driver's
cfg80211 ops method change_bss
Add support for this setting.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 1 |
5 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 4bd708c8716c..5db6a6dc691e 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -917,6 +917,21 @@ static int wil_cfg80211_probe_client(struct wiphy *wiphy, | |||
917 | return 0; | 917 | return 0; |
918 | } | 918 | } |
919 | 919 | ||
920 | static int wil_cfg80211_change_bss(struct wiphy *wiphy, | ||
921 | struct net_device *dev, | ||
922 | struct bss_parameters *params) | ||
923 | { | ||
924 | struct wil6210_priv *wil = wiphy_to_wil(wiphy); | ||
925 | |||
926 | if (params->ap_isolate >= 0) { | ||
927 | wil_dbg_misc(wil, "%s(ap_isolate %d => %d)\n", __func__, | ||
928 | wil->ap_isolate, params->ap_isolate); | ||
929 | wil->ap_isolate = params->ap_isolate; | ||
930 | } | ||
931 | |||
932 | return 0; | ||
933 | } | ||
934 | |||
920 | static struct cfg80211_ops wil_cfg80211_ops = { | 935 | static struct cfg80211_ops wil_cfg80211_ops = { |
921 | .scan = wil_cfg80211_scan, | 936 | .scan = wil_cfg80211_scan, |
922 | .connect = wil_cfg80211_connect, | 937 | .connect = wil_cfg80211_connect, |
@@ -937,6 +952,7 @@ static struct cfg80211_ops wil_cfg80211_ops = { | |||
937 | .stop_ap = wil_cfg80211_stop_ap, | 952 | .stop_ap = wil_cfg80211_stop_ap, |
938 | .del_station = wil_cfg80211_del_station, | 953 | .del_station = wil_cfg80211_del_station, |
939 | .probe_client = wil_cfg80211_probe_client, | 954 | .probe_client = wil_cfg80211_probe_client, |
955 | .change_bss = wil_cfg80211_change_bss, | ||
940 | }; | 956 | }; |
941 | 957 | ||
942 | static void wil_wiphy_init(struct wiphy *wiphy) | 958 | static void wil_wiphy_init(struct wiphy *wiphy) |
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 3830cc20d4fa..a42cb89ff725 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -1405,6 +1405,7 @@ static const struct dbg_off dbg_wil_off[] = { | |||
1405 | WIL_FIELD(fw_version, S_IRUGO, doff_u32), | 1405 | WIL_FIELD(fw_version, S_IRUGO, doff_u32), |
1406 | WIL_FIELD(hw_version, S_IRUGO, doff_x32), | 1406 | WIL_FIELD(hw_version, S_IRUGO, doff_x32), |
1407 | WIL_FIELD(recovery_count, S_IRUGO, doff_u32), | 1407 | WIL_FIELD(recovery_count, S_IRUGO, doff_u32), |
1408 | WIL_FIELD(ap_isolate, S_IRUGO, doff_u32), | ||
1408 | {}, | 1409 | {}, |
1409 | }; | 1410 | }; |
1410 | 1411 | ||
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index db74e811f5c4..afff8d33c562 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -714,6 +714,7 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw) | |||
714 | 714 | ||
715 | /* init after reset */ | 715 | /* init after reset */ |
716 | wil->pending_connect_cid = -1; | 716 | wil->pending_connect_cid = -1; |
717 | wil->ap_isolate = 0; | ||
717 | reinit_completion(&wil->wmi_ready); | 718 | reinit_completion(&wil->wmi_ready); |
718 | reinit_completion(&wil->wmi_call); | 719 | reinit_completion(&wil->wmi_call); |
719 | 720 | ||
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 08d3cac4f004..689081c2c37b 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
@@ -515,7 +515,7 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev) | |||
515 | 515 | ||
516 | skb_orphan(skb); | 516 | skb_orphan(skb); |
517 | 517 | ||
518 | if (wdev->iftype == NL80211_IFTYPE_AP) { | 518 | if (wdev->iftype == NL80211_IFTYPE_AP && !wil->ap_isolate) { |
519 | if (mcast) { | 519 | if (mcast) { |
520 | /* send multicast frames both to higher layers in | 520 | /* send multicast frames both to higher layers in |
521 | * local net stack and back to the wireless medium | 521 | * local net stack and back to the wireless medium |
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index b6e65c37d410..c1a71ab75a0e 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -542,6 +542,7 @@ struct wil6210_priv { | |||
542 | u32 monitor_flags; | 542 | u32 monitor_flags; |
543 | u32 privacy; /* secure connection? */ | 543 | u32 privacy; /* secure connection? */ |
544 | int sinfo_gen; | 544 | int sinfo_gen; |
545 | u32 ap_isolate; /* no intra-BSS communication */ | ||
545 | /* interrupt moderation */ | 546 | /* interrupt moderation */ |
546 | u32 tx_max_burst_duration; | 547 | u32 tx_max_burst_duration; |
547 | u32 tx_interframe_timeout; | 548 | u32 tx_interframe_timeout; |