aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-07-30 20:38:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:19 -0400
commit8b19e6ca3bac7e04e93fb73f561d670e77c5fae6 (patch)
tree50a1487febe99b670aab253c4eebee2b8b3c8268 /net/wireless/sme.c
parentabc7381bcca6ce9dc101f112a13e14957bfbda7e (diff)
cfg80211: enable country IE support to all cfg80211 drivers
Since the bss is always set now once we are connected, if the bss has its own information element we refer to it and pass that instead of relying on mac80211's parsing. Now all cfg80211 drivers get country IE support, automatically and we reduce the call overhead that we had on mac80211 which called this upon every beacon and instead now call this only upon a successfull connection by a STA on cfg80211. Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 3728d2b88b25..af91192eedf5 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -13,6 +13,7 @@
13#include <net/cfg80211.h> 13#include <net/cfg80211.h>
14#include <net/rtnetlink.h> 14#include <net/rtnetlink.h>
15#include "nl80211.h" 15#include "nl80211.h"
16#include "reg.h"
16 17
17struct cfg80211_conn { 18struct cfg80211_conn {
18 struct cfg80211_connect_params params; 19 struct cfg80211_connect_params params;
@@ -320,6 +321,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
320 struct cfg80211_bss *bss) 321 struct cfg80211_bss *bss)
321{ 322{
322 struct wireless_dev *wdev = dev->ieee80211_ptr; 323 struct wireless_dev *wdev = dev->ieee80211_ptr;
324 u8 *country_ie;
323#ifdef CONFIG_WIRELESS_EXT 325#ifdef CONFIG_WIRELESS_EXT
324 union iwreq_data wrqu; 326 union iwreq_data wrqu;
325#endif 327#endif
@@ -401,6 +403,20 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
401 403
402 wdev->sme_state = CFG80211_SME_CONNECTED; 404 wdev->sme_state = CFG80211_SME_CONNECTED;
403 cfg80211_upload_connect_keys(wdev); 405 cfg80211_upload_connect_keys(wdev);
406
407 country_ie = (u8 *) ieee80211_bss_get_ie(bss, WLAN_EID_COUNTRY);
408
409 if (!country_ie)
410 return;
411
412 /*
413 * ieee80211_bss_get_ie() ensures we can access:
414 * - country_ie + 2, the start of the country ie data, and
415 * - and country_ie[1] which is the IE length
416 */
417 regulatory_hint_11d(wdev->wiphy,
418 country_ie + 2,
419 country_ie[1]);
404} 420}
405 421
406void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, 422void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,