2011-05-01 21:23:12 +03:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/calib.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/calib.c
|
2011-05-17 00:50:26 +03:00
|
|
|
@@ -63,6 +63,19 @@ static s16 ath9k_hw_get_default_nf(struc
|
|
|
|
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,
|
|
|
|
@@ -378,6 +391,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
|
2011-05-01 21:23:12 +03:00
|
|
|
|
|
|
|
if (!caldata) {
|
|
|
|
chan->noisefloor = nf;
|
|
|
|
+ ah->noise = ath9k_hw_getchan_noise(ah, chan);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-05-17 00:50:26 +03:00
|
|
|
@@ -385,6 +399,7 @@ bool ath9k_hw_getnf(struct ath_hw *ah, s
|
2011-05-01 21:23:12 +03:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
2011-08-01 15:15:15 +03:00
|
|
|
@@ -1488,6 +1488,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
2011-05-01 21:23:12 +03:00
|
|
|
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) &&
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
2011-06-24 22:53:13 +03:00
|
|
|
@@ -688,6 +688,7 @@ struct ath_hw {
|
2011-05-01 21:23:12 +03:00
|
|
|
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;
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/main.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
2011-06-24 22:53:13 +03:00
|
|
|
@@ -163,7 +163,7 @@ static void ath_update_survey_nf(struct
|
2011-05-01 21:23:12 +03:00
|
|
|
|
|
|
|
if (chan->noisefloor) {
|
|
|
|
survey->filled |= SURVEY_INFO_NOISE_DBM;
|
|
|
|
- survey->noise = chan->noisefloor;
|
|
|
|
+ survey->noise = ath9k_hw_getchan_noise(ah, chan);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/recv.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/recv.c
|
2011-08-01 15:15:15 +03:00
|
|
|
@@ -994,6 +994,8 @@ static int ath9k_rx_skb_preprocess(struc
|
2011-05-01 21:23:12 +03:00
|
|
|
struct ieee80211_rx_status *rx_status,
|
|
|
|
bool *decrypt_error)
|
|
|
|
{
|
|
|
|
+ struct ath_hw *ah = common->ah;
|
|
|
|
+
|
|
|
|
memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
|
|
|
|
|
|
|
|
/*
|
2011-08-01 15:15:15 +03:00
|
|
|
@@ -1014,7 +1016,7 @@ static int ath9k_rx_skb_preprocess(struc
|
2011-05-01 21:23:12 +03:00
|
|
|
|
|
|
|
rx_status->band = hw->conf.channel->band;
|
|
|
|
rx_status->freq = hw->conf.channel->center_freq;
|
|
|
|
- rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
|
|
|
|
+ rx_status->signal = ah->noise + rx_stats->rs_rssi;
|
|
|
|
rx_status->antenna = rx_stats->rs_antenna;
|
|
|
|
rx_status->flag |= RX_FLAG_MACTIME_MPDU;
|
|
|
|
|
2011-05-17 00:50:26 +03:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/calib.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/calib.h
|
|
|
|
@@ -108,6 +108,7 @@ void ath9k_init_nfcal_hist_buffer(struct
|
|
|
|
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 */
|