aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-08-01 02:23:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-01 15:52:04 -0400
commit3fbaf4c55b2bf123085ab3adf5da97bc9a555060 (patch)
tree89d196900ea5d08d0bea475415fe208b14ae5a93
parent4eba10cc8086e3dde09f00e44b43ff4f8624d527 (diff)
ath9k: Do a quick scan only when scan_not_start is true
Right now, it is being done for all cases. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/antenna.c20
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h13
3 files changed, 26 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 664844c5d3d5..f2cd96063a00 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -561,10 +561,16 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
561 antcomb->total_pkt_count++; 561 antcomb->total_pkt_count++;
562 antcomb->main_total_rssi += main_rssi; 562 antcomb->main_total_rssi += main_rssi;
563 antcomb->alt_total_rssi += alt_rssi; 563 antcomb->alt_total_rssi += alt_rssi;
564 if (main_ant_conf == rx_ant_conf) 564
565 if (main_ant_conf == rx_ant_conf) {
565 antcomb->main_recv_cnt++; 566 antcomb->main_recv_cnt++;
566 else 567 ANT_STAT_INC(ANT_MAIN, recv_cnt);
568 ANT_LNA_INC(ANT_MAIN, rx_ant_conf);
569 } else {
567 antcomb->alt_recv_cnt++; 570 antcomb->alt_recv_cnt++;
571 ANT_STAT_INC(ANT_ALT, recv_cnt);
572 ANT_LNA_INC(ANT_ALT, rx_ant_conf);
573 }
568 } 574 }
569 575
570 /* Short scan check */ 576 /* Short scan check */
@@ -753,14 +759,12 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
753 } 759 }
754 goto div_comb_done; 760 goto div_comb_done;
755 } 761 }
762 ath_select_ant_div_from_quick_scan(antcomb, &div_ant_conf,
763 main_rssi_avg, alt_rssi_avg,
764 alt_ratio);
765 antcomb->quick_scan_cnt++;
756 } 766 }
757 767
758 ath_select_ant_div_from_quick_scan(antcomb, &div_ant_conf,
759 main_rssi_avg, alt_rssi_avg,
760 alt_ratio);
761
762 antcomb->quick_scan_cnt++;
763
764div_comb_done: 768div_comb_done:
765 ath_ant_div_conf_fast_divbias(&div_ant_conf, antcomb, alt_ratio); 769 ath_ant_div_conf_fast_divbias(&div_ant_conf, antcomb, alt_ratio);
766 ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, &div_ant_conf); 770 ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, &div_ant_conf);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 76e38d3540c0..ed8f8efb6ecf 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -609,7 +609,7 @@ struct ath_ant_comb {
609 int rssi_third; 609 int rssi_third;
610 bool alt_good; 610 bool alt_good;
611 int quick_scan_cnt; 611 int quick_scan_cnt;
612 int main_conf; 612 enum ath9k_ant_div_comb_lna_conf main_conf;
613 enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf; 613 enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf;
614 enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf; 614 enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf;
615 bool first_ratio; 615 bool first_ratio;
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index fc679198a0f3..a879e451dc46 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -28,9 +28,13 @@ struct fft_sample_tlv;
28#ifdef CONFIG_ATH9K_DEBUGFS 28#ifdef CONFIG_ATH9K_DEBUGFS
29#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++ 29#define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
30#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++ 30#define RESET_STAT_INC(sc, type) sc->debug.stats.reset[type]++
31#define ANT_STAT_INC(i, c) sc->debug.stats.ant_stats[i].c++
32#define ANT_LNA_INC(i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++;
31#else 33#else
32#define TX_STAT_INC(q, c) do { } while (0) 34#define TX_STAT_INC(q, c) do { } while (0)
33#define RESET_STAT_INC(sc, type) do { } while (0) 35#define RESET_STAT_INC(sc, type) do { } while (0)
36#define ANT_STAT_INC(i, c) do { } while (0)
37#define ANT_LNA_INC(i, c) do { } while (0)
34#endif 38#endif
35 39
36enum ath_reset_type { 40enum ath_reset_type {
@@ -243,11 +247,20 @@ struct ath_rx_stats {
243 u32 rx_spectral; 247 u32 rx_spectral;
244}; 248};
245 249
250#define ANT_MAIN 0
251#define ANT_ALT 1
252
253struct ath_antenna_stats {
254 u32 recv_cnt;
255 u32 lna_config_cnt[4];
256};
257
246struct ath_stats { 258struct ath_stats {
247 struct ath_interrupt_stats istats; 259 struct ath_interrupt_stats istats;
248 struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES]; 260 struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
249 struct ath_rx_stats rxstats; 261 struct ath_rx_stats rxstats;
250 struct ath_dfs_stats dfs_stats; 262 struct ath_dfs_stats dfs_stats;
263 struct ath_antenna_stats ant_stats[2];
251 u32 reset[__RESET_TYPE_MAX]; 264 u32 reset[__RESET_TYPE_MAX];
252}; 265};
253 266