aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
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 /include/net/mac80211.h
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 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h47
1 files changed, 34 insertions, 13 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 75a34609eed7..909956c97c44 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -336,13 +336,16 @@ enum mac80211_rx_flags {
336 * The low-level driver should provide this information (the subset 336 * The low-level driver should provide this information (the subset
337 * supported by hardware) to the 802.11 code with each received 337 * supported by hardware) to the 802.11 code with each received
338 * frame. 338 * frame.
339 *
339 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 340 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
340 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 341 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
341 * @band: the active band when this frame was received 342 * @band: the active band when this frame was received
342 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 343 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
343 * @ssi: signal strength when receiving this frame 344 * @signal: signal strength when receiving this frame, either in dBm, in dB or
344 * @signal: used as 'qual' in statistics reporting 345 * unspecified depending on the hardware capabilities flags
345 * @noise: PHY noise when receiving this frame 346 * @IEEE80211_HW_SIGNAL_*
347 * @noise: noise when receiving this frame, in dBm.
348 * @qual: overall signal quality indication, in percent (0-100).
346 * @antenna: antenna used 349 * @antenna: antenna used
347 * @rate_idx: index of data rate into band's supported rates 350 * @rate_idx: index of data rate into band's supported rates
348 * @flag: %RX_FLAG_* 351 * @flag: %RX_FLAG_*
@@ -351,9 +354,9 @@ struct ieee80211_rx_status {
351 u64 mactime; 354 u64 mactime;
352 enum ieee80211_band band; 355 enum ieee80211_band band;
353 int freq; 356 int freq;
354 int ssi;
355 int signal; 357 int signal;
356 int noise; 358 int noise;
359 int qual;
357 int antenna; 360 int antenna;
358 int rate_idx; 361 int rate_idx;
359 int flag; 362 int flag;
@@ -392,7 +395,8 @@ enum ieee80211_tx_status_flags {
392 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 395 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
393 * @ampdu_ack_map: block ack bit map for the aggregation. 396 * @ampdu_ack_map: block ack bit map for the aggregation.
394 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 397 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
395 * @ack_signal: signal strength of the ACK frame 398 * @ack_signal: signal strength of the ACK frame either in dBm, dB or unspec
399 * depending on hardware capabilites flags @IEEE80211_HW_SIGNAL_*
396 */ 400 */
397struct ieee80211_tx_status { 401struct ieee80211_tx_status {
398 struct ieee80211_tx_control control; 402 struct ieee80211_tx_control control;
@@ -703,6 +707,25 @@ enum ieee80211_tkip_key_type {
703 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: 707 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
704 * Hardware is not capable of receiving frames with short preamble on 708 * Hardware is not capable of receiving frames with short preamble on
705 * the 2.4 GHz band. 709 * the 2.4 GHz band.
710 *
711 * @IEEE80211_HW_SIGNAL_UNSPEC:
712 * Hardware can provide signal values but we don't know its units. We
713 * expect values between 0 and @max_signal.
714 * If possible please provide dB or dBm instead.
715 *
716 * @IEEE80211_HW_SIGNAL_DB:
717 * Hardware gives signal values in dB, decibel difference from an
718 * arbitrary, fixed reference. We expect values between 0 and @max_signal.
719 * If possible please provide dBm instead.
720 *
721 * @IEEE80211_HW_SIGNAL_DBM:
722 * Hardware gives signal values in dBm, decibel difference from
723 * one milliwatt. This is the preferred method since it is standardized
724 * between different devices. @max_signal does not need to be set.
725 *
726 * @IEEE80211_HW_NOISE_DBM:
727 * Hardware can provide noise (radio interference) values in units dBm,
728 * decibel difference from one milliwatt.
706 */ 729 */
707enum ieee80211_hw_flags { 730enum ieee80211_hw_flags {
708 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 731 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
@@ -710,6 +733,10 @@ enum ieee80211_hw_flags {
710 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 733 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
711 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 734 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
712 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 735 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
736 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
737 IEEE80211_HW_SIGNAL_DB = 1<<6,
738 IEEE80211_HW_SIGNAL_DBM = 1<<7,
739 IEEE80211_HW_NOISE_DBM = 1<<8,
713}; 740};
714 741
715/** 742/**
@@ -740,12 +767,8 @@ enum ieee80211_hw_flags {
740 * 767 *
741 * @channel_change_time: time (in microseconds) it takes to change channels. 768 * @channel_change_time: time (in microseconds) it takes to change channels.
742 * 769 *
743 * @max_rssi: Maximum value for ssi in RX information, use 770 * @max_signal: Maximum value for signal (rssi) in RX information, used
744 * negative numbers for dBm and 0 to indicate no support. 771 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
745 *
746 * @max_signal: like @max_rssi, but for the signal value.
747 *
748 * @max_noise: like @max_rssi, but for the noise value.
749 * 772 *
750 * @queues: number of available hardware transmit queues for 773 * @queues: number of available hardware transmit queues for
751 * data packets. WMM/QoS requires at least four, these 774 * data packets. WMM/QoS requires at least four, these
@@ -775,9 +798,7 @@ struct ieee80211_hw {
775 int channel_change_time; 798 int channel_change_time;
776 int vif_data_size; 799 int vif_data_size;
777 u16 queues, ampdu_queues; 800 u16 queues, ampdu_queues;
778 s8 max_rssi;
779 s8 max_signal; 801 s8 max_signal;
780 s8 max_noise;
781}; 802};
782 803
783/** 804/**