aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ath9k.h
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-09-02 04:34:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-07 13:54:33 -0400
commit102885a5d114abad8f9d4101f94ce5b28c232231 (patch)
tree6399041d50d2e8b2681ed79f8d27205f160caa16 /drivers/net/wireless/ath/ath9k/ath9k.h
parent21cc630f47d8589a42d563e89be4c631edbe8716 (diff)
ath9k: Implement an algorithm for Antenna diversity and combining
This algorithm chooses the best main and alt lna out of LNA1, LNA2, LNA1+LNA2 and LNA1-LNA2 to improve rx for single chain chips(AR9285). This would greatly improve rx when there is only one antenna is connected with AR9285. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ath9k.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index f0197a6046ab..5fe570bb5c4c 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -481,6 +481,60 @@ struct ath_led {
481void ath_init_leds(struct ath_softc *sc); 481void ath_init_leds(struct ath_softc *sc);
482void ath_deinit_leds(struct ath_softc *sc); 482void ath_deinit_leds(struct ath_softc *sc);
483 483
484/* Antenna diversity/combining */
485#define ATH_ANT_RX_CURRENT_SHIFT 4
486#define ATH_ANT_RX_MAIN_SHIFT 2
487#define ATH_ANT_RX_MASK 0x3
488
489#define ATH_ANT_DIV_COMB_SHORT_SCAN_INTR 50
490#define ATH_ANT_DIV_COMB_SHORT_SCAN_PKTCOUNT 0x100
491#define ATH_ANT_DIV_COMB_MAX_PKTCOUNT 0x200
492#define ATH_ANT_DIV_COMB_INIT_COUNT 95
493#define ATH_ANT_DIV_COMB_MAX_COUNT 100
494#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO 30
495#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 20
496
497#define ATH_ANT_DIV_COMB_LNA1_LNA2_DELTA -3
498#define ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA -1
499#define ATH_ANT_DIV_COMB_LNA1_DELTA_HI -4
500#define ATH_ANT_DIV_COMB_LNA1_DELTA_MID -2
501#define ATH_ANT_DIV_COMB_LNA1_DELTA_LOW 2
502
503enum ath9k_ant_div_comb_lna_conf {
504 ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2,
505 ATH_ANT_DIV_COMB_LNA2,
506 ATH_ANT_DIV_COMB_LNA1,
507 ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2,
508};
509
510struct ath_ant_comb {
511 u16 count;
512 u16 total_pkt_count;
513 bool scan;
514 bool scan_not_start;
515 int main_total_rssi;
516 int alt_total_rssi;
517 int alt_recv_cnt;
518 int main_recv_cnt;
519 int rssi_lna1;
520 int rssi_lna2;
521 int rssi_add;
522 int rssi_sub;
523 int rssi_first;
524 int rssi_second;
525 int rssi_third;
526 bool alt_good;
527 int quick_scan_cnt;
528 int main_conf;
529 enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf;
530 enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf;
531 int first_bias;
532 int second_bias;
533 bool first_ratio;
534 bool second_ratio;
535 unsigned long scan_start_time;
536};
537
484/********************/ 538/********************/
485/* Main driver core */ 539/* Main driver core */
486/********************/ 540/********************/
@@ -597,6 +651,8 @@ struct ath_softc {
597 struct ath_btcoex btcoex; 651 struct ath_btcoex btcoex;
598 652
599 struct ath_descdma txsdma; 653 struct ath_descdma txsdma;
654
655 struct ath_ant_comb ant_comb;
600}; 656};
601 657
602struct ath_wiphy { 658struct ath_wiphy {