Commit 3fbaf4c5 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

ath9k: Do a quick scan only when scan_not_start is true

Right now, it is being done for all cases.
Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4eba10cc
...@@ -561,10 +561,16 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) ...@@ -561,10 +561,16 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
antcomb->total_pkt_count++; antcomb->total_pkt_count++;
antcomb->main_total_rssi += main_rssi; antcomb->main_total_rssi += main_rssi;
antcomb->alt_total_rssi += alt_rssi; antcomb->alt_total_rssi += alt_rssi;
if (main_ant_conf == rx_ant_conf)
if (main_ant_conf == rx_ant_conf) {
antcomb->main_recv_cnt++; antcomb->main_recv_cnt++;
else ANT_STAT_INC(ANT_MAIN, recv_cnt);
ANT_LNA_INC(ANT_MAIN, rx_ant_conf);
} else {
antcomb->alt_recv_cnt++; antcomb->alt_recv_cnt++;
ANT_STAT_INC(ANT_ALT, recv_cnt);
ANT_LNA_INC(ANT_ALT, rx_ant_conf);
}
} }
/* Short scan check */ /* Short scan check */
...@@ -753,14 +759,12 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) ...@@ -753,14 +759,12 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
} }
goto div_comb_done; goto div_comb_done;
} }
ath_select_ant_div_from_quick_scan(antcomb, &div_ant_conf,
main_rssi_avg, alt_rssi_avg,
alt_ratio);
antcomb->quick_scan_cnt++;
} }
ath_select_ant_div_from_quick_scan(antcomb, &div_ant_conf,
main_rssi_avg, alt_rssi_avg,
alt_ratio);
antcomb->quick_scan_cnt++;
div_comb_done: div_comb_done:
ath_ant_div_conf_fast_divbias(&div_ant_conf, antcomb, alt_ratio); ath_ant_div_conf_fast_divbias(&div_ant_conf, antcomb, alt_ratio);
ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, &div_ant_conf); ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, &div_ant_conf);
......
...@@ -609,7 +609,7 @@ struct ath_ant_comb { ...@@ -609,7 +609,7 @@ struct ath_ant_comb {
int rssi_third; int rssi_third;
bool alt_good; bool alt_good;
int quick_scan_cnt; int quick_scan_cnt;
int main_conf; enum ath9k_ant_div_comb_lna_conf main_conf;
enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf; enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf;
enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf; enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf;
bool first_ratio; bool first_ratio;
......
...@@ -28,9 +28,13 @@ struct fft_sample_tlv; ...@@ -28,9 +28,13 @@ struct fft_sample_tlv;
#ifdef CONFIG_ATH9K_DEBUGFS #ifdef CONFIG_ATH9K_DEBUGFS
#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++ #define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++ #define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++
#define ANT_STAT_INC(i, c) sc->debug.stats.ant_stats[i].c++
#define ANT_LNA_INC(i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++;
#else #else
#define TX_STAT_INC(q, c) do { } while (0) #define TX_STAT_INC(q, c) do { } while (0)
#define RESET_STAT_INC(sc, type) do { } while (0) #define RESET_STAT_INC(sc, type) do { } while (0)
#define ANT_STAT_INC(i, c) do { } while (0)
#define ANT_LNA_INC(i, c) do { } while (0)
#endif #endif
enum ath_reset_type { enum ath_reset_type {
...@@ -243,11 +247,20 @@ struct ath_rx_stats { ...@@ -243,11 +247,20 @@ struct ath_rx_stats {
u32 rx_spectral; u32 rx_spectral;
}; };
#define ANT_MAIN 0
#define ANT_ALT 1
struct ath_antenna_stats {
u32 recv_cnt;
u32 lna_config_cnt[4];
};
struct ath_stats { struct ath_stats {
struct ath_interrupt_stats istats; struct ath_interrupt_stats istats;
struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES]; struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
struct ath_rx_stats rxstats; struct ath_rx_stats rxstats;
struct ath_dfs_stats dfs_stats; struct ath_dfs_stats dfs_stats;
struct ath_antenna_stats ant_stats[2];
u32 reset[__RESET_TYPE_MAX]; u32 reset[__RESET_TYPE_MAX];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment