aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2008-05-08 13:15:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:49 -0400
commit566bfe5a8bcde13188a356f77666f8115813cf31 (patch)
tree785412c505e9efbd0fac477d71c8ca6945ffce04 /net/mac80211/mlme.c
parentfac371d9f09f461dfe9fbbceb2a38e2e12164dda (diff)
mac80211: use hardware flags for signal/noise units
trying to clean up the signal/noise code. the previous code in mac80211 had confusing names for the related variables, did not have much definition of what units of signal and noise were provided and used implicit mechanisms from the wireless extensions. this patch introduces hardware capability flags to let the hardware specify clearly if it can provide signal and noise level values and which units it can provide. this also anticipates possible new units like RCPI in the future. for signal: IEEE80211_HW_SIGNAL_UNSPEC - unspecified, unknown, hw specific IEEE80211_HW_SIGNAL_DB - dB difference to unspecified reference point IEEE80211_HW_SIGNAL_DBM - dBm, difference to 1mW for noise we currently only have dBm: IEEE80211_HW_NOISE_DBM - dBm, difference to 1mW if IEEE80211_HW_SIGNAL_UNSPEC or IEEE80211_HW_SIGNAL_DB is used the driver has to provide the maximum value (max_signal) it reports in order for applications to make sense of the signal values. i tried my best to find out for each driver what it can provide and update it but i'm not sure (?) for some of them and used the more conservative guess in doubt. this can be fixed easily after this patch has been merged by changing the hardware flags of the driver. DRIVER SIGNAL MAX NOISE QUAL ----------------------------------------------------------------- adm8211 unspec(?) 100 n/a missing at76_usb unspec(?) (?) unused missing ath5k dBm dBm percent rssi b43legacy dBm dBm percent jssi(?) b43 dBm dBm percent jssi(?) iwl-3945 dBm dBm percent snr+more iwl-4965 dBm dBm percent snr+more p54 unspec 127 n/a missing rt2x00 dBm n/a percent rssi+tx/rx frame success rt2400 dBm n/a rt2500pci dBm n/a rt2500usb dBm n/a rt61pci dBm n/a rt73usb dBm n/a rtl8180 unspec(?) 65 n/a (?) rtl8187 unspec(?) 65 (?) noise(?) zd1211 dB(?) 100 n/a percent drivers/net/wireless/ath5k/base.c: Changes-licensed-under: 3-Clause-BSD Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6c4b27be35da..dda30e98aa1e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1959,8 +1959,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1959 local->hw.conf.channel->center_freq, 1959 local->hw.conf.channel->center_freq,
1960 ifsta->ssid, ifsta->ssid_len); 1960 ifsta->ssid, ifsta->ssid_len);
1961 if (bss) { 1961 if (bss) {
1962 sta->last_rssi = bss->rssi;
1963 sta->last_signal = bss->signal; 1962 sta->last_signal = bss->signal;
1963 sta->last_qual = bss->qual;
1964 sta->last_noise = bss->noise; 1964 sta->last_noise = bss->noise;
1965 ieee80211_rx_bss_put(dev, bss); 1965 ieee80211_rx_bss_put(dev, bss);
1966 } 1966 }
@@ -2629,9 +2629,9 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
2629 2629
2630 bss->timestamp = beacon_timestamp; 2630 bss->timestamp = beacon_timestamp;
2631 bss->last_update = jiffies; 2631 bss->last_update = jiffies;
2632 bss->rssi = rx_status->ssi;
2633 bss->signal = rx_status->signal; 2632 bss->signal = rx_status->signal;
2634 bss->noise = rx_status->noise; 2633 bss->noise = rx_status->noise;
2634 bss->qual = rx_status->qual;
2635 if (!beacon && !bss->probe_resp) 2635 if (!beacon && !bss->probe_resp)
2636 bss->probe_resp = true; 2636 bss->probe_resp = true;
2637 2637
@@ -3427,9 +3427,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3427 !ieee80211_sta_match_ssid(ifsta, bss->ssid, bss->ssid_len)) 3427 !ieee80211_sta_match_ssid(ifsta, bss->ssid, bss->ssid_len))
3428 continue; 3428 continue;
3429 3429
3430 if (!selected || top_rssi < bss->rssi) { 3430 if (!selected || top_rssi < bss->signal) {
3431 selected = bss; 3431 selected = bss;
3432 top_rssi = bss->rssi; 3432 top_rssi = bss->signal;
3433 } 3433 }
3434 } 3434 }
3435 if (selected) 3435 if (selected)
@@ -4060,8 +4060,8 @@ ieee80211_sta_scan_result(struct net_device *dev,
4060 4060
4061 memset(&iwe, 0, sizeof(iwe)); 4061 memset(&iwe, 0, sizeof(iwe));
4062 iwe.cmd = IWEVQUAL; 4062 iwe.cmd = IWEVQUAL;
4063 iwe.u.qual.qual = bss->signal; 4063 iwe.u.qual.qual = bss->qual;
4064 iwe.u.qual.level = bss->rssi; 4064 iwe.u.qual.level = bss->signal;
4065 iwe.u.qual.noise = bss->noise; 4065 iwe.u.qual.noise = bss->noise;
4066 iwe.u.qual.updated = local->wstats_flags; 4066 iwe.u.qual.updated = local->wstats_flags;
4067 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4067 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,