diff options
author | Daniel Drake <dsd@gentoo.org> | 2007-07-27 09:43:24 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:47:39 -0400 |
commit | d9430a32886f70c0c16d67c525f6cda2df7906ee (patch) | |
tree | 9d531b23206e62033a6bb9d03ac572ce6ab4c7f1 /net/mac80211/ieee80211_sta.c | |
parent | 7e9ed18874f0df84b6651f0636e1cfdac43bc610 (diff) |
[MAC80211]: implement ERP info change notifications
zd1211rw and bcm43xx are interested in being notified when ERP IE conditions
change, so that they can reprogram a register which affects how control frames
are transmitted.
This patch adds an interface similar to the one that can be found in softmac.
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 0f5f8131bd71..33414f160538 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -319,6 +319,7 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
319 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 319 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
320 | int use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; | 320 | int use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; |
321 | int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; | 321 | int preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; |
322 | u8 changes = 0; | ||
322 | 323 | ||
323 | if (use_protection != sdata->use_protection) { | 324 | if (use_protection != sdata->use_protection) { |
324 | if (net_ratelimit()) { | 325 | if (net_ratelimit()) { |
@@ -329,6 +330,7 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
329 | MAC_ARG(ifsta->bssid)); | 330 | MAC_ARG(ifsta->bssid)); |
330 | } | 331 | } |
331 | sdata->use_protection = use_protection; | 332 | sdata->use_protection = use_protection; |
333 | changes |= IEEE80211_ERP_CHANGE_PROTECTION; | ||
332 | } | 334 | } |
333 | 335 | ||
334 | if (!preamble_mode != sdata->short_preamble) { | 336 | if (!preamble_mode != sdata->short_preamble) { |
@@ -341,7 +343,11 @@ static void ieee80211_handle_erp_ie(struct net_device *dev, u8 erp_value) | |||
341 | MAC_ARG(ifsta->bssid)); | 343 | MAC_ARG(ifsta->bssid)); |
342 | } | 344 | } |
343 | sdata->short_preamble = !preamble_mode; | 345 | sdata->short_preamble = !preamble_mode; |
346 | changes |= IEEE80211_ERP_CHANGE_PREAMBLE; | ||
344 | } | 347 | } |
348 | |||
349 | if (changes) | ||
350 | ieee80211_erp_info_change_notify(dev, changes); | ||
345 | } | 351 | } |
346 | 352 | ||
347 | 353 | ||
@@ -400,7 +406,6 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
400 | struct ieee80211_if_sta *ifsta, int assoc) | 406 | struct ieee80211_if_sta *ifsta, int assoc) |
401 | { | 407 | { |
402 | union iwreq_data wrqu; | 408 | union iwreq_data wrqu; |
403 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
404 | 409 | ||
405 | if (ifsta->associated == assoc) | 410 | if (ifsta->associated == assoc) |
406 | return; | 411 | return; |
@@ -428,8 +433,7 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
428 | ieee80211_sta_send_associnfo(dev, ifsta); | 433 | ieee80211_sta_send_associnfo(dev, ifsta); |
429 | } else { | 434 | } else { |
430 | netif_carrier_off(dev); | 435 | netif_carrier_off(dev); |
431 | sdata->short_preamble = 0; | 436 | ieee80211_reset_erp_info(dev); |
432 | sdata->use_protection = 0; | ||
433 | memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); | 437 | memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); |
434 | } | 438 | } |
435 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 439 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |