aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c20
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c20
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c33
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h2
7 files changed, 3 insertions, 95 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 2fc3260579a3..5ad37d05a85d 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3427,18 +3427,6 @@ static int ath9k_hw_ar9300_get_eeprom_rev(struct ath_hw *ah)
3427 return 0; 3427 return 0;
3428} 3428}
3429 3429
3430static u8 ath9k_hw_ar9300_get_num_ant_config(struct ath_hw *ah,
3431 enum ath9k_hal_freq_band freq_band)
3432{
3433 return 1;
3434}
3435
3436static u32 ath9k_hw_ar9300_get_eeprom_antenna_cfg(struct ath_hw *ah,
3437 struct ath9k_channel *chan)
3438{
3439 return -EINVAL;
3440}
3441
3442static s32 ar9003_hw_xpa_bias_level_get(struct ath_hw *ah, bool is2ghz) 3430static s32 ar9003_hw_xpa_bias_level_get(struct ath_hw *ah, bool is2ghz)
3443{ 3431{
3444 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; 3432 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
@@ -4848,8 +4836,6 @@ const struct eeprom_ops eep_ar9300_ops = {
4848 .fill_eeprom = ath9k_hw_ar9300_fill_eeprom, 4836 .fill_eeprom = ath9k_hw_ar9300_fill_eeprom,
4849 .get_eeprom_ver = ath9k_hw_ar9300_get_eeprom_ver, 4837 .get_eeprom_ver = ath9k_hw_ar9300_get_eeprom_ver,
4850 .get_eeprom_rev = ath9k_hw_ar9300_get_eeprom_rev, 4838 .get_eeprom_rev = ath9k_hw_ar9300_get_eeprom_rev,
4851 .get_num_ant_config = ath9k_hw_ar9300_get_num_ant_config,
4852 .get_eeprom_antenna_cfg = ath9k_hw_ar9300_get_eeprom_antenna_cfg,
4853 .set_board_values = ath9k_hw_ar9300_set_board_values, 4839 .set_board_values = ath9k_hw_ar9300_set_board_values,
4854 .set_addac = ath9k_hw_ar9300_set_addac, 4840 .set_addac = ath9k_hw_ar9300_set_addac,
4855 .set_txpower = ath9k_hw_ar9300_set_txpower, 4841 .set_txpower = ath9k_hw_ar9300_set_txpower,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 1f6b712898e6..f6f09d1378f4 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -649,10 +649,6 @@ struct eeprom_ops {
649 bool (*fill_eeprom)(struct ath_hw *hw); 649 bool (*fill_eeprom)(struct ath_hw *hw);
650 int (*get_eeprom_ver)(struct ath_hw *hw); 650 int (*get_eeprom_ver)(struct ath_hw *hw);
651 int (*get_eeprom_rev)(struct ath_hw *hw); 651 int (*get_eeprom_rev)(struct ath_hw *hw);
652 u8 (*get_num_ant_config)(struct ath_hw *hw,
653 enum ath9k_hal_freq_band band);
654 u32 (*get_eeprom_antenna_cfg)(struct ath_hw *hw,
655 struct ath9k_channel *chan);
656 void (*set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan); 652 void (*set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan);
657 void (*set_addac)(struct ath_hw *hw, struct ath9k_channel *chan); 653 void (*set_addac)(struct ath_hw *hw, struct ath9k_channel *chan);
658 void (*set_txpower)(struct ath_hw *hw, struct ath9k_channel *chan, 654 void (*set_txpower)(struct ath_hw *hw, struct ath9k_channel *chan,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index b0f744687900..fbdff7e47952 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -770,8 +770,7 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
770 pModal = &eep->modalHeader; 770 pModal = &eep->modalHeader;
771 txRxAttenLocal = 23; 771 txRxAttenLocal = 23;
772 772
773 REG_WRITE(ah, AR_PHY_SWITCH_COM, 773 REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon);
774 ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
775 774
776 /* Single chain for 4K EEPROM*/ 775 /* Single chain for 4K EEPROM*/
777 ath9k_hw_4k_set_gain(ah, pModal, eep, txRxAttenLocal); 776 ath9k_hw_4k_set_gain(ah, pModal, eep, txRxAttenLocal);
@@ -987,21 +986,6 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
987 } 986 }
988} 987}
989 988
990static u32 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah,
991 struct ath9k_channel *chan)
992{
993 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
994 struct modal_eep_4k_header *pModal = &eep->modalHeader;
995
996 return pModal->antCtrlCommon;
997}
998
999static u8 ath9k_hw_4k_get_num_ant_config(struct ath_hw *ah,
1000 enum ath9k_hal_freq_band freq_band)
1001{
1002 return 1;
1003}
1004
1005static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) 989static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
1006{ 990{
1007#define EEP_MAP4K_SPURCHAN \ 991#define EEP_MAP4K_SPURCHAN \
@@ -1038,8 +1022,6 @@ const struct eeprom_ops eep_4k_ops = {
1038 .fill_eeprom = ath9k_hw_4k_fill_eeprom, 1022 .fill_eeprom = ath9k_hw_4k_fill_eeprom,
1039 .get_eeprom_ver = ath9k_hw_4k_get_eeprom_ver, 1023 .get_eeprom_ver = ath9k_hw_4k_get_eeprom_ver,
1040 .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev, 1024 .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev,
1041 .get_num_ant_config = ath9k_hw_4k_get_num_ant_config,
1042 .get_eeprom_antenna_cfg = ath9k_hw_4k_get_eeprom_antenna_cfg,
1043 .set_board_values = ath9k_hw_4k_set_board_values, 1025 .set_board_values = ath9k_hw_4k_set_board_values,
1044 .set_addac = ath9k_hw_4k_set_addac, 1026 .set_addac = ath9k_hw_4k_set_addac,
1045 .set_txpower = ath9k_hw_4k_set_txpower, 1027 .set_txpower = ath9k_hw_4k_set_txpower,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 868faf95ad2c..9b6bc8a953bc 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -866,8 +866,7 @@ static void ath9k_hw_ar9287_set_board_values(struct ath_hw *ah,
866 antWrites[j++] = (u16)(pModal->antCtrlChain[i] & 0x3); 866 antWrites[j++] = (u16)(pModal->antCtrlChain[i] & 0x3);
867 } 867 }
868 868
869 REG_WRITE(ah, AR_PHY_SWITCH_COM, 869 REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon);
870 ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
871 870
872 for (i = 0; i < AR9287_MAX_CHAINS; i++) { 871 for (i = 0; i < AR9287_MAX_CHAINS; i++) {
873 regChainOffset = i * 0x1000; 872 regChainOffset = i * 0x1000;
@@ -968,21 +967,6 @@ static void ath9k_hw_ar9287_set_board_values(struct ath_hw *ah,
968 pModal->xpaBiasLvl); 967 pModal->xpaBiasLvl);
969} 968}
970 969
971static u8 ath9k_hw_ar9287_get_num_ant_config(struct ath_hw *ah,
972 enum ath9k_hal_freq_band freq_band)
973{
974 return 1;
975}
976
977static u32 ath9k_hw_ar9287_get_eeprom_antenna_cfg(struct ath_hw *ah,
978 struct ath9k_channel *chan)
979{
980 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
981 struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
982
983 return pModal->antCtrlCommon;
984}
985
986static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah, 970static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
987 u16 i, bool is2GHz) 971 u16 i, bool is2GHz)
988{ 972{
@@ -1020,8 +1004,6 @@ const struct eeprom_ops eep_ar9287_ops = {
1020 .fill_eeprom = ath9k_hw_ar9287_fill_eeprom, 1004 .fill_eeprom = ath9k_hw_ar9287_fill_eeprom,
1021 .get_eeprom_ver = ath9k_hw_ar9287_get_eeprom_ver, 1005 .get_eeprom_ver = ath9k_hw_ar9287_get_eeprom_ver,
1022 .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev, 1006 .get_eeprom_rev = ath9k_hw_ar9287_get_eeprom_rev,
1023 .get_num_ant_config = ath9k_hw_ar9287_get_num_ant_config,
1024 .get_eeprom_antenna_cfg = ath9k_hw_ar9287_get_eeprom_antenna_cfg,
1025 .set_board_values = ath9k_hw_ar9287_set_board_values, 1007 .set_board_values = ath9k_hw_ar9287_set_board_values,
1026 .set_addac = ath9k_hw_ar9287_set_addac, 1008 .set_addac = ath9k_hw_ar9287_set_addac,
1027 .set_txpower = ath9k_hw_ar9287_set_txpower, 1009 .set_txpower = ath9k_hw_ar9287_set_txpower,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index ad3e234a673b..088f141f2006 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -374,8 +374,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
374 pModal = &(eep->modalHeader[IS_CHAN_2GHZ(chan)]); 374 pModal = &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
375 txRxAttenLocal = IS_CHAN_2GHZ(chan) ? 23 : 44; 375 txRxAttenLocal = IS_CHAN_2GHZ(chan) ? 23 : 44;
376 376
377 REG_WRITE(ah, AR_PHY_SWITCH_COM, 377 REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon & 0xffff);
378 ah->eep_ops->get_eeprom_antenna_cfg(ah, chan));
379 378
380 for (i = 0; i < AR5416_MAX_CHAINS; i++) { 379 for (i = 0; i < AR5416_MAX_CHAINS; i++) {
381 if (AR_SREV_9280(ah)) { 380 if (AR_SREV_9280(ah)) {
@@ -1264,34 +1263,6 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1264 | ATH9K_POW_SM(pModal->pwrDecreaseFor2Chain, 0)); 1263 | ATH9K_POW_SM(pModal->pwrDecreaseFor2Chain, 0));
1265} 1264}
1266 1265
1267static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah,
1268 enum ath9k_hal_freq_band freq_band)
1269{
1270 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1271 struct modal_eep_header *pModal =
1272 &(eep->modalHeader[freq_band]);
1273 struct base_eep_header *pBase = &eep->baseEepHeader;
1274 u8 num_ant_config;
1275
1276 num_ant_config = 1;
1277
1278 if (pBase->version >= 0x0E0D &&
1279 (pModal->lna_ctl & LNA_CTL_USE_ANT1))
1280 num_ant_config += 1;
1281
1282 return num_ant_config;
1283}
1284
1285static u32 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
1286 struct ath9k_channel *chan)
1287{
1288 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1289 struct modal_eep_header *pModal =
1290 &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
1291
1292 return pModal->antCtrlCommon;
1293}
1294
1295static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) 1266static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
1296{ 1267{
1297#define EEP_DEF_SPURCHAN \ 1268#define EEP_DEF_SPURCHAN \
@@ -1328,8 +1299,6 @@ const struct eeprom_ops eep_def_ops = {
1328 .fill_eeprom = ath9k_hw_def_fill_eeprom, 1299 .fill_eeprom = ath9k_hw_def_fill_eeprom,
1329 .get_eeprom_ver = ath9k_hw_def_get_eeprom_ver, 1300 .get_eeprom_ver = ath9k_hw_def_get_eeprom_ver,
1330 .get_eeprom_rev = ath9k_hw_def_get_eeprom_rev, 1301 .get_eeprom_rev = ath9k_hw_def_get_eeprom_rev,
1331 .get_num_ant_config = ath9k_hw_def_get_num_ant_config,
1332 .get_eeprom_antenna_cfg = ath9k_hw_def_get_eeprom_antenna_cfg,
1333 .set_board_values = ath9k_hw_def_set_board_values, 1302 .set_board_values = ath9k_hw_def_set_board_values,
1334 .set_addac = ath9k_hw_def_set_addac, 1303 .set_addac = ath9k_hw_def_set_addac,
1335 .set_txpower = ath9k_hw_def_set_txpower, 1304 .set_txpower = ath9k_hw_def_set_txpower,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 7c3d2de93652..36e0cab21bb0 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1902,11 +1902,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1902 AR_SREV_5416(ah)) 1902 AR_SREV_5416(ah))
1903 pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND; 1903 pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND;
1904 1904
1905 pCap->num_antcfg_5ghz =
1906 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_5GHZ);
1907 pCap->num_antcfg_2ghz =
1908 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
1909
1910 if (AR_SREV_9280_20_OR_LATER(ah) && common->btcoex_enabled) { 1905 if (AR_SREV_9280_20_OR_LATER(ah) && common->btcoex_enabled) {
1911 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO; 1906 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
1912 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO; 1907 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 157e6bc2651a..910d3c62a6df 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -204,8 +204,6 @@ struct ath9k_hw_capabilities {
204 u16 tx_triglevel_max; 204 u16 tx_triglevel_max;
205 u16 reg_cap; 205 u16 reg_cap;
206 u8 num_gpio_pins; 206 u8 num_gpio_pins;
207 u8 num_antcfg_2ghz;
208 u8 num_antcfg_5ghz;
209 u8 rx_hp_qdepth; 207 u8 rx_hp_qdepth;
210 u8 rx_lp_qdepth; 208 u8 rx_lp_qdepth;
211 u8 rx_status_len; 209 u8 rx_status_len;