summaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_sta.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-07-10 19:32:11 +0200
committerJohn W. Linville <linville@tuxdriver.com>2007-07-12 16:07:26 -0400
commit63fc33ceb0ccc08b3f62d7bfe56a33eb33ca9427 (patch)
tree6fb60af08616b2f4065cdd74b83f43c819f1853c /net/mac80211/ieee80211_sta.c
parent5628221caf88e2a052782b042e12da7cd34111b0 (diff)
downloadlinux-63fc33ceb0ccc08b3f62d7bfe56a33eb33ca9427.tar.gz
linux-63fc33ceb0ccc08b3f62d7bfe56a33eb33ca9427.tar.bz2
linux-63fc33ceb0ccc08b3f62d7bfe56a33eb33ca9427.zip
[PATCH] mac80211: improved 802.11g CTS protection
Currently, CTS protection is partially implemented twice: 1. via prism2 ioctls, only used by hostapd 2. via STA beacon parsing, recorded in sta.use_protection but never used (other than printed in debugfs) Protection control should be implemented on a per-subif basis. For example, a single physical device may be running a soft AP on one channel, and a STA on another. The AP interface should use protection based on what hostapd told it, and the STA interface should use protection based on beacon parsing. These should operate independantly: one subif using protection should not influence the other. To implement this, I moved the use_protection flag into ieee80211_sub_if_data and removed the device-global cts_protect_erp_frames flag. I also made the PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES write operation only available for AP interfaces, to avoid any possibility of the user messing with the behaviour of a STA. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_sta.c')
-rw-r--r--net/mac80211/ieee80211_sta.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index df6c410de161..ba2bf8f0a347 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -316,12 +316,11 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value)
{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_if_sta *ifsta = &sdata->u.sta;
int use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
- if (use_protection != !!ifsta->use_protection) {
+ if (use_protection != sdata->use_protection) {
if (net_ratelimit()) {
printk(KERN_DEBUG "%s: CTS protection %s (BSSID="
MAC_FMT ")\n",
@@ -329,8 +328,7 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value)
use_protection ? "enabled" : "disabled",
MAC_ARG(ifsta->bssid));
}
- ifsta->use_protection = use_protection ? 1 : 0;
- local->cts_protect_erp_frames = use_protection;
+ sdata->use_protection = use_protection;
}
}
@@ -390,6 +388,7 @@ static void ieee80211_set_associated(struct net_device *dev,
struct ieee80211_if_sta *ifsta, int assoc)
{
union iwreq_data wrqu;
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
if (ifsta->associated == assoc)
return;
@@ -417,6 +416,7 @@ static void ieee80211_set_associated(struct net_device *dev,
ieee80211_sta_send_associnfo(dev, ifsta);
} else {
netif_carrier_off(dev);
+ sdata->use_protection = 0;
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
}
wrqu.ap_addr.sa_family = ARPHRD_ETHER;