Commit 226afe68 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville
Browse files

ath: Convert ath_print to ath_dbg



Remove ath/debug.h and the includes of these files.
Coalesce long formats.
Correct a few misspellings and missing "\n"s from these logging messages.
Remove unnecessary trailing space before a newline.
Remove ARRAY_SIZE casts, use printf type %zu

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3800276a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@
#include "reg.h"
#include "debug.h"
#include "ani.h"
#include "../debug.h"

static int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
+0 −1
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@

#include "base.h"
#include "debug.h"
#include "../debug.h"

static unsigned int ath5k_debug;
module_param_named(debug, ath5k_debug, uint, 0);
+45 −52
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ static void ath9k_ani_restart(struct ath_hw *ah)
		cck_base = AR_PHY_COUNTMAX - ah->config.cck_trig_high;
	}

	ath_print(common, ATH_DBG_ANI,
	ath_dbg(common, ATH_DBG_ANI,
		"Writing ofdmbase=%u   cckbase=%u\n", ofdm_base, cck_base);

	ENABLE_REGWRITE_BUFFER(ah);
@@ -267,7 +267,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)

	aniState->noiseFloor = BEACON_RSSI(ah);

	ath_print(common, ATH_DBG_ANI,
	ath_dbg(common, ATH_DBG_ANI,
		"**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
		aniState->ofdmNoiseImmunityLevel,
		immunityLevel, aniState->noiseFloor,
@@ -334,7 +334,7 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel)
	const struct ani_cck_level_entry *entry_cck;

	aniState->noiseFloor = BEACON_RSSI(ah);
	ath_print(common, ATH_DBG_ANI,
	ath_dbg(common, ATH_DBG_ANI,
		"**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
		aniState->cckNoiseImmunityLevel, immunityLevel,
		aniState->noiseFloor, aniState->rssiThrLow,
@@ -478,7 +478,7 @@ static void ath9k_ani_reset_old(struct ath_hw *ah, bool is_scanning)

	if (ah->opmode != NL80211_IFTYPE_STATION
	    && ah->opmode != NL80211_IFTYPE_ADHOC) {
		ath_print(common, ATH_DBG_ANI,
		ath_dbg(common, ATH_DBG_ANI,
			"Reset ANI state opmode %u\n", ah->opmode);
		ah->stats.ast_ani_reset++;

@@ -584,10 +584,8 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
		    ATH9K_ANI_OFDM_DEF_LEVEL ||
		    aniState->cckNoiseImmunityLevel !=
		    ATH9K_ANI_CCK_DEF_LEVEL) {
			ath_print(common, ATH_DBG_ANI,
				  "Restore defaults: opmode %u "
				  "chan %d Mhz/0x%x is_scanning=%d "
				  "ofdm:%d cck:%d\n",
			ath_dbg(common, ATH_DBG_ANI,
				"Restore defaults: opmode %u chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
				ah->opmode,
				chan->channel,
				chan->channelFlags,
@@ -602,10 +600,8 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
		/*
		 * restore historical levels for this channel
		 */
		ath_print(common, ATH_DBG_ANI,
			  "Restore history: opmode %u "
			  "chan %d Mhz/0x%x is_scanning=%d "
			  "ofdm:%d cck:%d\n",
		ath_dbg(common, ATH_DBG_ANI,
			"Restore history: opmode %u chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
			ah->opmode,
			chan->channel,
			chan->channelFlags,
@@ -666,18 +662,16 @@ static bool ath9k_hw_ani_read_counters(struct ath_hw *ah)

	if (!use_new_ani(ah) && (phyCnt1 < ofdm_base || phyCnt2 < cck_base)) {
		if (phyCnt1 < ofdm_base) {
			ath_print(common, ATH_DBG_ANI,
				  "phyCnt1 0x%x, resetting "
				  "counter value to 0x%x\n",
			ath_dbg(common, ATH_DBG_ANI,
				"phyCnt1 0x%x, resetting counter value to 0x%x\n",
				phyCnt1, ofdm_base);
			REG_WRITE(ah, AR_PHY_ERR_1, ofdm_base);
			REG_WRITE(ah, AR_PHY_ERR_MASK_1,
				  AR_PHY_ERR_OFDM_TIMING);
		}
		if (phyCnt2 < cck_base) {
			ath_print(common, ATH_DBG_ANI,
				  "phyCnt2 0x%x, resetting "
				  "counter value to 0x%x\n",
			ath_dbg(common, ATH_DBG_ANI,
				"phyCnt2 0x%x, resetting counter value to 0x%x\n",
				phyCnt2, cck_base);
			REG_WRITE(ah, AR_PHY_ERR_2, cck_base);
			REG_WRITE(ah, AR_PHY_ERR_MASK_2,
@@ -719,9 +713,8 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
	cckPhyErrRate =  aniState->cckPhyErrCount * 1000 /
			 aniState->listenTime;

	ath_print(common, ATH_DBG_ANI,
		  "listenTime=%d OFDM:%d errs=%d/s CCK:%d "
		  "errs=%d/s ofdm_turn=%d\n",
	ath_dbg(common, ATH_DBG_ANI,
		"listenTime=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n",
		aniState->listenTime,
		aniState->ofdmNoiseImmunityLevel,
		ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
@@ -755,7 +748,7 @@ void ath9k_enable_mib_counters(struct ath_hw *ah)
{
	struct ath_common *common = ath9k_hw_common(ah);

	ath_print(common, ATH_DBG_ANI, "Enable MIB counters\n");
	ath_dbg(common, ATH_DBG_ANI, "Enable MIB counters\n");

	ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);

@@ -777,7 +770,7 @@ void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
{
	struct ath_common *common = ath9k_hw_common(ah);

	ath_print(common, ATH_DBG_ANI, "Disable MIB counters\n");
	ath_dbg(common, ATH_DBG_ANI, "Disable MIB counters\n");

	REG_WRITE(ah, AR_MIBC, AR_MIBC_FMC);
	ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
@@ -852,7 +845,7 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
	struct ath_common *common = ath9k_hw_common(ah);
	int i;

	ath_print(common, ATH_DBG_ANI, "Initialize ANI\n");
	ath_dbg(common, ATH_DBG_ANI, "Initialize ANI\n");

	if (use_new_ani(ah)) {
		ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW;
+84 −103
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
	/* pre-reverse this field */
	tmp_reg = ath9k_hw_reverse_bits(new_bias, 3);

	ath_print(common, ATH_DBG_CONFIG,
		  "Force rf_pwd_icsyndiv to %1d on %4d\n",
	ath_dbg(common, ATH_DBG_CONFIG, "Force rf_pwd_icsyndiv to %1d on %4d\n",
		new_bias, synth_freq);

	/* swizzle rf_pwd_icsyndiv */
@@ -1054,10 +1053,9 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
		u32 level = param;

		if (level >= ARRAY_SIZE(ah->totalSizeDesired)) {
			ath_print(common, ATH_DBG_ANI,
				  "level out of range (%u > %u)\n",
				  level,
				  (unsigned)ARRAY_SIZE(ah->totalSizeDesired));
			ath_dbg(common, ATH_DBG_ANI,
				"level out of range (%u > %zu)\n",
				level, ARRAY_SIZE(ah->totalSizeDesired));
			return false;
		}

@@ -1159,10 +1157,9 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
		u32 level = param;

		if (level >= ARRAY_SIZE(firstep)) {
			ath_print(common, ATH_DBG_ANI,
				  "level out of range (%u > %u)\n",
				  level,
				  (unsigned) ARRAY_SIZE(firstep));
			ath_dbg(common, ATH_DBG_ANI,
				"level out of range (%u > %zu)\n",
				level, ARRAY_SIZE(firstep));
			return false;
		}
		REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
@@ -1180,10 +1177,9 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
		u32 level = param;

		if (level >= ARRAY_SIZE(cycpwrThr1)) {
			ath_print(common, ATH_DBG_ANI,
				  "level out of range (%u > %u)\n",
				  level,
				  (unsigned) ARRAY_SIZE(cycpwrThr1));
			ath_dbg(common, ATH_DBG_ANI,
				"level out of range (%u > %zu)\n",
				level, ARRAY_SIZE(cycpwrThr1));
			return false;
		}
		REG_RMW_FIELD(ah, AR_PHY_TIMING5,
@@ -1199,25 +1195,22 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
	case ATH9K_ANI_PRESENT:
		break;
	default:
		ath_print(common, ATH_DBG_ANI,
			  "invalid cmd %u\n", cmd);
		ath_dbg(common, ATH_DBG_ANI, "invalid cmd %u\n", cmd);
		return false;
	}

	ath_print(common, ATH_DBG_ANI, "ANI parameters:\n");
	ath_print(common, ATH_DBG_ANI,
		  "noiseImmunityLevel=%d, spurImmunityLevel=%d, "
		  "ofdmWeakSigDetectOff=%d\n",
	ath_dbg(common, ATH_DBG_ANI, "ANI parameters:\n");
	ath_dbg(common, ATH_DBG_ANI,
		"noiseImmunityLevel=%d, spurImmunityLevel=%d, ofdmWeakSigDetectOff=%d\n",
		aniState->noiseImmunityLevel,
		aniState->spurImmunityLevel,
		!aniState->ofdmWeakSigDetectOff);
	ath_print(common, ATH_DBG_ANI,
		  "cckWeakSigThreshold=%d, "
		  "firstepLevel=%d, listenTime=%d\n",
	ath_dbg(common, ATH_DBG_ANI,
		"cckWeakSigThreshold=%d, firstepLevel=%d, listenTime=%d\n",
		aniState->cckWeakSigThreshold,
		aniState->firstepLevel,
		aniState->listenTime);
	ath_print(common, ATH_DBG_ANI,
	ath_dbg(common, ATH_DBG_ANI,
		"ofdmPhyErrCount=%d, cckPhyErrCount=%d\n\n",
		aniState->ofdmPhyErrCount,
		aniState->cckPhyErrCount);
@@ -1302,7 +1295,7 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
				    AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);

		if (!on != aniState->ofdmWeakSigDetectOff) {
			ath_print(common, ATH_DBG_ANI,
			ath_dbg(common, ATH_DBG_ANI,
				"** ch %d: ofdm weak signal: %s=>%s\n",
				chan->channel,
				!aniState->ofdmWeakSigDetectOff ?
@@ -1320,11 +1313,9 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
		u32 level = param;

		if (level >= ARRAY_SIZE(firstep_table)) {
			ath_print(common, ATH_DBG_ANI,
				  "ATH9K_ANI_FIRSTEP_LEVEL: level "
				  "out of range (%u > %u)\n",
				  level,
				  (unsigned) ARRAY_SIZE(firstep_table));
			ath_dbg(common, ATH_DBG_ANI,
				"ATH9K_ANI_FIRSTEP_LEVEL: level out of range (%u > %zu)\n",
				level, ARRAY_SIZE(firstep_table));
			return false;
		}

@@ -1359,18 +1350,16 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
			      AR_PHY_FIND_SIG_FIRSTEP_LOW, value2);

		if (level != aniState->firstepLevel) {
			ath_print(common, ATH_DBG_ANI,
				  "** ch %d: level %d=>%d[def:%d] "
				  "firstep[level]=%d ini=%d\n",
			ath_dbg(common, ATH_DBG_ANI,
				"** ch %d: level %d=>%d[def:%d] firstep[level]=%d ini=%d\n",
				chan->channel,
				aniState->firstepLevel,
				level,
				ATH9K_ANI_FIRSTEP_LVL_NEW,
				value,
				aniState->iniDef.firstep);
			ath_print(common, ATH_DBG_ANI,
				  "** ch %d: level %d=>%d[def:%d] "
				  "firstep_low[level]=%d ini=%d\n",
			ath_dbg(common, ATH_DBG_ANI,
				"** ch %d: level %d=>%d[def:%d] firstep_low[level]=%d ini=%d\n",
				chan->channel,
				aniState->firstepLevel,
				level,
@@ -1389,11 +1378,9 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
		u32 level = param;

		if (level >= ARRAY_SIZE(cycpwrThr1_table)) {
			ath_print(common, ATH_DBG_ANI,
				  "ATH9K_ANI_SPUR_IMMUNITY_LEVEL: level "
				  "out of range (%u > %u)\n",
				  level,
				  (unsigned) ARRAY_SIZE(cycpwrThr1_table));
			ath_dbg(common, ATH_DBG_ANI,
				"ATH9K_ANI_SPUR_IMMUNITY_LEVEL: level out of range (%u > %zu)\n",
				level, ARRAY_SIZE(cycpwrThr1_table));
			return false;
		}
		/*
@@ -1427,18 +1414,16 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
			      AR_PHY_EXT_TIMING5_CYCPWR_THR1, value2);

		if (level != aniState->spurImmunityLevel) {
			ath_print(common, ATH_DBG_ANI,
				  "** ch %d: level %d=>%d[def:%d] "
				  "cycpwrThr1[level]=%d ini=%d\n",
			ath_dbg(common, ATH_DBG_ANI,
				"** ch %d: level %d=>%d[def:%d] cycpwrThr1[level]=%d ini=%d\n",
				chan->channel,
				aniState->spurImmunityLevel,
				level,
				ATH9K_ANI_SPUR_IMMUNE_LVL_NEW,
				value,
				aniState->iniDef.cycpwrThr1);
			ath_print(common, ATH_DBG_ANI,
				  "** ch %d: level %d=>%d[def:%d] "
				  "cycpwrThr1Ext[level]=%d ini=%d\n",
			ath_dbg(common, ATH_DBG_ANI,
				"** ch %d: level %d=>%d[def:%d] cycpwrThr1Ext[level]=%d ini=%d\n",
				chan->channel,
				aniState->spurImmunityLevel,
				level,
@@ -1463,15 +1448,12 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
	case ATH9K_ANI_PRESENT:
		break;
	default:
		ath_print(common, ATH_DBG_ANI,
			  "invalid cmd %u\n", cmd);
		ath_dbg(common, ATH_DBG_ANI, "invalid cmd %u\n", cmd);
		return false;
	}

	ath_print(common, ATH_DBG_ANI,
		  "ANI parameters: SI=%d, ofdmWS=%s FS=%d "
		  "MRCcck=%s listenTime=%d "
		  "ofdmErrs=%d cckErrs=%d\n",
	ath_dbg(common, ATH_DBG_ANI,
		"ANI parameters: SI=%d, ofdmWS=%s FS=%d MRCcck=%s listenTime=%d ofdmErrs=%d cckErrs=%d\n",
		aniState->spurImmunityLevel,
		!aniState->ofdmWeakSigDetectOff ? "on" : "off",
		aniState->firstepLevel,
@@ -1524,8 +1506,7 @@ static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)

	iniDef = &aniState->iniDef;

	ath_print(common, ATH_DBG_ANI,
		  "ver %d.%d opmode %u chan %d Mhz/0x%x\n",
	ath_dbg(common, ATH_DBG_ANI, "ver %d.%d opmode %u chan %d Mhz/0x%x\n",
		ah->hw_version.macVersion,
		ah->hw_version.macRev,
		ah->opmode,
+108 −112
Original line number Diff line number Diff line
@@ -39,17 +39,17 @@ static void ar9002_hw_setup_calibration(struct ath_hw *ah,
	switch (currCal->calData->calType) {
	case IQ_MISMATCH_CAL:
		REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_IQ);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"starting IQ Mismatch Calibration\n");
		break;
	case ADC_GAIN_CAL:
		REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_GAIN);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"starting ADC Gain Calibration\n");
		break;
	case ADC_DC_CAL:
		REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_PER);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"starting ADC DC Calibration\n");
		break;
	}
@@ -107,7 +107,7 @@ static void ar9002_hw_iqcal_collect(struct ath_hw *ah)
			REG_READ(ah, AR_PHY_CAL_MEAS_1(i));
		ah->totalIqCorrMeas[i] +=
			(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_2(i));
		ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
		ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
			"%d: Chn %d pmi=0x%08x;pmq=0x%08x;iqcm=0x%08x;\n",
			ah->cal_samples, i, ah->totalPowerMeasI[i],
			ah->totalPowerMeasQ[i],
@@ -129,9 +129,8 @@ static void ar9002_hw_adc_gaincal_collect(struct ath_hw *ah)
		ah->totalAdcQEvenPhase[i] +=
			REG_READ(ah, AR_PHY_CAL_MEAS_3(i));

		ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
			  "%d: Chn %d oddi=0x%08x; eveni=0x%08x; "
			  "oddq=0x%08x; evenq=0x%08x;\n",
		ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
			"%d: Chn %d oddi=0x%08x; eveni=0x%08x; oddq=0x%08x; evenq=0x%08x;\n",
			ah->cal_samples, i,
			ah->totalAdcIOddPhase[i],
			ah->totalAdcIEvenPhase[i],
@@ -154,9 +153,8 @@ static void ar9002_hw_adc_dccal_collect(struct ath_hw *ah)
		ah->totalAdcDcOffsetQEvenPhase[i] +=
			(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_3(i));

		ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
			  "%d: Chn %d oddi=0x%08x; eveni=0x%08x; "
			  "oddq=0x%08x; evenq=0x%08x;\n",
		ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
			"%d: Chn %d oddi=0x%08x; eveni=0x%08x; oddq=0x%08x; evenq=0x%08x;\n",
			ah->cal_samples, i,
			ah->totalAdcDcOffsetIOddPhase[i],
			ah->totalAdcDcOffsetIEvenPhase[i],
@@ -178,11 +176,11 @@ static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
		powerMeasQ = ah->totalPowerMeasQ[i];
		iqCorrMeas = ah->totalIqCorrMeas[i];

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Starting IQ Cal and Correction for Chain %d\n",
			i);

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Orignal: Chn %diq_corr_meas = 0x%08x\n",
			i, ah->totalIqCorrMeas[i]);

@@ -193,11 +191,11 @@ static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
			iqCorrNeg = 1;
		}

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_i = 0x%08x\n", i, powerMeasI);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_q = 0x%08x\n", i, powerMeasQ);
		ath_print(common, ATH_DBG_CALIBRATE, "iqCorrNeg is 0x%08x\n",
		ath_dbg(common, ATH_DBG_CALIBRATE, "iqCorrNeg is 0x%08x\n",
			iqCorrNeg);

		iCoffDenom = (powerMeasI / 2 + powerMeasQ / 2) / 128;
@@ -207,13 +205,13 @@ static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
		    (qCoffDenom != 0)) {
			iCoff = iqCorrMeas / iCoffDenom;
			qCoff = powerMeasI / qCoffDenom - 64;
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"Chn %d iCoff = 0x%08x\n", i, iCoff);
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"Chn %d qCoff = 0x%08x\n", i, qCoff);

			iCoff = iCoff & 0x3f;
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"New: Chn %d iCoff = 0x%08x\n", i, iCoff);
			if (iqCorrNeg == 0x0)
				iCoff = 0x40 - iCoff;
@@ -223,7 +221,7 @@ static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
			else if (qCoff <= -16)
				qCoff = -16;

			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"Chn %d : iCoff = 0x%x  qCoff = 0x%x\n",
				i, iCoff, qCoff);

@@ -233,7 +231,7 @@ static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
			REG_RMW_FIELD(ah, AR_PHY_TIMING_CTRL4(i),
				      AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF,
				      qCoff);
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"IQ Cal and Correction done for Chain %d\n",
				i);
		}
@@ -255,19 +253,19 @@ static void ar9002_hw_adc_gaincal_calibrate(struct ath_hw *ah, u8 numChains)
		qOddMeasOffset = ah->totalAdcQOddPhase[i];
		qEvenMeasOffset = ah->totalAdcQEvenPhase[i];

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Starting ADC Gain Cal for Chain %d\n", i);

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_odd_i = 0x%08x\n", i,
			iOddMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_even_i = 0x%08x\n", i,
			iEvenMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_odd_q = 0x%08x\n", i,
			qOddMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_even_q = 0x%08x\n", i,
			qEvenMeasOffset);

@@ -279,10 +277,10 @@ static void ar9002_hw_adc_gaincal_calibrate(struct ath_hw *ah, u8 numChains)
				((qOddMeasOffset * 32) /
				 qEvenMeasOffset) & 0x3f;

			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"Chn %d gain_mismatch_i = 0x%08x\n", i,
				iGainMismatch);
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"Chn %d gain_mismatch_q = 0x%08x\n", i,
				qGainMismatch);

@@ -291,7 +289,7 @@ static void ar9002_hw_adc_gaincal_calibrate(struct ath_hw *ah, u8 numChains)
			val |= (qGainMismatch) | (iGainMismatch << 6);
			REG_WRITE(ah, AR_PHY_NEW_ADC_DC_GAIN_CORR(i), val);

			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"ADC Gain Cal done for Chain %d\n", i);
		}
	}
@@ -317,19 +315,19 @@ static void ar9002_hw_adc_dccal_calibrate(struct ath_hw *ah, u8 numChains)
		qOddMeasOffset = ah->totalAdcDcOffsetQOddPhase[i];
		qEvenMeasOffset = ah->totalAdcDcOffsetQEvenPhase[i];

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Starting ADC DC Offset Cal for Chain %d\n", i);

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_odd_i = %d\n", i,
			iOddMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_even_i = %d\n", i,
			iEvenMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_odd_q = %d\n", i,
			qOddMeasOffset);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d pwr_meas_even_q = %d\n", i,
			qEvenMeasOffset);

@@ -338,10 +336,10 @@ static void ar9002_hw_adc_dccal_calibrate(struct ath_hw *ah, u8 numChains)
		qDcMismatch = (((qOddMeasOffset - qEvenMeasOffset) * 2) /
			       numSamples) & 0x1ff;

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d dc_offset_mismatch_i = 0x%08x\n", i,
			iDcMismatch);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"Chn %d dc_offset_mismatch_q = 0x%08x\n", i,
			qDcMismatch);

@@ -350,7 +348,7 @@ static void ar9002_hw_adc_dccal_calibrate(struct ath_hw *ah, u8 numChains)
		val |= (qDcMismatch << 12) | (iDcMismatch << 21);
		REG_WRITE(ah, AR_PHY_NEW_ADC_DC_GAIN_CORR(i), val);

		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"ADC DC Offset Cal done for Chain %d\n", i);
	}

@@ -540,7 +538,7 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)
		{ 0x7838, 0 },
	};

	ath_print(common, ATH_DBG_CALIBRATE, "Running PA Calibration\n");
	ath_dbg(common, ATH_DBG_CALIBRATE, "Running PA Calibration\n");

	/* PA CAL is not needed for high power solution */
	if (ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE) ==
@@ -721,9 +719,8 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
		REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL);
		if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
				  AR_PHY_AGC_CONTROL_CAL, 0, AH_WAIT_TIMEOUT)) {
			ath_print(common, ATH_DBG_CALIBRATE, "offset "
				  "calibration failed to complete in "
				  "1ms; noisy ??\n");
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"offset calibration failed to complete in 1ms; noisy environment?\n");
			return false;
		}
		REG_CLR_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN);
@@ -736,8 +733,8 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
	REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL);
	if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
			  0, AH_WAIT_TIMEOUT)) {
		ath_print(common, ATH_DBG_CALIBRATE, "offset calibration "
			  "failed to complete in 1ms; noisy ??\n");
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"offset calibration failed to complete in 1ms; noisy environment?\n");
		return false;
	}

@@ -829,9 +826,8 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
		if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
				   AR_PHY_AGC_CONTROL_CAL,
				   0, AH_WAIT_TIMEOUT)) {
			ath_print(common, ATH_DBG_CALIBRATE,
				  "offset calibration failed to "
				  "complete in 1ms; noisy environment?\n");
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"offset calibration failed to complete in 1ms; noisy environment?\n");
			return false;
		}

@@ -866,18 +862,18 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)

			INIT_CAL(&ah->adcgain_caldata);
			INSERT_CAL(ah, &ah->adcgain_caldata);
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"enabling ADC Gain Calibration.\n");

			INIT_CAL(&ah->adcdc_caldata);
			INSERT_CAL(ah, &ah->adcdc_caldata);
			ath_print(common, ATH_DBG_CALIBRATE,
			ath_dbg(common, ATH_DBG_CALIBRATE,
				"enabling ADC DC Calibration.\n");
		}

		INIT_CAL(&ah->iq_caldata);
		INSERT_CAL(ah, &ah->iq_caldata);
		ath_print(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
			"enabling IQ Calibration.\n");

		ah->cal_list_curr = ah->cal_list;
Loading