linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] ath9k_hw: remove aniState->noiseFloor
@ 2012-06-15 13:25 Felix Fietkau
  2012-06-15 13:25 ` [PATCH 2/9] ath9k_hw: fix OFDM weak signal detection handling Felix Fietkau
  0 siblings, 1 reply; 20+ messages in thread
From: Felix Fietkau @ 2012-06-15 13:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, mcgrof, c_manoha

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>
---
 drivers/net/wireless/ath/ath9k/ani.c |   11 ++++-------
 drivers/net/wireless/ath/ath9k/ani.h |    1 -
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index b4c77f9..18ce69d 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -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)
@@ -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,
@@ -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;
 
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 72e2b87..c04d167 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -128,7 +128,6 @@ struct ar5416AniState {
 	u32 listenTime;
 	int32_t rssiThrLow;
 	int32_t rssiThrHigh;
-	u32 noiseFloor;
 	u32 ofdmPhyErrCount;
 	u32 cckPhyErrCount;
 	int16_t pktRssi[2];
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-06-18 10:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 13:25 [PATCH 1/9] ath9k_hw: remove aniState->noiseFloor Felix Fietkau
2012-06-15 13:25 ` [PATCH 2/9] ath9k_hw: fix OFDM weak signal detection handling Felix Fietkau
2012-06-15 13:25   ` [PATCH 3/9] ath9k_hw: remove confusing logic inversion in an ANI variable Felix Fietkau
2012-06-15 13:25     ` [PATCH 4/9] ath9k_hw: clean up / fix ANI mode checks related to beacon RSSI Felix Fietkau
2012-06-15 13:25       ` [PATCH 5/9] ath9k_hw: remove the old ANI implementation Felix Fietkau
2012-06-15 13:25         ` [PATCH 6/9] ath9k_hw: clean up defines and variables from the ANI implementation split Felix Fietkau
2012-06-15 13:25           ` [PATCH 7/9] ath9k: remove MIB interrupt support Felix Fietkau
2012-06-15 13:25             ` [PATCH 8/9] ath9k_hw: fix setting lower noise immunity values Felix Fietkau
2012-06-15 13:25               ` [PATCH 9/9] ath9k_hw: clean up ANI OFDM trigger handling Felix Fietkau
2012-06-15 18:05               ` [PATCH 8/9] ath9k_hw: fix setting lower noise immunity values Rajkumar Manoharan
2012-06-15 17:58         ` [PATCH 5/9] ath9k_hw: remove the old ANI implementation Rajkumar Manoharan
2012-06-15 21:09           ` Felix Fietkau
2012-06-17  1:06         ` Sujith Manoharan
2012-06-17 14:36           ` Felix Fietkau
2012-06-18  8:36             ` Sujith Manoharan
2012-06-18 10:12             ` Sujith Manoharan
2012-06-15 17:49       ` [PATCH 4/9] ath9k_hw: clean up / fix ANI mode checks related to beacon RSSI Rajkumar Manoharan
2012-06-15 21:05         ` Felix Fietkau
2012-06-15 17:38   ` [PATCH 2/9] ath9k_hw: fix OFDM weak signal detection handling Rajkumar Manoharan
2012-06-15 21:05     ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).