aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.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 /drivers/net/wireless/iwlwifi/iwl-4965.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 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index b7036e011457..45cbd7789bd0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2362,7 +2362,7 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
2362 struct ieee80211_rx_status *stats, 2362 struct ieee80211_rx_status *stats,
2363 u32 ampdu_status) 2363 u32 ampdu_status)
2364{ 2364{
2365 s8 signal = stats->ssi; 2365 s8 signal = stats->signal;
2366 s8 noise = 0; 2366 s8 noise = 0;
2367 int rate = stats->rate_idx; 2367 int rate = stats->rate_idx;
2368 u64 tsf = stats->mactime; 2368 u64 tsf = stats->mactime;
@@ -2963,7 +2963,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
2963 priv->ucode_beacon_time = le32_to_cpu(rx_start->beacon_time_stamp); 2963 priv->ucode_beacon_time = le32_to_cpu(rx_start->beacon_time_stamp);
2964 2964
2965 /* Find max signal strength (dBm) among 3 antenna/receiver chains */ 2965 /* Find max signal strength (dBm) among 3 antenna/receiver chains */
2966 rx_status.ssi = iwl4965_calc_rssi(priv, rx_start); 2966 rx_status.signal = iwl4965_calc_rssi(priv, rx_start);
2967 2967
2968 /* Meaningful noise values are available only from beacon statistics, 2968 /* Meaningful noise values are available only from beacon statistics,
2969 * which are gathered only when associated, and indicate noise 2969 * which are gathered only when associated, and indicate noise
@@ -2972,11 +2972,11 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
2972 if (iwl_is_associated(priv) && 2972 if (iwl_is_associated(priv) &&
2973 !test_bit(STATUS_SCANNING, &priv->status)) { 2973 !test_bit(STATUS_SCANNING, &priv->status)) {
2974 rx_status.noise = priv->last_rx_noise; 2974 rx_status.noise = priv->last_rx_noise;
2975 rx_status.signal = iwl4965_calc_sig_qual(rx_status.ssi, 2975 rx_status.qual = iwl4965_calc_sig_qual(rx_status.signal,
2976 rx_status.noise); 2976 rx_status.noise);
2977 } else { 2977 } else {
2978 rx_status.noise = IWL_NOISE_MEAS_NOT_AVAILABLE; 2978 rx_status.noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
2979 rx_status.signal = iwl4965_calc_sig_qual(rx_status.ssi, 0); 2979 rx_status.qual = iwl4965_calc_sig_qual(rx_status.signal, 0);
2980 } 2980 }
2981 2981
2982 /* Reset beacon noise level if not associated. */ 2982 /* Reset beacon noise level if not associated. */
@@ -2988,7 +2988,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
2988 iwl4965_dbg_report_frame(priv, pkt, header, 1); 2988 iwl4965_dbg_report_frame(priv, pkt, header, 1);
2989 2989
2990 IWL_DEBUG_STATS_LIMIT("Rssi %d, noise %d, qual %d, TSF %llu\n", 2990 IWL_DEBUG_STATS_LIMIT("Rssi %d, noise %d, qual %d, TSF %llu\n",
2991 rx_status.ssi, rx_status.noise, rx_status.signal, 2991 rx_status.signal, rx_status.noise, rx_status.signal,
2992 (unsigned long long)rx_status.mactime); 2992 (unsigned long long)rx_status.mactime);
2993 2993
2994 2994
@@ -3000,7 +3000,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
3000 3000
3001 network_packet = iwl4965_is_network_packet(priv, header); 3001 network_packet = iwl4965_is_network_packet(priv, header);
3002 if (network_packet) { 3002 if (network_packet) {
3003 priv->last_rx_rssi = rx_status.ssi; 3003 priv->last_rx_rssi = rx_status.signal;
3004 priv->last_beacon_time = priv->ucode_beacon_time; 3004 priv->last_beacon_time = priv->ucode_beacon_time;
3005 priv->last_tsf = le64_to_cpu(rx_start->timestamp); 3005 priv->last_tsf = le64_to_cpu(rx_start->timestamp);
3006 } 3006 }