ath9k_hw: enable Antenna diversity for AR9485
authorMohammed Shafi Shajakhan <mshajakhan@atheros.com>
Fri, 13 May 2011 14:59:31 +0000 (20:29 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 May 2011 18:10:43 +0000 (14:10 -0400)
read antenna diversity and combining information from the EEPROM.
Enable antenna diversity/combining feature only when both LNA
diversity and fast diversity are supported

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Tested-by: Mohammed Shafi Shajakhan <mshajakhan@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/hw.c

index 58f3d4210338cfd91624db0b4b8849acb42f4816..b75b5dca4e2905dfc020846d1939a01ff47f3d57 100644 (file)
@@ -2022,6 +2022,22 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
        }
 
 
+       if (AR_SREV_9485(ah)) {
+               ant_div_ctl1 = ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1);
+               /*
+                * enable the diversity-combining algorithm only when
+                * both enable_lna_div and enable_fast_div are set
+                *              Table for Diversity
+                * ant_div_alt_lnaconf          bit 0-1
+                * ant_div_main_lnaconf         bit 2-3
+                * ant_div_alt_gaintb           bit 4
+                * ant_div_main_gaintb          bit 5
+                * enable_ant_div_lnadiv        bit 6
+                * enable_ant_fast_div          bit 7
+                */
+               if ((ant_div_ctl1 >> 0x6) == 0x3)
+                       pCap->hw_caps |= ATH9K_HW_CAP_ANT_DIV_COMB;
+       }
 
        if (AR_SREV_9485_10(ah)) {
                pCap->pcie_lcr_extsync_en = true;