Skip to content

Commit

Permalink
ath9k_hw: remove aniState->noiseFloor
Browse files Browse the repository at this point in the history
I don't know why somebody decided to keep a cached copy of beacon rssi in a
variable called 'noiseFloor', but the caching is unnecessary and the variable
name is confusing, so let's just get rid of it entirely.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Jun 20, 2012
1 parent a769f95 commit 35e808b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions drivers/net/wireless/ath/ath9k/ani.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,9 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
const struct ani_ofdm_level_entry *entry_ofdm;
const struct ani_cck_level_entry *entry_cck;

aniState->noiseFloor = BEACON_RSSI(ah);

ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
aniState->ofdmNoiseImmunityLevel,
immunityLevel, aniState->noiseFloor,
immunityLevel, BEACON_RSSI(ah),
aniState->rssiThrLow, aniState->rssiThrHigh);

if (aniState->update_ani)
Expand All @@ -292,7 +290,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
ATH9K_ANI_FIRSTEP_LEVEL,
entry_ofdm->fir_step_level);

if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
if (BEACON_RSSI(ah) >= aniState->rssiThrHigh &&
(!aniState->ofdmWeakSigDetectOff !=
entry_ofdm->ofdm_weak_signal_on)) {
ath9k_hw_ani_control(ah,
Expand Down Expand Up @@ -329,15 +327,14 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel)
const struct ani_ofdm_level_entry *entry_ofdm;
const struct ani_cck_level_entry *entry_cck;

aniState->noiseFloor = BEACON_RSSI(ah);
ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
aniState->cckNoiseImmunityLevel, immunityLevel,
aniState->noiseFloor, aniState->rssiThrLow,
BEACON_RSSI(ah), aniState->rssiThrLow,
aniState->rssiThrHigh);

if ((ah->opmode == NL80211_IFTYPE_STATION ||
ah->opmode == NL80211_IFTYPE_ADHOC) &&
aniState->noiseFloor <= aniState->rssiThrLow &&
BEACON_RSSI(ah) <= aniState->rssiThrLow &&
immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;

Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/ath9k/ani.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ struct ar5416AniState {
u32 listenTime;
int32_t rssiThrLow;
int32_t rssiThrHigh;
u32 noiseFloor;
u32 ofdmPhyErrCount;
u32 cckPhyErrCount;
int16_t pktRssi[2];
Expand Down

0 comments on commit 35e808b

Please sign in to comment.