Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
{
	struct ar5416AniState *aniState;

	if (!DO_ANI(ah))
	if (!ah->curchan)
		return;

	aniState = &ah->curchan->ani;
@@ -195,7 +195,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
{
	struct ar5416AniState *aniState;

	if (!DO_ANI(ah))
	if (!ah->curchan)
		return;

	aniState = &ah->curchan->ani;
@@ -251,7 +251,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
{
	struct ar5416AniState *aniState;

	if (!DO_ANI(ah))
	if (!ah->curchan)
		return;

	aniState = &ah->curchan->ani;
@@ -297,7 +297,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
	struct ath_common *common = ath9k_hw_common(ah);
	int ofdm_nil, cck_nil;

	if (!DO_ANI(ah))
	if (!ah->curchan)
		return;

	BUG_ON(aniState == NULL);
@@ -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);
	u32 ofdmPhyErrRate, cckPhyErrRate;

	if (!DO_ANI(ah))
	if (!ah->curchan)
		return;

	aniState = &ah->curchan->ani;
@@ -524,9 +524,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
	ah->aniperiod = ATH9K_ANI_PERIOD;
	ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL;

	if (ah->config.enable_ani)
		ah->proc_phyerr |= HAL_PROCESS_ANI;

	ath9k_ani_restart(ah);
	ath9k_enable_mib_counters(ah);
}
+0 −4
Original line number Diff line number Diff line
@@ -17,10 +17,6 @@
#ifndef 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)

/* units are errors per second */
+2 −4
Original line number Diff line number Diff line
@@ -814,8 +814,7 @@ void ath9k_htc_ani_work(struct work_struct *work)
	}

	/* Verify whether we must check ANI */
	if (ah->config.enable_ani &&
	    (timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) {
	if ((timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) {
		aniflag = true;
		common->ani.checkani_timer = timestamp;
	}
@@ -845,7 +844,6 @@ void ath9k_htc_ani_work(struct work_struct *work)
	* short calibration and long calibration.
	*/
	cal_interval = ATH_LONG_CALINTERVAL;
	if (ah->config.enable_ani)
	cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
	if (!common->ani.caldone)
		cal_interval = min(cal_interval, (u32)short_cal_interval);
+1 −3
Original line number Diff line number Diff line
@@ -452,7 +452,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
	ah->config.pcie_clock_req = 0;
	ah->config.pcie_waen = 0;
	ah->config.analog_shiftreg = 1;
	ah->config.enable_ani = true;

	for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
		ah->config.spurchans[i][0] = AR_NO_SPUR;
@@ -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_rev(ah));

	if (ah->config.enable_ani)
	ath9k_hw_ani_init(ah);

	return 0;
+0 −2
Original line number Diff line number Diff line
@@ -289,7 +289,6 @@ struct ath9k_ops_config {
	u32 ofdm_trig_high;
	u32 cck_trig_high;
	u32 cck_trig_low;
	u32 enable_ani;
	u32 enable_paprd;
	int serialize_regmode;
	bool rx_intr_mitigation;
@@ -852,7 +851,6 @@ struct ath_hw {
	u32 globaltxtimeout;

	/* ANI */
	u32 proc_phyerr;
	u32 aniperiod;
	enum ath9k_ani_cmd ani_function;
	u32 ani_skip_count;
Loading