Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171701
b: refs/heads/master
c: 21b2273
h: refs/heads/master
i:
  171699: 0b1c49a
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 11, 2009
1 parent f4d08ad commit d4bd113
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9878841e1360266fa4522fbdc2448fcdce95e0dd
refs/heads/master: 21b22738068366d7740b4b7cf55ce270f479543a
74 changes: 42 additions & 32 deletions trunk/drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,47 @@ static u8 ath9k_process_rate(struct ath_common *common,
return 0;
}

/*
* Theory for reporting quality:
*
* At a hardware RSSI of 45 you will be able to use MCS 7 reliably.
* At a hardware RSSI of 45 you will be able to use MCS 15 reliably.
* At a hardware RSSI of 35 you should be able use 54 Mbps reliably.
*
* MCS 7 is the highets MCS index usable by a 1-stream device.
* MCS 15 is the highest MCS index usable by a 2-stream device.
*
* All ath9k devices are either 1-stream or 2-stream.
*
* How many bars you see is derived from the qual reporting.
*
* A more elaborate scheme can be used here but it requires tables
* of SNR/throughput for each possible mode used. For the MCS table
* you can refer to the wireless wiki:
*
* http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
*
*/
static int ath9k_compute_qual(struct ieee80211_hw *hw,
struct ath_rx_status *rx_stats)
{
int qual;

if (conf_is_ht(&hw->conf))
qual = rx_stats->rs_rssi * 100 / 45;
else
qual = rx_stats->rs_rssi * 100 / 35;

/*
* rssi can be more than 45 though, anything above that
* should be considered at 100%
*/
if (qual > 100)
qual = 100;

return qual;
}

/*
* For Decrypt or Demic errors, we only mark packet status here and always push
* up the frame up to let mac80211 handle the actual error case, be it no
Expand Down Expand Up @@ -247,38 +288,7 @@ static int ath_rx_prepare(struct ath_common *common,
rx_status->noise = common->ani.noise_floor;
rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
rx_status->antenna = rx_stats->rs_antenna;

/*
* Theory for reporting quality:
*
* At a hardware RSSI of 45 you will be able to use MCS 7 reliably.
* At a hardware RSSI of 45 you will be able to use MCS 15 reliably.
* At a hardware RSSI of 35 you should be able use 54 Mbps reliably.
*
* MCS 7 is the highets MCS index usable by a 1-stream device.
* MCS 15 is the highest MCS index usable by a 2-stream device.
*
* All ath9k devices are either 1-stream or 2-stream.
*
* How many bars you see is derived from the qual reporting.
*
* A more elaborate scheme can be used here but it requires tables
* of SNR/throughput for each possible mode used. For the MCS table
* you can refer to the wireless wiki:
*
* http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
*
*/
if (conf_is_ht(&hw->conf))
rx_status->qual = rx_stats->rs_rssi * 100 / 45;
else
rx_status->qual = rx_stats->rs_rssi * 100 / 35;

/* rssi can be more than 45 though, anything above that
* should be considered at 100% */
if (rx_status->qual > 100)
rx_status->qual = 100;

rx_status->qual = ath9k_compute_qual(hw, rx_stats);
rx_status->flag |= RX_FLAG_TSFT;

return 1;
Expand Down

0 comments on commit d4bd113

Please sign in to comment.