ath9k_hw: define antenna diversity group
authorMohammed Shafi Shajakhan <mshajakhan@atheros.com>
Fri, 13 May 2011 15:00:56 +0000 (20:30 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 May 2011 18:10:46 +0000 (14:10 -0400)
AR9285 belongs to diversity group 0 and AR9485 belongs to diversity
group 2. Based on the diversity group we configure certain antenna
diversity paramaters such as lna1_lna2_delta and fast diversity
bias values. For AR9485 we have some gain table parameter which
selects the gain table 0/1 for main and alternate antenna

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>
drivers/net/wireless/ath/ath9k/ar9002_phy.c
drivers/net/wireless/ath/ath9k/ar9003_phy.c
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/recv.c

index b4a0c1d3b1156593516824bc53826ccf7ae23ad3..a57e963cf0dc19dd6b7ad51180657f63c65b6b9d 100644 (file)
@@ -529,6 +529,8 @@ static void ar9002_hw_antdiv_comb_conf_get(struct ath_hw *ah,
                                 AR_PHY_9285_ANT_DIV_ALT_LNACONF_S;
        antconf->fast_div_bias = (regval & AR_PHY_9285_FAST_DIV_BIAS) >>
                                  AR_PHY_9285_FAST_DIV_BIAS_S;
+       antconf->lna1_lna2_delta = -3;
+       antconf->div_group = 0;
 }
 
 static void ar9002_hw_antdiv_comb_conf_set(struct ath_hw *ah,
index d2a5d2737cd333854df704256105363c37c339b9..25f3c2fdf2bcf15010d550cfb167294acc45781f 100644 (file)
@@ -1196,6 +1196,8 @@ static void ar9003_hw_antdiv_comb_conf_get(struct ath_hw *ah,
                                 AR_PHY_9485_ANT_DIV_ALT_LNACONF_S;
        antconf->fast_div_bias = (regval & AR_PHY_9485_ANT_FAST_DIV_BIAS) >>
                                  AR_PHY_9485_ANT_FAST_DIV_BIAS_S;
+       antconf->lna1_lna2_delta = -9;
+       antconf->div_group = 2;
 }
 
 static void ar9003_hw_antdiv_comb_conf_set(struct ath_hw *ah,
index f2f672bc5966b6c9d5cbd69fad5212321a10ebdc..03b37d7be1c3bac7cb5276d71fb55019869ac6fe 100644 (file)
@@ -483,7 +483,6 @@ static inline void ath_deinit_leds(struct ath_softc *sc)
 #define ATH_ANT_DIV_COMB_ALT_ANT_RATIO 30
 #define ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 20
 
-#define ATH_ANT_DIV_COMB_LNA1_LNA2_DELTA -3
 #define ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA -1
 #define ATH_ANT_DIV_COMB_LNA1_DELTA_HI -4
 #define ATH_ANT_DIV_COMB_LNA1_DELTA_MID -2
index 80f512d1f9750b9d4b1e3cbd7340525c2322a346..7af2773d2bfc38766ec77480aace1f205cb045d2 100644 (file)
@@ -482,6 +482,7 @@ struct ath_hw_antcomb_conf {
        u8 main_gaintb;
        u8 alt_gaintb;
        int lna1_lna2_delta;
+       u8 div_group;
 };
 
 /**
index 9fcd1e4f45045c5c7cc891d78a20dd41e7d1d988..85e05329a607dc7fbfe3db098b5167862ae615d0 100644 (file)
@@ -1442,7 +1442,7 @@ static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
                }
 
                if ((alt_rssi_avg < (main_rssi_avg +
-                   ATH_ANT_DIV_COMB_LNA1_LNA2_DELTA)))
+                                               div_ant_conf.lna1_lna2_delta)))
                        goto div_comb_done;
        }