diff options
author | Mohammed Shafi Shajakhan <mshajakhan@atheros.com> | 2011-05-13 11:01:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:47 -0400 |
commit | 21e8ee6d207f6d384689571101436eb9070c22ca (patch) | |
tree | 74a9248670c1a5347d8ec58b6bc3c7703e94f4c7 /drivers/net/wireless/ath | |
parent | 3e9a212a9e21266115bad2982016950fb2bf29c2 (diff) |
ath9k: make sure main_rssi is positive
some times the rssi control descriptor for the main antenna may be
negative like that of alternate antenna, hence before incrementing
packet counts/rssi of main/alternate antenna make sure both main_rssi
and alt_rssi are positive only. this avoids wrong selection of antenna
due to diversity
Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 2fecfcb78106..4f52e0429f99 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1468,8 +1468,8 @@ static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) | |||
1468 | main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) & | 1468 | main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) & |
1469 | ATH_ANT_RX_MASK; | 1469 | ATH_ANT_RX_MASK; |
1470 | 1470 | ||
1471 | /* Record packet only when alt_rssi is positive */ | 1471 | /* Record packet only when both main_rssi and alt_rssi is positive */ |
1472 | if (alt_rssi > 0) { | 1472 | if (main_rssi > 0 && alt_rssi > 0) { |
1473 | antcomb->total_pkt_count++; | 1473 | antcomb->total_pkt_count++; |
1474 | antcomb->main_total_rssi += main_rssi; | 1474 | antcomb->main_total_rssi += main_rssi; |
1475 | antcomb->alt_total_rssi += alt_rssi; | 1475 | antcomb->alt_total_rssi += alt_rssi; |