ath9k_hw: simplify spur channel handling
authorFelix Fietkau <nbd@openwrt.org>
Sat, 14 Dec 2013 17:03:41 +0000 (18:03 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 18 Dec 2013 20:23:27 +0000 (15:23 -0500)
Remove ah->config.spurmode and ah->config.spurchans, always use EEPROM
data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9002_phy.c
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h

index f087117b2e6b6b2592ae8eb7a2270314cffb7325..9a2afa2c690b761bef1e9203c60b2a3bb0e9e86f 100644 (file)
@@ -201,7 +201,6 @@ static void ar9002_hw_spur_mitigate(struct ath_hw *ah,
        ath9k_hw_get_channel_centers(ah, chan, &centers);
        freq = centers.synth_center;
 
-       ah->config.spurmode = SPUR_ENABLE_EEPROM;
        for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
                cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
 
index b4091716e9b3322881a6ed65fc3996a57e59a8b8..07b806c56c56b4b0a5167cd704493a85285a8b58 100644 (file)
@@ -1085,31 +1085,7 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
 
 static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 {
-#define EEP_MAP4K_SPURCHAN \
-       (ah->eeprom.map4k.modalHeader.spurChans[i].spurChan)
-       struct ath_common *common = ath9k_hw_common(ah);
-
-       u16 spur_val = AR_NO_SPUR;
-
-       ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
-               i, is2GHz, ah->config.spurchans[i][is2GHz]);
-
-       switch (ah->config.spurmode) {
-       case SPUR_DISABLE:
-               break;
-       case SPUR_ENABLE_IOCTL:
-               spur_val = ah->config.spurchans[i][is2GHz];
-               ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
-                       spur_val);
-               break;
-       case SPUR_ENABLE_EEPROM:
-               spur_val = EEP_MAP4K_SPURCHAN;
-               break;
-       }
-
-       return spur_val;
-
-#undef EEP_MAP4K_SPURCHAN
+       return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan;
 }
 
 const struct eeprom_ops eep_4k_ops = {
index e1d0c217c104f9ba6c2b0a1e55a941e2ccc63d20..5ba1385c9838016a942df4e189bf7d8a484fad6e 100644 (file)
@@ -1004,31 +1004,7 @@ static void ath9k_hw_ar9287_set_board_values(struct ath_hw *ah,
 static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
                                            u16 i, bool is2GHz)
 {
-#define EEP_MAP9287_SPURCHAN \
-       (ah->eeprom.map9287.modalHeader.spurChans[i].spurChan)
-
-       struct ath_common *common = ath9k_hw_common(ah);
-       u16 spur_val = AR_NO_SPUR;
-
-       ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
-               i, is2GHz, ah->config.spurchans[i][is2GHz]);
-
-       switch (ah->config.spurmode) {
-       case SPUR_DISABLE:
-               break;
-       case SPUR_ENABLE_IOCTL:
-               spur_val = ah->config.spurchans[i][is2GHz];
-               ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
-                       spur_val);
-               break;
-       case SPUR_ENABLE_EEPROM:
-               spur_val = EEP_MAP9287_SPURCHAN;
-               break;
-       }
-
-       return spur_val;
-
-#undef EEP_MAP9287_SPURCHAN
+       return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan;
 }
 
 const struct eeprom_ops eep_ar9287_ops = {
index 39107e31e79aaa98fa93453f74db8b4e416ae457..3218ca9947463a844ed38f22956faedaca688cbb 100644 (file)
@@ -1348,31 +1348,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
 
 static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 {
-#define EEP_DEF_SPURCHAN \
-       (ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan)
-       struct ath_common *common = ath9k_hw_common(ah);
-
-       u16 spur_val = AR_NO_SPUR;
-
-       ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
-               i, is2GHz, ah->config.spurchans[i][is2GHz]);
-
-       switch (ah->config.spurmode) {
-       case SPUR_DISABLE:
-               break;
-       case SPUR_ENABLE_IOCTL:
-               spur_val = ah->config.spurchans[i][is2GHz];
-               ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
-                       spur_val);
-               break;
-       case SPUR_ENABLE_EEPROM:
-               spur_val = EEP_DEF_SPURCHAN;
-               break;
-       }
-
-       return spur_val;
-
-#undef EEP_DEF_SPURCHAN
+       return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan;
 }
 
 const struct eeprom_ops eep_def_ops = {
index 954e2120d1bee6d0f8e84332110ab841bd14f75d..3e23abbcf084dadd7cc22515fa499d7cb0dce8e1 100644 (file)
@@ -439,8 +439,6 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah)
 
 static void ath9k_hw_init_config(struct ath_hw *ah)
 {
-       int i;
-
        ah->config.dma_beacon_response_time = 1;
        ah->config.sw_beacon_response_time = 6;
        ah->config.additional_swba_backoff = 0;
@@ -448,11 +446,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
        ah->config.cwm_ignore_extcca = 0;
        ah->config.analog_shiftreg = 1;
 
-       for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
-               ah->config.spurchans[i][0] = AR_NO_SPUR;
-               ah->config.spurchans[i][1] = AR_NO_SPUR;
-       }
-
        ah->config.rx_intr_mitigation = true;
 
        /*
index b8e2476c9d8009b525cdcc138b274b80d3a0504c..57d3d0c3a99fc337bb3260410040e2f1bc8513fc 100644 (file)
@@ -293,9 +293,6 @@ struct ath9k_ops_config {
        int serialize_regmode;
        bool rx_intr_mitigation;
        bool tx_intr_mitigation;
-#define SPUR_DISABLE           0
-#define SPUR_ENABLE_IOCTL      1
-#define SPUR_ENABLE_EEPROM     2
 #define AR_SPUR_5413_1         1640
 #define AR_SPUR_5413_2         1200
 #define AR_NO_SPUR             0x8000
@@ -303,8 +300,6 @@ struct ath9k_ops_config {
 #define AR_BASE_FREQ_5GHZ      4900
 #define AR_SPUR_FEEQ_BOUND_HT40 19
 #define AR_SPUR_FEEQ_BOUND_HT20 10
-       int spurmode;
-       u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
        u8 max_txtrig_level;
        u16 ani_poll_interval; /* ANI poll interval in ms */