Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265413
b: refs/heads/master
c: f23fba4
h: refs/heads/master
i:
  265411: 6f5fdc6
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Aug 8, 2011
1 parent 39383cf commit 4a21375
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 987dafad11bbf0454c88bd3b37461f7f2a423f71
refs/heads/master: f23fba49b31070dc180d0d41d0125ab80f71c09f
15 changes: 15 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
return ath9k_hw_get_nf_limits(ah, chan)->nominal;
}

s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan)
{
s8 noise = ATH_DEFAULT_NOISE_FLOOR;

if (chan && chan->noisefloor) {
s8 delta = chan->noisefloor -
ath9k_hw_get_default_nf(ah, chan);
if (delta > 0)
noise += delta;
}
return noise;
}
EXPORT_SYMBOL(ath9k_hw_getchan_noise);

static void ath9k_hw_update_nfcal_hist_buffer(struct ath_hw *ah,
struct ath9k_hw_cal_data *cal,
Expand Down Expand Up @@ -378,13 +391,15 @@ bool ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)

if (!caldata) {
chan->noisefloor = nf;
ah->noise = ath9k_hw_getchan_noise(ah, chan);
return false;
}

h = caldata->nfCalHist;
caldata->nfcal_pending = false;
ath9k_hw_update_nfcal_hist_buffer(ah, caldata, nfarray);
chan->noisefloor = h[0].privNF;
ah->noise = ath9k_hw_getchan_noise(ah, chan);
return true;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/calib.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah,
void ath9k_hw_bstuck_nfcal(struct ath_hw *ah);
void ath9k_hw_reset_calibration(struct ath_hw *ah,
struct ath9k_cal_list *currCal);
s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan);


#endif /* CALIB_H */
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
memset(caldata, 0, sizeof(*caldata));
ath9k_init_nfcal_hist_buffer(ah, chan);
}
ah->noise = ath9k_hw_getchan_noise(ah, chan);

if (bChannelChange &&
(ah->chip_fullsleep != true) &&
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ struct ath_hw {
enum nl80211_iftype opmode;
enum ath9k_power_mode power_mode;

s8 noise;
struct ath9k_hw_cal_data *caldata;
struct ath9k_pacal_info pacal_info;
struct ar5416Stats stats;
Expand Down

0 comments on commit 4a21375

Please sign in to comment.