2011-10-08 14:48:23 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/mac.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/mac.h
|
|
|
|
@@ -133,12 +133,8 @@ struct ath_rx_status {
|
|
|
|
u8 rs_rate;
|
|
|
|
u8 rs_antenna;
|
|
|
|
u8 rs_more;
|
|
|
|
- int8_t rs_rssi_ctl0;
|
|
|
|
- int8_t rs_rssi_ctl1;
|
|
|
|
- int8_t rs_rssi_ctl2;
|
|
|
|
- int8_t rs_rssi_ext0;
|
|
|
|
- int8_t rs_rssi_ext1;
|
|
|
|
- int8_t rs_rssi_ext2;
|
|
|
|
+ int8_t rs_rssi_ctl[3];
|
|
|
|
+ int8_t rs_rssi_ext[3];
|
|
|
|
u8 rs_isaggr;
|
2013-09-08 09:38:32 +00:00
|
|
|
u8 rs_firstaggr;
|
2011-10-08 14:48:23 +00:00
|
|
|
u8 rs_moreaggr;
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/recv.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/recv.c
|
2013-09-08 09:38:32 +00:00
|
|
|
@@ -892,6 +892,7 @@ static void ath9k_process_rssi(struct at
|
|
|
|
struct ath_hw *ah = common->ah;
|
|
|
|
int last_rssi;
|
|
|
|
int rssi = rx_stats->rs_rssi;
|
2011-10-08 14:48:23 +00:00
|
|
|
+ int i, j;
|
|
|
|
|
2013-09-08 09:38:32 +00:00
|
|
|
/*
|
|
|
|
* RSSI is not available for subframes in an A-MPDU.
|
|
|
|
@@ -910,6 +911,20 @@ static void ath9k_process_rssi(struct at
|
|
|
|
return;
|
|
|
|
}
|
2011-10-08 14:48:23 +00:00
|
|
|
|
|
|
|
+ for (i = 0, j = 0; i < ARRAY_SIZE(rx_stats->rs_rssi_ctl); i++) {
|
|
|
|
+ s8 rssi;
|
|
|
|
+
|
|
|
|
+ if (!(ah->rxchainmask & BIT(i)))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ rssi = rx_stats->rs_rssi_ctl[i];
|
|
|
|
+ if (rssi != ATH9K_RSSI_BAD) {
|
2013-09-08 09:38:32 +00:00
|
|
|
+ rxs->chains |= BIT(j);
|
|
|
|
+ rxs->chain_signal[j] = ah->noise + rssi;
|
2011-10-08 14:48:23 +00:00
|
|
|
+ }
|
|
|
|
+ j++;
|
|
|
|
+ }
|
|
|
|
+
|
2013-09-08 09:38:32 +00:00
|
|
|
/*
|
|
|
|
* Update Beacon RSSI, this is used by ANI.
|
|
|
|
*/
|
|
|
|
@@ -1000,7 +1015,7 @@ static int ath_process_fft(struct ath_so
|
2013-02-23 01:12:36 +00:00
|
|
|
fft_sample.tlv.length = __cpu_to_be16(length);
|
|
|
|
|
|
|
|
fft_sample.freq = __cpu_to_be16(ah->curchan->chan->center_freq);
|
|
|
|
- fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
|
|
|
|
+ fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]);
|
|
|
|
fft_sample.noise = ah->noise;
|
|
|
|
|
|
|
|
switch (len - SPECTRAL_HT20_TOTAL_DATA_LEN) {
|
2011-10-08 14:48:23 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
2013-06-15 20:14:06 +00:00
|
|
|
@@ -476,12 +476,12 @@ int ath9k_hw_process_rxdesc_edma(struct
|
2011-10-08 14:48:23 +00:00
|
|
|
|
|
|
|
/* XXX: Keycache */
|
|
|
|
rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined);
|
|
|
|
- rxs->rs_rssi_ctl0 = MS(rxsp->status1, AR_RxRSSIAnt00);
|
|
|
|
- rxs->rs_rssi_ctl1 = MS(rxsp->status1, AR_RxRSSIAnt01);
|
|
|
|
- rxs->rs_rssi_ctl2 = MS(rxsp->status1, AR_RxRSSIAnt02);
|
|
|
|
- rxs->rs_rssi_ext0 = MS(rxsp->status5, AR_RxRSSIAnt10);
|
|
|
|
- rxs->rs_rssi_ext1 = MS(rxsp->status5, AR_RxRSSIAnt11);
|
|
|
|
- rxs->rs_rssi_ext2 = MS(rxsp->status5, AR_RxRSSIAnt12);
|
|
|
|
+ rxs->rs_rssi_ctl[0] = MS(rxsp->status1, AR_RxRSSIAnt00);
|
|
|
|
+ rxs->rs_rssi_ctl[1] = MS(rxsp->status1, AR_RxRSSIAnt01);
|
|
|
|
+ rxs->rs_rssi_ctl[2] = MS(rxsp->status1, AR_RxRSSIAnt02);
|
|
|
|
+ rxs->rs_rssi_ext[0] = MS(rxsp->status5, AR_RxRSSIAnt10);
|
|
|
|
+ rxs->rs_rssi_ext[1] = MS(rxsp->status5, AR_RxRSSIAnt11);
|
|
|
|
+ rxs->rs_rssi_ext[2] = MS(rxsp->status5, AR_RxRSSIAnt12);
|
|
|
|
|
|
|
|
if (rxsp->status11 & AR_RxKeyIdxValid)
|
|
|
|
rxs->rs_keyix = MS(rxsp->status11, AR_KeyIdx);
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/mac.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/mac.c
|
2013-06-15 20:14:06 +00:00
|
|
|
@@ -554,25 +554,25 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
|
2011-10-08 14:48:23 +00:00
|
|
|
|
|
|
|
if (ads.ds_rxstatus8 & AR_PostDelimCRCErr) {
|
|
|
|
rs->rs_rssi = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ctl0 = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ctl1 = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ctl2 = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ext0 = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ext1 = ATH9K_RSSI_BAD;
|
|
|
|
- rs->rs_rssi_ext2 = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ctl[0] = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ctl[1] = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ctl[2] = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ext[0] = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ext[1] = ATH9K_RSSI_BAD;
|
|
|
|
+ rs->rs_rssi_ext[2] = ATH9K_RSSI_BAD;
|
|
|
|
} else {
|
|
|
|
rs->rs_rssi = MS(ads.ds_rxstatus4, AR_RxRSSICombined);
|
|
|
|
- rs->rs_rssi_ctl0 = MS(ads.ds_rxstatus0,
|
|
|
|
+ rs->rs_rssi_ctl[0] = MS(ads.ds_rxstatus0,
|
|
|
|
AR_RxRSSIAnt00);
|
|
|
|
- rs->rs_rssi_ctl1 = MS(ads.ds_rxstatus0,
|
|
|
|
+ rs->rs_rssi_ctl[1] = MS(ads.ds_rxstatus0,
|
|
|
|
AR_RxRSSIAnt01);
|
|
|
|
- rs->rs_rssi_ctl2 = MS(ads.ds_rxstatus0,
|
|
|
|
+ rs->rs_rssi_ctl[2] = MS(ads.ds_rxstatus0,
|
|
|
|
AR_RxRSSIAnt02);
|
|
|
|
- rs->rs_rssi_ext0 = MS(ads.ds_rxstatus4,
|
|
|
|
+ rs->rs_rssi_ext[0] = MS(ads.ds_rxstatus4,
|
|
|
|
AR_RxRSSIAnt10);
|
|
|
|
- rs->rs_rssi_ext1 = MS(ads.ds_rxstatus4,
|
|
|
|
+ rs->rs_rssi_ext[1] = MS(ads.ds_rxstatus4,
|
|
|
|
AR_RxRSSIAnt11);
|
|
|
|
- rs->rs_rssi_ext2 = MS(ads.ds_rxstatus4,
|
|
|
|
+ rs->rs_rssi_ext[2] = MS(ads.ds_rxstatus4,
|
|
|
|
AR_RxRSSIAnt12);
|
|
|
|
}
|
|
|
|
if (ads.ds_rxstatus8 & AR_RxKeyIdxValid)
|
2012-06-18 01:26:36 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/dfs.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/dfs.c
|
2013-06-15 20:14:06 +00:00
|
|
|
@@ -158,8 +158,8 @@ void ath9k_dfs_process_phyerr(struct ath
|
2012-06-18 01:26:36 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- ard.rssi = rs->rs_rssi_ctl0;
|
|
|
|
- ard.ext_rssi = rs->rs_rssi_ext0;
|
|
|
|
+ ard.rssi = rs->rs_rssi_ctl[0];
|
|
|
|
+ ard.ext_rssi = rs->rs_rssi_ext[0];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* hardware stores this as 8 bit signed value.
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/antenna.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
|
2013-09-08 09:38:32 +00:00
|
|
|
@@ -744,14 +744,14 @@ void ath_ant_comb_scan(struct ath_softc
|
2012-06-18 01:26:36 +00:00
|
|
|
struct ath_ant_comb *antcomb = &sc->ant_comb;
|
|
|
|
int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set;
|
|
|
|
int curr_main_set;
|
|
|
|
- int main_rssi = rs->rs_rssi_ctl0;
|
|
|
|
- int alt_rssi = rs->rs_rssi_ctl1;
|
|
|
|
+ int main_rssi = rs->rs_rssi_ctl[0];
|
|
|
|
+ int alt_rssi = rs->rs_rssi_ctl[1];
|
|
|
|
int rx_ant_conf, main_ant_conf;
|
2013-09-08 09:38:32 +00:00
|
|
|
bool short_scan = false, ret;
|
2012-06-18 01:26:36 +00:00
|
|
|
|
|
|
|
- rx_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_CURRENT_SHIFT) &
|
|
|
|
+ rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) &
|
|
|
|
ATH_ANT_RX_MASK;
|
|
|
|
- main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) &
|
|
|
|
+ main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) &
|
|
|
|
ATH_ANT_RX_MASK;
|
|
|
|
|
2013-09-08 09:38:32 +00:00
|
|
|
if (alt_rssi >= antcomb->low_rssi_thresh) {
|