Skip to contentSkip to conversation

ath9k: Fix enabling OFDM weak signal detection

PATCH New Steven Luo 4 participants 9 messages Jul 9, 2009 – Jul 15, 2009 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore

Steven Luo

author
#0 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Cc stable at kernel.org

---

drivers/net/wireless/ath/ath9k/ani.c +1 -1
@@ -482,7 +482,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
 		ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
-				     !ATH9K_ANI_USE_OFDM_WEAK_SIG);
+				     ATH9K_ANI_USE_OFDM_WEAK_SIG);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
 				     ATH9K_ANI_CCK_WEAK_SIG_THR);
 
#1 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

Quoted 9 lines · Steven Luo

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. ?Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

Quoted 6 lines

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Cc stable at kernel.org

---

NACK for now, please give us a chance to review this -- this may actually be correct.

Luis

Quoted 17 lines
drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-07-06 02:45:57.000000000 -0700 renamed from drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-06-24 21:14:00.000000000 -0700 +1 -1
@@ -482,7 +482,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?!ATH9K_ANI_USE_OFDM_WEAK_SIG);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ATH9K_ANI_USE_OFDM_WEAK_SIG);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ATH9K_ANI_CCK_WEAK_SIG_THR);
 

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

#2 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

Quoted 13 lines · Luis R. Rodriguez
Quoted 12 lines · Steven Luo

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. ?Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Quoted 6 lines
Quoted 3 lines
Cc stable at kernel.org

---

NACK for now, please give us a chance to review this -- this may actually be correct.

Benny, Jouni indicated this matches current Fusion, know Fusion correct? Do we know if AR5416 should have OFDM weak signal detection enabled after an ANI state reset? It seemed to help this particular user. Or do we know for sure it should be disabled for all 11n cards?

Since this may come up for legacy cards, how about for that case?

Luis

Quoted 20 lines

?Luis

Quoted 17 lines
drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-07-06 02:45:57.000000000 -0700 renamed from drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-06-24 21:14:00.000000000 -0700 +1 -1
@@ -482,7 +482,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?!ATH9K_ANI_USE_OFDM_WEAK_SIG);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ATH9K_ANI_USE_OFDM_WEAK_SIG);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ATH9K_ANI_CCK_WEAK_SIG_THR);
 

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

#3 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

In reply to Luis R. Rodriguez

2009/7/10 Luis R. Rodriguez <[email protected]>:

Quoted 22 lines · Steven Luo
Quoted 9 lines

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. ?Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

Quoted 6 lines

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Cc stable at kernel.org

---

NACK for now, please give us a chance to review this -- this may actually be correct.

?Luis

Quoted 12 lines

drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-07-06 02:45:57.000000000 -0700 void ath9k_ani_reset(struct ath_hw *ah) · line 488

Quoted 12 lines
drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-07-06 02:45:57.000000000 -0700 renamed from drivers/net/wireless/ath/ath9k/ani.c ? ? ?2009-06-24 21:14:00.000000000 -0700 +1 -1
@@ -482,7 +482,7 @@ void ath9k_ani_reset(struct ath_hw *ah)
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?!ATH9K_ANI_USE_OFDM_WEAK_SIG);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ATH9K_ANI_USE_OFDM_WEAK_SIG);
 ? ? ? ? ? ? ? ?ath9k_hw_ani_control(ah, ATH9K_ANI_CCK_WEAK_SIGNAL_THR,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ATH9K_ANI_CCK_WEAK_SIG_THR);
 

Does your AP operate on 2.4GHz band or 5GHz ?

Signature · 3 lines
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
#4 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

In reply to Luis R. Rodriguez
Quoted 13 lines · Luis R. Rodriguez
Quoted 12 lines · Steven Luo

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Quoted 6 lines
Quoted 3 lines
Cc stable at kernel.org

---

NACK for now, please give us a chance to review this -- this may actually be correct.

Please try this patch instead, I've only compile tested this.

From: Luis R. Rodriguez <[email protected]>
Subject: [PATCH] ath9k: Tune ANI function processing on AP mode during ANI reset

For AP mode we must tune ANI specially for 2 GHz and for 5 GHz. We mask in only the flags we want to toggle on ath9k_hw_ani_control() through the ah->ani_function bitmask, this will take care of ignoring changes during ANI reset which we were disabling before.

Cc Bennyam Malavazi <Bennyam.Malavazi at Atheros.com
Cc Jouni Malinen <[email protected]>
---
 drivers/net/wireless/ath/ath9k/ani.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/ani.c +13 -0
@@ -478,6 +478,19 @@ void ath9k_ani_reset(struct ath_hw *ah)
 			"Reset ANI state opmode %u\n", ah->opmode);
 		ah->stats.ast_ani_reset++;
 
+		if (ah->opmode == NL80211_IFTYPE_AP ||
+		    ah->opmode == NL80211_IFTYPE_AP) {
+			/*
+			 * ath9k_hw_ani_control() will only process items set on
+			 * ah->ani_function
+			 */
+			if (IS_CHAN_2GHZ(chan))
+				ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
+						    ATH9K_ANI_FIRSTEP_LEVEL);
+			else
+				ah->ani_function = 0;
+		}
+
 		ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
Signature · 1 line
1.6.3.3
#5 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

Quoted 14 lines · Luis Rodriguez
Quoted 13 lines · Luis R. Rodriguez
Quoted 12 lines · Steven Luo

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Cc stable at kernel.org

---

NACK for now, please give us a chance to review this -- this may actually be correct.

Please try this patch instead, I've only compile tested this.

Now without the double AP check :)

From: Luis R. Rodriguez <[email protected]>
Subject: [PATCH] ath9k: Tune ANI function processing on AP mode during ANI reset

For AP mode we must tune ANI specially for 2 GHz and for 5 GHz. We mask in only the flags we want to toggle on ath9k_hw_ani_control() through the ah->ani_function bitmask, this will take care of ignoring changes during ANI reset which we were disabling before.

Cc Bennyam Malavazi <Bennyam.Malavazi at Atheros.com
Cc Jouni Malinen <[email protected]>
---
 drivers/net/wireless/ath/ath9k/ani.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/ani.c +12 -0
@@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
 			"Reset ANI state opmode %u\n", ah->opmode);
 		ah->stats.ast_ani_reset++;
 
+		if (ah->opmode == NL80211_IFTYPE_AP) {
+			/*
+			 * ath9k_hw_ani_control() will only process items set on
+			 * ah->ani_function
+			 */
+			if (IS_CHAN_2GHZ(chan))
+				ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
+						    ATH9K_ANI_FIRSTEP_LEVEL);
+			else
+				ah->ani_function = 0;
+		}
+
 		ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
Signature · 1 line
1.6.3.3
author
#6 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

Quoted 2 lines · Luis R. Rodriguez
Quoted 1 line · Luis Rodriguez

Please try this patch instead, I've only compile tested this.

Yeah, this works too. Thanks!

-Steven Luo

Quoted 43 lines

Now without the double AP check :)

From: Luis R. Rodriguez <[email protected]>
Subject: [PATCH] ath9k: Tune ANI function processing on AP mode during ANI reset

For AP mode we must tune ANI specially for 2 GHz and for 5 GHz. We mask in only the flags we want to toggle on ath9k_hw_ani_control() through the ah->ani_function bitmask, this will take care of ignoring changes during ANI reset which we were disabling before.

---
 drivers/net/wireless/ath/ath9k/ani.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/ani.c +12 -0
@@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
 			"Reset ANI state opmode %u\n", ah->opmode);
 		ah->stats.ast_ani_reset++;
 
+		if (ah->opmode == NL80211_IFTYPE_AP) {
+			/*
+			 * ath9k_hw_ani_control() will only process items set on
+			 * ah->ani_function
+			 */
+			if (IS_CHAN_2GHZ(chan))
+				ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
+						    ATH9K_ANI_FIRSTEP_LEVEL);
+			else
+				ah->ani_function = 0;
+		}
+
 		ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
 		ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
Signature · 1 line
1.6.3.3
#7 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

In reply to Steven Luo

2009/7/10 Steven Luo <[email protected]>:

Quoted 9 lines

From: Steven Luo <[email protected]>

It seems that OFDM weak signal detection should be enabled after an ANI state reset, as indicated by the initial setting of ofdmWeakSigDetectOff and what the open Atheros HAL does. ?Unfortunately, the reversed sense of ofdmWeakSigDetectOff (true if weak signal detection is NOT enabled) seems to have resulted in a mixup here, causing weak signal detection to be disabled.

Quoted 3 lines

This patch significantly improves reception and throughput from distant stations for my AR5416-based AP running compat-wireless 2009-06-25.

(sorry, bad reply to all)

Does your AP operate on 2.4GHz band or 5GHz ?

Signature · 3 lines
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
author
#8 lore raw

PATCH 1/1 ath9k: Fix enabling OFDM weak signal detection

Quoted 1 line · Nick Kossifidis

Does your AP operate on 2.4GHz band or 5GHz ?

2.4 GHz -- my card doesn't support 5 GHz operation.

-Steven Luo