aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-18 12:45:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:42 -0500
commit77965c970d7da9c9b6349ff2b1d9adecf54c403b (patch)
treebda8a85fa872a46d5cb5c48891cf3ee21c91e838 /net/wireless/scan.c
parent630e64c487c0a9550f05b465216a1cd9125b52f2 (diff)
cfg80211: clean up signal type
It wasn't a good idea to make the signal type a per-BSS option, although then it is closer to the actual value. Move it to be a per-wiphy setting, update mac80211 to match. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 01c136d98c5b..60600657b657 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -370,7 +370,6 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
370 found->pub.beacon_interval = res->pub.beacon_interval; 370 found->pub.beacon_interval = res->pub.beacon_interval;
371 found->pub.tsf = res->pub.tsf; 371 found->pub.tsf = res->pub.tsf;
372 found->pub.signal = res->pub.signal; 372 found->pub.signal = res->pub.signal;
373 found->pub.signal_type = res->pub.signal_type;
374 found->pub.capability = res->pub.capability; 373 found->pub.capability = res->pub.capability;
375 found->ts = res->ts; 374 found->ts = res->ts;
376 kref_put(&res->ref, bss_release); 375 kref_put(&res->ref, bss_release);
@@ -392,8 +391,7 @@ struct cfg80211_bss *
392cfg80211_inform_bss_frame(struct wiphy *wiphy, 391cfg80211_inform_bss_frame(struct wiphy *wiphy,
393 struct ieee80211_channel *channel, 392 struct ieee80211_channel *channel,
394 struct ieee80211_mgmt *mgmt, size_t len, 393 struct ieee80211_mgmt *mgmt, size_t len,
395 s32 signal, enum cfg80211_signal_type sigtype, 394 s32 signal, gfp_t gfp)
396 gfp_t gfp)
397{ 395{
398 struct cfg80211_internal_bss *res; 396 struct cfg80211_internal_bss *res;
399 size_t ielen = len - offsetof(struct ieee80211_mgmt, 397 size_t ielen = len - offsetof(struct ieee80211_mgmt,
@@ -401,7 +399,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
401 bool overwrite; 399 bool overwrite;
402 size_t privsz = wiphy->bss_priv_size; 400 size_t privsz = wiphy->bss_priv_size;
403 401
404 if (WARN_ON(sigtype == NL80211_BSS_SIGNAL_UNSPEC && 402 if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC &&
405 (signal < 0 || signal > 100))) 403 (signal < 0 || signal > 100)))
406 return NULL; 404 return NULL;
407 405
@@ -415,7 +413,6 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
415 413
416 memcpy(res->pub.bssid, mgmt->bssid, ETH_ALEN); 414 memcpy(res->pub.bssid, mgmt->bssid, ETH_ALEN);
417 res->pub.channel = channel; 415 res->pub.channel = channel;
418 res->pub.signal_type = sigtype;
419 res->pub.signal = signal; 416 res->pub.signal = signal;
420 res->pub.tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp); 417 res->pub.tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp);
421 res->pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int); 418 res->pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int);
@@ -607,9 +604,9 @@ static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
607} 604}
608 605
609static char * 606static char *
610ieee80211_bss(struct iw_request_info *info, 607ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
611 struct cfg80211_internal_bss *bss, 608 struct cfg80211_internal_bss *bss, char *current_ev,
612 char *current_ev, char *end_buf) 609 char *end_buf)
613{ 610{
614 struct iw_event iwe; 611 struct iw_event iwe;
615 u8 *buf, *cfg, *p; 612 u8 *buf, *cfg, *p;
@@ -638,13 +635,13 @@ ieee80211_bss(struct iw_request_info *info,
638 current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, 635 current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe,
639 IW_EV_FREQ_LEN); 636 IW_EV_FREQ_LEN);
640 637
641 if (bss->pub.signal_type != CFG80211_SIGNAL_TYPE_NONE) { 638 if (wiphy->signal_type != CFG80211_SIGNAL_TYPE_NONE) {
642 memset(&iwe, 0, sizeof(iwe)); 639 memset(&iwe, 0, sizeof(iwe));
643 iwe.cmd = IWEVQUAL; 640 iwe.cmd = IWEVQUAL;
644 iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED | 641 iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED |
645 IW_QUAL_NOISE_INVALID | 642 IW_QUAL_NOISE_INVALID |
646 IW_QUAL_QUAL_UPDATED; 643 IW_QUAL_QUAL_UPDATED;
647 switch (bss->pub.signal_type) { 644 switch (wiphy->signal_type) {
648 case CFG80211_SIGNAL_TYPE_MBM: 645 case CFG80211_SIGNAL_TYPE_MBM:
649 sig = bss->pub.signal / 100; 646 sig = bss->pub.signal / 100;
650 iwe.u.qual.level = sig; 647 iwe.u.qual.level = sig;
@@ -823,8 +820,8 @@ static int ieee80211_scan_results(struct cfg80211_registered_device *dev,
823 spin_unlock_bh(&dev->bss_lock); 820 spin_unlock_bh(&dev->bss_lock);
824 return -E2BIG; 821 return -E2BIG;
825 } 822 }
826 current_ev = ieee80211_bss(info, bss, 823 current_ev = ieee80211_bss(&dev->wiphy, info, bss,
827 current_ev, end_buf); 824 current_ev, end_buf);
828 } 825 }
829 spin_unlock_bh(&dev->bss_lock); 826 spin_unlock_bh(&dev->bss_lock);
830 return current_ev - buf; 827 return current_ev - buf;