Commit e323300d authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

ath9k: Simplify ANI initialization

The check "enable_ani" is not required since it is always
set to true and the logic for disabling/enabling ANI via
debugfs is done at a higher layer.
Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 380013fc
...@@ -118,7 +118,7 @@ static void ath9k_ani_restart(struct ath_hw *ah) ...@@ -118,7 +118,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
{ {
struct ar5416AniState *aniState; struct ar5416AniState *aniState;
if (!DO_ANI(ah)) if (!ah->curchan)
return; return;
aniState = &ah->curchan->ani; aniState = &ah->curchan->ani;
...@@ -195,7 +195,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah) ...@@ -195,7 +195,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
{ {
struct ar5416AniState *aniState; struct ar5416AniState *aniState;
if (!DO_ANI(ah)) if (!ah->curchan)
return; return;
aniState = &ah->curchan->ani; aniState = &ah->curchan->ani;
...@@ -251,7 +251,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah) ...@@ -251,7 +251,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
{ {
struct ar5416AniState *aniState; struct ar5416AniState *aniState;
if (!DO_ANI(ah)) if (!ah->curchan)
return; return;
aniState = &ah->curchan->ani; aniState = &ah->curchan->ani;
...@@ -297,7 +297,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning) ...@@ -297,7 +297,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
int ofdm_nil, cck_nil; int ofdm_nil, cck_nil;
if (!DO_ANI(ah)) if (!ah->curchan)
return; return;
BUG_ON(aniState == NULL); BUG_ON(aniState == NULL);
...@@ -415,7 +415,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -415,7 +415,7 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
u32 ofdmPhyErrRate, cckPhyErrRate; u32 ofdmPhyErrRate, cckPhyErrRate;
if (!DO_ANI(ah)) if (!ah->curchan)
return; return;
aniState = &ah->curchan->ani; aniState = &ah->curchan->ani;
...@@ -524,9 +524,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah) ...@@ -524,9 +524,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
ah->aniperiod = ATH9K_ANI_PERIOD; ah->aniperiod = ATH9K_ANI_PERIOD;
ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL; ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL;
if (ah->config.enable_ani)
ah->proc_phyerr |= HAL_PROCESS_ANI;
ath9k_ani_restart(ah); ath9k_ani_restart(ah);
ath9k_enable_mib_counters(ah); ath9k_enable_mib_counters(ah);
} }
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
#ifndef ANI_H #ifndef ANI_H
#define ANI_H #define ANI_H
#define HAL_PROCESS_ANI 0x00000001
#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI) && ah->curchan)
#define BEACON_RSSI(ahp) (ahp->stats.avgbrssi) #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
/* units are errors per second */ /* units are errors per second */
......
...@@ -814,8 +814,7 @@ void ath9k_htc_ani_work(struct work_struct *work) ...@@ -814,8 +814,7 @@ void ath9k_htc_ani_work(struct work_struct *work)
} }
/* Verify whether we must check ANI */ /* Verify whether we must check ANI */
if (ah->config.enable_ani && if ((timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) {
(timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) {
aniflag = true; aniflag = true;
common->ani.checkani_timer = timestamp; common->ani.checkani_timer = timestamp;
} }
...@@ -845,7 +844,6 @@ void ath9k_htc_ani_work(struct work_struct *work) ...@@ -845,7 +844,6 @@ void ath9k_htc_ani_work(struct work_struct *work)
* short calibration and long calibration. * short calibration and long calibration.
*/ */
cal_interval = ATH_LONG_CALINTERVAL; cal_interval = ATH_LONG_CALINTERVAL;
if (ah->config.enable_ani)
cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL); cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
if (!common->ani.caldone) if (!common->ani.caldone)
cal_interval = min(cal_interval, (u32)short_cal_interval); cal_interval = min(cal_interval, (u32)short_cal_interval);
......
...@@ -452,7 +452,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah) ...@@ -452,7 +452,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
ah->config.pcie_clock_req = 0; ah->config.pcie_clock_req = 0;
ah->config.pcie_waen = 0; ah->config.pcie_waen = 0;
ah->config.analog_shiftreg = 1; ah->config.analog_shiftreg = 1;
ah->config.enable_ani = true;
for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
ah->config.spurchans[i][0] = AR_NO_SPUR; ah->config.spurchans[i][0] = AR_NO_SPUR;
...@@ -549,7 +548,6 @@ static int ath9k_hw_post_init(struct ath_hw *ah) ...@@ -549,7 +548,6 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
ah->eep_ops->get_eeprom_ver(ah), ah->eep_ops->get_eeprom_ver(ah),
ah->eep_ops->get_eeprom_rev(ah)); ah->eep_ops->get_eeprom_rev(ah));
if (ah->config.enable_ani)
ath9k_hw_ani_init(ah); ath9k_hw_ani_init(ah);
return 0; return 0;
......
...@@ -289,7 +289,6 @@ struct ath9k_ops_config { ...@@ -289,7 +289,6 @@ struct ath9k_ops_config {
u32 ofdm_trig_high; u32 ofdm_trig_high;
u32 cck_trig_high; u32 cck_trig_high;
u32 cck_trig_low; u32 cck_trig_low;
u32 enable_ani;
u32 enable_paprd; u32 enable_paprd;
int serialize_regmode; int serialize_regmode;
bool rx_intr_mitigation; bool rx_intr_mitigation;
...@@ -852,7 +851,6 @@ struct ath_hw { ...@@ -852,7 +851,6 @@ struct ath_hw {
u32 globaltxtimeout; u32 globaltxtimeout;
/* ANI */ /* ANI */
u32 proc_phyerr;
u32 aniperiod; u32 aniperiod;
enum ath9k_ani_cmd ani_function; enum ath9k_ani_cmd ani_function;
u32 ani_skip_count; u32 ani_skip_count;
......
...@@ -390,9 +390,7 @@ void ath_ani_calibrate(unsigned long data) ...@@ -390,9 +390,7 @@ void ath_ani_calibrate(unsigned long data)
} }
/* Verify whether we must check ANI */ /* Verify whether we must check ANI */
if (sc->sc_ah->config.enable_ani if ((timestamp - common->ani.checkani_timer) >= ah->config.ani_poll_interval) {
&& (timestamp - common->ani.checkani_timer) >=
ah->config.ani_poll_interval) {
aniflag = true; aniflag = true;
common->ani.checkani_timer = timestamp; common->ani.checkani_timer = timestamp;
} }
...@@ -427,9 +425,7 @@ void ath_ani_calibrate(unsigned long data) ...@@ -427,9 +425,7 @@ void ath_ani_calibrate(unsigned long data)
* short calibration and long calibration. * short calibration and long calibration.
*/ */
cal_interval = ATH_LONG_CALINTERVAL; cal_interval = ATH_LONG_CALINTERVAL;
if (sc->sc_ah->config.enable_ani) cal_interval = min(cal_interval, (u32)ah->config.ani_poll_interval);
cal_interval = min(cal_interval,
(u32)ah->config.ani_poll_interval);
if (!common->ani.caldone) if (!common->ani.caldone)
cal_interval = min(cal_interval, (u32)short_cal_interval); cal_interval = min(cal_interval, (u32)short_cal_interval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment