ath9k_hw: remove aniState->noiseFloor
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>
This commit is contained in:
committed by
John W. Linville
parent
a769f95772
commit
35e808b7e4
@@ -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_ofdm_level_entry *entry_ofdm;
|
||||||
const struct ani_cck_level_entry *entry_cck;
|
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",
|
ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
|
||||||
aniState->ofdmNoiseImmunityLevel,
|
aniState->ofdmNoiseImmunityLevel,
|
||||||
immunityLevel, aniState->noiseFloor,
|
immunityLevel, BEACON_RSSI(ah),
|
||||||
aniState->rssiThrLow, aniState->rssiThrHigh);
|
aniState->rssiThrLow, aniState->rssiThrHigh);
|
||||||
|
|
||||||
if (aniState->update_ani)
|
if (aniState->update_ani)
|
||||||
@@ -292,7 +290,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
|
|||||||
ATH9K_ANI_FIRSTEP_LEVEL,
|
ATH9K_ANI_FIRSTEP_LEVEL,
|
||||||
entry_ofdm->fir_step_level);
|
entry_ofdm->fir_step_level);
|
||||||
|
|
||||||
if ((aniState->noiseFloor >= aniState->rssiThrHigh) &&
|
if (BEACON_RSSI(ah) >= aniState->rssiThrHigh &&
|
||||||
(!aniState->ofdmWeakSigDetectOff !=
|
(!aniState->ofdmWeakSigDetectOff !=
|
||||||
entry_ofdm->ofdm_weak_signal_on)) {
|
entry_ofdm->ofdm_weak_signal_on)) {
|
||||||
ath9k_hw_ani_control(ah,
|
ath9k_hw_ani_control(ah,
|
||||||
@@ -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_ofdm_level_entry *entry_ofdm;
|
||||||
const struct ani_cck_level_entry *entry_cck;
|
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",
|
ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n",
|
||||||
aniState->cckNoiseImmunityLevel, immunityLevel,
|
aniState->cckNoiseImmunityLevel, immunityLevel,
|
||||||
aniState->noiseFloor, aniState->rssiThrLow,
|
BEACON_RSSI(ah), aniState->rssiThrLow,
|
||||||
aniState->rssiThrHigh);
|
aniState->rssiThrHigh);
|
||||||
|
|
||||||
if ((ah->opmode == NL80211_IFTYPE_STATION ||
|
if ((ah->opmode == NL80211_IFTYPE_STATION ||
|
||||||
ah->opmode == NL80211_IFTYPE_ADHOC) &&
|
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)
|
||||||
immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
|
immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
|
||||||
|
|
||||||
|
@@ -128,7 +128,6 @@ struct ar5416AniState {
|
|||||||
u32 listenTime;
|
u32 listenTime;
|
||||||
int32_t rssiThrLow;
|
int32_t rssiThrLow;
|
||||||
int32_t rssiThrHigh;
|
int32_t rssiThrHigh;
|
||||||
u32 noiseFloor;
|
|
||||||
u32 ofdmPhyErrCount;
|
u32 ofdmPhyErrCount;
|
||||||
u32 cckPhyErrCount;
|
u32 cckPhyErrCount;
|
||||||
int16_t pktRssi[2];
|
int16_t pktRssi[2];
|
||||||
|
Reference in New Issue
Block a user