1 --- a/drivers/net/wireless/ath/ath9k/hw.h
2 +++ b/drivers/net/wireless/ath/ath9k/hw.h
3 @@ -342,7 +342,6 @@ struct ath9k_hw_cal_data {
7 - int16_t rawNoiseFloor;
10 bool nfcal_interference;
11 @@ -356,6 +355,7 @@ struct ath9k_channel {
18 #define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
19 --- a/drivers/net/wireless/ath/ath9k/calib.c
20 +++ b/drivers/net/wireless/ath/ath9k/calib.c
21 @@ -346,34 +346,34 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
22 struct ieee80211_channel *c = chan->chan;
23 struct ath9k_hw_cal_data *caldata = ah->caldata;
28 chan->channelFlags &= (~CHANNEL_CW_INT);
29 if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
30 ath_print(common, ATH_DBG_CALIBRATE,
31 "NF did not complete in calibration window\n");
33 - caldata->rawNoiseFloor = nf;
36 - ath9k_hw_do_getnf(ah, nfarray);
37 - ath9k_hw_nf_sanitize(ah, nfarray);
39 - if (ath9k_hw_get_nf_thresh(ah, c->band, &nfThresh)
41 - ath_print(common, ATH_DBG_CALIBRATE,
42 - "noise floor failed detected; "
43 - "detected %d, threshold %d\n",
45 - chan->channelFlags |= CHANNEL_CW_INT;
49 + ath9k_hw_do_getnf(ah, nfarray);
50 + ath9k_hw_nf_sanitize(ah, nfarray);
52 + if (ath9k_hw_get_nf_thresh(ah, c->band, &nfThresh)
54 + ath_print(common, ATH_DBG_CALIBRATE,
55 + "noise floor failed detected; "
56 + "detected %d, threshold %d\n",
58 + chan->channelFlags |= CHANNEL_CW_INT;
62 + chan->noisefloor = nf;
66 h = caldata->nfCalHist;
67 caldata->nfcal_pending = false;
68 ath9k_hw_update_nfcal_hist_buffer(ah, caldata, nfarray);
69 - caldata->rawNoiseFloor = h[0].privNF;
70 + chan->noisefloor = h[0].privNF;
74 @@ -401,10 +401,10 @@ void ath9k_init_nfcal_hist_buffer(struct
76 s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
78 - if (!ah->caldata || !ah->caldata->rawNoiseFloor)
79 + if (!ah->curchan || !ah->curchan->noisefloor)
80 return ath9k_hw_get_default_nf(ah, chan);
82 - return ah->caldata->rawNoiseFloor;
83 + return ah->curchan->noisefloor;
85 EXPORT_SYMBOL(ath9k_hw_getchan_noise);
87 --- a/drivers/net/wireless/ath/ath9k/hw.c
88 +++ b/drivers/net/wireless/ath/ath9k/hw.c
89 @@ -1251,7 +1251,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
90 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
93 - if (curchan && !ah->chip_fullsleep && ah->caldata)
94 + if (curchan && !ah->chip_fullsleep)
95 ath9k_hw_getnf(ah, curchan);
97 ah->caldata = caldata;