2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2008 Atheros Communications, Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c 203882 2010-02-14 16:26:32Z rpaulo $
23 #include "ah_internal.h"
26 #include "ah_eeprom_v14.h"
28 #include "ar5212/ar5212.h" /* for NF cal related declarations */
30 #include "ar5416/ar5416.h"
31 #include "ar5416/ar5416reg.h"
32 #include "ar5416/ar5416phy.h"
34 /* Owl specific stuff */
35 #define NUM_NOISEFLOOR_READINGS 6 /* 3 chains * (ctl + ext) */
37 static void ar5416StartNFCal(struct ath_hal *ah);
38 static void ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *);
39 static int16_t ar5416GetNf(struct ath_hal *, struct ieee80211_channel *);
42 * Determine if calibration is supported by device and channel flags
44 static OS_INLINE HAL_BOOL
45 ar5416IsCalSupp(struct ath_hal *ah, const struct ieee80211_channel *chan,
48 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
50 switch (calType & cal->suppCals) {
52 /* Run IQ Mismatch for non-CCK only */
53 return !IEEE80211_IS_CHAN_B(chan);
56 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */
57 return !IEEE80211_IS_CHAN_B(chan) &&
58 !(IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan));
64 * Setup HW to collect samples used for current cal
67 ar5416SetupMeasurement(struct ath_hal *ah, HAL_CAL_LIST *currCal)
69 /* Start calibration w/ 2^(INIT_IQCAL_LOG_COUNT_MAX+1) samples */
70 OS_REG_RMW_FIELD(ah, AR_PHY_TIMING_CTRL4,
71 AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX,
72 currCal->calData->calCountMax);
74 /* Select calibration to run */
75 switch (currCal->calData->calType) {
77 OS_REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_IQ);
78 HALDEBUG(ah, HAL_DEBUG_PERCAL,
79 "%s: start IQ Mismatch calibration\n", __func__);
82 OS_REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_GAIN);
83 HALDEBUG(ah, HAL_DEBUG_PERCAL,
84 "%s: start ADC Gain calibration\n", __func__);
87 OS_REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_PER);
88 HALDEBUG(ah, HAL_DEBUG_PERCAL,
89 "%s: start ADC DC calibration\n", __func__);
92 OS_REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_ADC_DC_INIT);
93 HALDEBUG(ah, HAL_DEBUG_PERCAL,
94 "%s: start Init ADC DC calibration\n", __func__);
98 OS_REG_SET_BIT(ah, AR_PHY_TIMING_CTRL4, AR_PHY_TIMING_CTRL4_DO_CAL);
102 * Initialize shared data structures and prepare a cal to be run.
105 ar5416ResetMeasurement(struct ath_hal *ah, HAL_CAL_LIST *currCal)
107 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
109 /* Reset data structures shared between different calibrations */
110 OS_MEMZERO(cal->caldata, sizeof(cal->caldata));
113 /* Setup HW for new calibration */
114 ar5416SetupMeasurement(ah, currCal);
116 /* Change SW state to RUNNING for this calibration */
117 currCal->calState = CAL_RUNNING;
122 * Run non-periodic calibrations.
125 ar5416RunInitCals(struct ath_hal *ah, int init_cal_count)
127 struct ath_hal_5416 *ahp = AH5416(ah);
128 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
129 HAL_CHANNEL_INTERNAL ichan; /* XXX bogus */
130 HAL_CAL_LIST *curCal = ahp->ah_cal_curr;
134 if (curCal == AH_NULL)
138 for (i = 0; i < init_cal_count; i++) {
140 ar5416ResetMeasurement(ah, curCal);
141 /* Poll for offset calibration complete */
142 if (!ath_hal_wait(ah, AR_PHY_TIMING_CTRL4, AR_PHY_TIMING_CTRL4_DO_CAL, 0)) {
143 HALDEBUG(ah, HAL_DEBUG_ANY,
144 "%s: Cal %d failed to finish in 100ms.\n",
145 __func__, curCal->calData->calType);
146 /* Re-initialize list pointers for periodic cals */
147 cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL;
151 ar5416DoCalibration(ah, &ichan, ahp->ah_rxchainmask,
154 HALDEBUG(ah, HAL_DEBUG_ANY,
155 "%s: init cal %d did not complete.\n",
156 __func__, curCal->calData->calType);
157 if (curCal->calNext != AH_NULL)
158 curCal = curCal->calNext;
161 /* Re-initialize list pointers for periodic cals */
162 cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL;
168 * Initialize Calibration infrastructure.
171 ar5416InitCal(struct ath_hal *ah, const struct ieee80211_channel *chan)
173 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
174 HAL_CHANNEL_INTERNAL *ichan;
176 ichan = ath_hal_checkchannel(ah, chan);
177 HALASSERT(ichan != AH_NULL);
179 if (AR_SREV_MERLIN_10_OR_LATER(ah)) {
180 /* Enable Rx Filter Cal */
181 OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC);
182 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
183 AR_PHY_AGC_CONTROL_FLTR_CAL);
185 /* Clear the carrier leak cal bit */
186 OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
188 /* kick off the cal */
189 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL);
191 /* Poll for offset calibration complete */
192 if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) {
193 HALDEBUG(ah, HAL_DEBUG_ANY,
194 "%s: offset calibration failed to complete in 1ms; "
195 "noisy environment?\n", __func__);
199 /* Set the cl cal bit and rerun the cal a 2nd time */
200 /* Enable Rx Filter Cal */
201 OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC);
202 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
203 AR_PHY_AGC_CONTROL_FLTR_CAL);
205 OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
208 /* Calibrate the AGC */
209 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL);
211 /* Poll for offset calibration complete */
212 if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) {
213 HALDEBUG(ah, HAL_DEBUG_ANY,
214 "%s: offset calibration did not complete in 1ms; "
215 "noisy environment?\n", __func__);
220 * Do NF calibration after DC offset and other CALs.
221 * Per system engineers, noise floor value can sometimes be 20 dB
222 * higher than normal value if DC offset and noise floor cal are
223 * triggered at the same time.
225 /* XXX this actually kicks off a NF calibration -adrian */
226 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
228 * Try to make sure the above NF cal completes, just so
229 * it doesn't clash with subsequent percals -adrian
231 if (! ar5212WaitNFCalComplete(ah, 10000)) {
232 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial NF calibration did "
233 "not complete in time; noisy environment?\n", __func__);
237 /* Initialize list pointers */
238 cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL;
241 * Enable IQ, ADC Gain, ADC DC Offset Cals
243 if (AR_SREV_SOWL_10_OR_LATER(ah)) {
244 /* Setup all non-periodic, init time only calibrations */
245 /* XXX: Init DC Offset not working yet */
247 if (ar5416IsCalSupp(ah, chan, ADC_DC_INIT_CAL)) {
248 INIT_CAL(&cal->adcDcCalInitData);
249 INSERT_CAL(cal, &cal->adcDcCalInitData);
251 /* Initialize current pointer to first element in list */
252 cal->cal_curr = cal->cal_list;
254 if (cal->ah_cal_curr != AH_NULL && !ar5416RunInitCals(ah, 0))
259 /* If Cals are supported, add them to list via INIT/INSERT_CAL */
260 if (ar5416IsCalSupp(ah, chan, ADC_GAIN_CAL)) {
261 INIT_CAL(&cal->adcGainCalData);
262 INSERT_CAL(cal, &cal->adcGainCalData);
263 HALDEBUG(ah, HAL_DEBUG_PERCAL,
264 "%s: enable ADC Gain Calibration.\n", __func__);
266 if (ar5416IsCalSupp(ah, chan, ADC_DC_CAL)) {
267 INIT_CAL(&cal->adcDcCalData);
268 INSERT_CAL(cal, &cal->adcDcCalData);
269 HALDEBUG(ah, HAL_DEBUG_PERCAL,
270 "%s: enable ADC DC Calibration.\n", __func__);
272 if (ar5416IsCalSupp(ah, chan, IQ_MISMATCH_CAL)) {
273 INIT_CAL(&cal->iqCalData);
274 INSERT_CAL(cal, &cal->iqCalData);
275 HALDEBUG(ah, HAL_DEBUG_PERCAL,
276 "%s: enable IQ Calibration.\n", __func__);
278 /* Initialize current pointer to first element in list */
279 cal->cal_curr = cal->cal_list;
281 /* Kick off measurements for the first cal */
282 if (cal->cal_curr != AH_NULL)
283 ar5416ResetMeasurement(ah, cal->cal_curr);
285 /* Mark all calibrations on this channel as being invalid */
292 * Entry point for upper layers to restart current cal.
293 * Reset the calibration valid bit in channel.
296 ar5416ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *chan)
298 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
299 HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
300 HAL_CAL_LIST *currCal = cal->cal_curr;
302 if (!AR_SREV_SOWL_10_OR_LATER(ah))
304 if (currCal == AH_NULL)
306 if (ichan == AH_NULL) {
307 HALDEBUG(ah, HAL_DEBUG_ANY,
308 "%s: invalid channel %u/0x%x; no mapping\n",
309 __func__, chan->ic_freq, chan->ic_flags);
313 * Expected that this calibration has run before, post-reset.
314 * Current state should be done
316 if (currCal->calState != CAL_DONE) {
317 HALDEBUG(ah, HAL_DEBUG_ANY,
318 "%s: Calibration state incorrect, %d\n",
319 __func__, currCal->calState);
323 /* Verify Cal is supported on this channel */
324 if (!ar5416IsCalSupp(ah, chan, currCal->calData->calType))
327 HALDEBUG(ah, HAL_DEBUG_PERCAL,
328 "%s: Resetting Cal %d state for channel %u/0x%x\n",
329 __func__, currCal->calData->calType, chan->ic_freq,
332 /* Disable cal validity in channel */
333 ichan->calValid &= ~currCal->calData->calType;
334 currCal->calState = CAL_WAITING;
340 * Recalibrate the lower PHY chips to account for temperature/environment
344 ar5416DoCalibration(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *ichan,
345 uint8_t rxchainmask, HAL_CAL_LIST *currCal, HAL_BOOL *isCalDone)
347 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
349 /* Cal is assumed not done until explicitly set below */
350 *isCalDone = AH_FALSE;
352 HALDEBUG(ah, HAL_DEBUG_PERCAL,
353 "%s: %s Calibration, state %d, calValid 0x%x\n",
354 __func__, currCal->calData->calName, currCal->calState,
357 /* Calibration in progress. */
358 if (currCal->calState == CAL_RUNNING) {
359 /* Check to see if it has finished. */
360 if (!(OS_REG_READ(ah, AR_PHY_TIMING_CTRL4) & AR_PHY_TIMING_CTRL4_DO_CAL)) {
361 HALDEBUG(ah, HAL_DEBUG_PERCAL,
362 "%s: sample %d of %d finished\n",
363 __func__, cal->calSamples,
364 currCal->calData->calNumSamples);
366 * Collect measurements for active chains.
368 currCal->calData->calCollect(ah);
369 if (++cal->calSamples >= currCal->calData->calNumSamples) {
370 int i, numChains = 0;
371 for (i = 0; i < AR5416_MAX_CHAINS; i++) {
372 if (rxchainmask & (1 << i))
376 * Process accumulated data
378 currCal->calData->calPostProc(ah, numChains);
380 /* Calibration has finished. */
381 ichan->calValid |= currCal->calData->calType;
382 currCal->calState = CAL_DONE;
383 *isCalDone = AH_TRUE;
386 * Set-up to collect of another sub-sample.
388 ar5416SetupMeasurement(ah, currCal);
391 } else if (!(ichan->calValid & currCal->calData->calType)) {
392 /* If current cal is marked invalid in channel, kick it off */
393 ar5416ResetMeasurement(ah, currCal);
398 * Internal interface to schedule periodic calibration work.
401 ar5416PerCalibrationN(struct ath_hal *ah, struct ieee80211_channel *chan,
402 u_int rxchainmask, HAL_BOOL longcal, HAL_BOOL *isCalDone)
404 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
405 HAL_CAL_LIST *currCal = cal->cal_curr;
406 HAL_CHANNEL_INTERNAL *ichan;
408 OS_MARK(ah, AH_MARK_PERCAL, chan->ic_freq);
410 *isCalDone = AH_TRUE;
413 * Since ath_hal calls the PerCal method with rxchainmask=0x1;
414 * override it with the current chainmask. The upper levels currently
415 * doesn't know about the chainmask.
417 rxchainmask = AH5416(ah)->ah_rx_chainmask;
419 /* Invalid channel check */
420 ichan = ath_hal_checkchannel(ah, chan);
421 if (ichan == AH_NULL) {
422 HALDEBUG(ah, HAL_DEBUG_ANY,
423 "%s: invalid channel %u/0x%x; no mapping\n",
424 __func__, chan->ic_freq, chan->ic_flags);
429 * For given calibration:
430 * 1. Call generic cal routine
431 * 2. When this cal is done (isCalDone) if we have more cals waiting
432 * (eg after reset), mask this to upper layers by not propagating
433 * isCalDone if it is set to TRUE.
434 * Instead, change isCalDone to FALSE and setup the waiting cal(s)
437 if (currCal != AH_NULL &&
438 (currCal->calState == CAL_RUNNING ||
439 currCal->calState == CAL_WAITING)) {
440 ar5416DoCalibration(ah, ichan, rxchainmask, currCal, isCalDone);
441 if (*isCalDone == AH_TRUE) {
442 cal->cal_curr = currCal = currCal->calNext;
443 if (currCal->calState == CAL_WAITING) {
444 *isCalDone = AH_FALSE;
445 ar5416ResetMeasurement(ah, currCal);
450 /* Do NF cal only at longer intervals */
453 * Get the value from the previous NF cal
454 * and update the history buffer.
456 ar5416GetNf(ah, chan);
459 * Load the NF from history buffer of the current channel.
460 * NF is slow time-variant, so it is OK to use a
463 ar5416LoadNF(ah, AH_PRIVATE(ah)->ah_curchan);
465 /* start NF calibration, without updating BB NF register*/
466 ar5416StartNFCal(ah);
472 * Recalibrate the lower PHY chips to account for temperature/environment
476 ar5416PerCalibration(struct ath_hal *ah, struct ieee80211_channel *chan,
479 struct ath_hal_5416 *ahp = AH5416(ah);
480 struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
481 HAL_CAL_LIST *curCal = cal->cal_curr;
483 if (curCal != AH_NULL && curCal->calData->calType == IQ_MISMATCH_CAL) {
484 return ar5416PerCalibrationN(ah, chan, ahp->ah_rx_chainmask,
489 *isIQdone = AH_FALSE;
490 return ar5416PerCalibrationN(ah, chan, ahp->ah_rx_chainmask,
491 AH_TRUE, &isCalDone);
496 ar5416GetEepromNoiseFloorThresh(struct ath_hal *ah,
497 const struct ieee80211_channel *chan, int16_t *nft)
499 if (IEEE80211_IS_CHAN_5GHZ(chan)) {
500 ath_hal_eepromGet(ah, AR_EEP_NFTHRESH_5, nft);
503 if (IEEE80211_IS_CHAN_2GHZ(chan)) {
504 ath_hal_eepromGet(ah, AR_EEP_NFTHRESH_2, nft);
507 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid channel flags 0x%x\n",
508 __func__, chan->ic_flags);
513 ar5416StartNFCal(struct ath_hal *ah)
515 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
516 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
517 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
521 ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *chan)
523 static const uint32_t ar5416_cca_regs[] = {
531 struct ar5212NfCalHist *h;
537 * Force NF calibration for all chains.
539 if (AR_SREV_KITE(ah)) {
540 /* Kite has only one chain */
542 } else if (AR_SREV_MERLIN(ah)) {
543 /* Merlin has only two chains */
550 * Write filtered NF values into maxCCApwr register parameter
551 * so we can load below.
553 h = AH5416(ah)->ah_cal.nfCalHist;
554 for (i = 0; i < AR5416_NUM_NF_READINGS; i ++)
555 if (chainmask & (1 << i)) {
556 val = OS_REG_READ(ah, ar5416_cca_regs[i]);
558 val |= (((uint32_t)(h[i].privNF) << 1) & 0x1ff);
559 OS_REG_WRITE(ah, ar5416_cca_regs[i], val);
562 /* Load software filtered NF value into baseband internal minCCApwr variable. */
563 OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF);
564 OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
565 OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
567 /* Wait for load to complete, should be fast, a few 10s of us. */
568 if (! ar5212WaitNFCalComplete(ah, 1000)) {
570 * We timed out waiting for the noisefloor to load, probably due to an
571 * in-progress rx. Simply return here and allow the load plenty of time
572 * to complete before the next calibration interval. We need to avoid
573 * trying to load -50 (which happens below) while the previous load is
574 * still in progress as this can cause rx deafness. Instead by returning
575 * here, the baseband nf cal will just be capped by our present
576 * noisefloor until the next calibration timer.
578 HALDEBUG(ah, HAL_DEBUG_ANY, "Timeout while waiting for nf "
579 "to load: AR_PHY_AGC_CONTROL=0x%x\n",
580 OS_REG_READ(ah, AR_PHY_AGC_CONTROL));
585 * Restore maxCCAPower register parameter again so that we're not capped
586 * by the median we just loaded. This will be initial (and max) value
587 * of next noise floor calibration the baseband does.
589 for (i = 0; i < AR5416_NUM_NF_READINGS; i ++)
590 if (chainmask & (1 << i)) {
591 val = OS_REG_READ(ah, ar5416_cca_regs[i]);
593 val |= (((uint32_t)(-50) << 1) & 0x1ff);
594 OS_REG_WRITE(ah, ar5416_cca_regs[i], val);
599 ar5416InitNfHistBuff(struct ar5212NfCalHist *h)
603 for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) {
605 h[i].privNF = AR5416_CCA_MAX_GOOD_VALUE;
606 h[i].invalidNFcount = AR512_NF_CAL_HIST_MAX;
607 for (j = 0; j < AR512_NF_CAL_HIST_MAX; j ++)
608 h[i].nfCalBuffer[j] = AR5416_CCA_MAX_GOOD_VALUE;
613 * Update the noise floor buffer as a ring buffer
616 ar5416UpdateNFHistBuff(struct ar5212NfCalHist *h, int16_t *nfarray)
620 for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) {
621 h[i].nfCalBuffer[h[i].currIndex] = nfarray[i];
623 if (++h[i].currIndex >= AR512_NF_CAL_HIST_MAX)
625 if (h[i].invalidNFcount > 0) {
626 if (nfarray[i] < AR5416_CCA_MIN_BAD_VALUE ||
627 nfarray[i] > AR5416_CCA_MAX_HIGH_VALUE) {
628 h[i].invalidNFcount = AR512_NF_CAL_HIST_MAX;
630 h[i].invalidNFcount--;
631 h[i].privNF = nfarray[i];
634 h[i].privNF = ar5212GetNfHistMid(h[i].nfCalBuffer);
640 * Read the NF and check it against the noise floor threshhold
643 ar5416GetNf(struct ath_hal *ah, struct ieee80211_channel *chan)
645 int16_t nf, nfThresh;
647 if (ar5212IsNFCalInProgress(ah)) {
648 HALDEBUG(ah, HAL_DEBUG_ANY,
649 "%s: NF didn't complete in calibration window\n", __func__);
652 /* Finished NF cal, check against threshold */
653 int16_t nfarray[NUM_NOISEFLOOR_READINGS] = { 0 };
654 HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
656 /* TODO - enhance for multiple chains and ext ch */
657 ath_hal_getNoiseFloor(ah, nfarray);
659 if (ar5416GetEepromNoiseFloorThresh(ah, chan, &nfThresh)) {
661 HALDEBUG(ah, HAL_DEBUG_ANY,
662 "%s: noise floor failed detected; "
663 "detected %d, threshold %d\n", __func__,
666 * NB: Don't discriminate 2.4 vs 5Ghz, if this
667 * happens it indicates a problem regardless
670 chan->ic_state |= IEEE80211_CHANSTATE_CWINT;
676 ar5416UpdateNFHistBuff(AH5416(ah)->ah_cal.nfCalHist, nfarray);
677 ichan->rawNoiseFloor = nf;