aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw
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/zd1211rw
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/zd1211rw')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index ee4331229f1f..0c736735e217 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -638,7 +638,7 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
638 638
639 memset(&status, 0, sizeof(status)); 639 memset(&status, 0, sizeof(status));
640 status.flags = IEEE80211_TX_STATUS_ACK; 640 status.flags = IEEE80211_TX_STATUS_ACK;
641 status.ack_signal = stats->ssi; 641 status.ack_signal = stats->signal;
642 __skb_unlink(skb, q); 642 __skb_unlink(skb, q);
643 tx_status(hw, skb, &status, 1); 643 tx_status(hw, skb, &status, 1);
644 goto out; 644 goto out;
@@ -691,8 +691,8 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
691 691
692 stats.freq = zd_channels[_zd_chip_get_channel(&mac->chip) - 1].center_freq; 692 stats.freq = zd_channels[_zd_chip_get_channel(&mac->chip) - 1].center_freq;
693 stats.band = IEEE80211_BAND_2GHZ; 693 stats.band = IEEE80211_BAND_2GHZ;
694 stats.ssi = status->signal_strength; 694 stats.signal = status->signal_strength;
695 stats.signal = zd_rx_qual_percent(buffer, 695 stats.qual = zd_rx_qual_percent(buffer,
696 length - sizeof(struct rx_status), 696 length - sizeof(struct rx_status),
697 status); 697 status);
698 698
@@ -997,10 +997,10 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
997 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band; 997 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band;
998 998
999 hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | 999 hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
1000 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE; 1000 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
1001 hw->max_rssi = 100; 1001 IEEE80211_HW_SIGNAL_DB;
1002 hw->max_signal = 100;
1003 1002
1003 hw->max_signal = 100;
1004 hw->queues = 1; 1004 hw->queues = 1;
1005 hw->extra_tx_headroom = sizeof(struct zd_ctrlset); 1005 hw->extra_tx_headroom = sizeof(struct zd_ctrlset);
1006 1006