summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-18 18:45:06 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:42 -0500
commit77965c970d7da9c9b6349ff2b1d9adecf54c403b (patch)
treebda8a85fa872a46d5cb5c48891cf3ee21c91e838 /net/mac80211
parent630e64c487c0a9550f05b465216a1cd9125b52f2 (diff)
downloadlinux-77965c970d7da9c9b6349ff2b1d9adecf54c403b.tar.bz2
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/mac80211')
-rw-r--r--net/mac80211/main.c5
-rw-r--r--net/mac80211/scan.c11
2 files changed, 8 insertions, 8 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index fce9d08986e9..f38db4d37e5d 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -861,6 +861,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
/* mac80211 always supports monitor */
local->hw.wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR);
+ if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
+ local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+ else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
+ local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
+
result = wiphy_register(local->hw.wiphy);
if (result < 0)
goto fail_wiphy_register;
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index c063f8204263..23f4de274744 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -63,20 +63,15 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
{
struct ieee80211_bss *bss;
int clen;
- enum cfg80211_signal_type sigtype = CFG80211_SIGNAL_TYPE_NONE;
s32 signal = 0;
- if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
- sigtype = CFG80211_SIGNAL_TYPE_MBM;
+ if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
signal = rx_status->signal * 100;
- } else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) {
- sigtype = CFG80211_SIGNAL_TYPE_UNSPEC;
+ else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
signal = (rx_status->signal * 100) / local->hw.max_signal;
- }
bss = (void *)cfg80211_inform_bss_frame(local->hw.wiphy, channel,
- mgmt, len, signal, sigtype,
- GFP_ATOMIC);
+ mgmt, len, signal, GFP_ATOMIC);
if (!bss)
return NULL;