Skip to contentSkip to conversation

ath9k: fix checks for first subframe delimiter padding

PATCH Superseded Felix Fietkau 2 participants 2 messages Aug 29, 2011 Qualcomm Atheros ATH9K wireless driver

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ath9k: fix checks for first subframe delimiter padding

The commit "ath9k_hw: Fix exceed transmission burst-time of 5GHz" added a padding of 60 delimiters on the first subframe to work around an issue on AR9380, but it lacked the checks to prevent it from being applied to pre-AR9380, enterprise AR9380 or AR9580+

Cc Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath9k/reg.h  |    2 +-
 drivers/net/wireless/ath/ath9k/xmit.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/reg.h +1 -1
index a3b8bbc..02363c1 100644
@@ -1131,7 +1131,7 @@ enum {
 #define AR_INTR_PRIO_ASYNC_ENABLE (AR_SREV_9340(ah) ? 0x4094 : 0x40d4)
 #define AR_ENT_OTP		  0x40d8
 #define AR_ENT_OTP_CHAIN2_DISABLE               0x00020000
-#define AR_ENT_OTP_MPSD		0x00800000
+#define AR_ENT_OTP_MIN_PKT_SIZE_DISABLE		0x00800000
 
 #define AR_CH0_BB_DPLL1		 0x16180
 #define AR_CH0_BB_DPLL1_REFDIV	 0xF8000000
drivers/net/wireless/ath/ath9k/xmit.c +3 -1
index 5e29829..ad3fcd2 100644
@@ -692,7 +692,9 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid,
 	 * Add delimiter when using RTS/CTS with aggregation
 	 * and non enterprise AR9003 card
 	 */
-	if (first_subfrm)
+	if (first_subfrm && (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
+	    !AR_SREV_9580_10_OR_LATER(sc->sc_ah) &&
+	    (sc->sc_ah->ent_mode & AR_ENT_OTP_MIN_PKT_SIZE_DISABLE))
 		ndelim = max(ndelim, FIRST_DESC_NDELIMS);
 
 	/*
Signature · 1 line
1.7.3.2
#1 lore raw
Quoted 30 lines · Felix Fietkau

The commit "ath9k_hw: Fix exceed transmission burst-time of 5GHz" added a padding of 60 delimiters on the first subframe to work around an issue on AR9380, but it lacked the checks to prevent it from being applied to pre-AR9380, enterprise AR9380 or AR9580+

Cc Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath9k/reg.h  |    2 +-
 drivers/net/wireless/ath/ath9k/xmit.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/reg.h +1 -1
index a3b8bbc..02363c1 100644
@@ -1131,7 +1131,7 @@ enum {
 #define AR_INTR_PRIO_ASYNC_ENABLE (AR_SREV_9340(ah) ? 0x4094 : 0x40d4)
 #define AR_ENT_OTP		  0x40d8
 #define AR_ENT_OTP_CHAIN2_DISABLE               0x00020000
-#define AR_ENT_OTP_MPSD		0x00800000
+#define AR_ENT_OTP_MIN_PKT_SIZE_DISABLE		0x00800000
 
 #define AR_CH0_BB_DPLL1		 0x16180
 #define AR_CH0_BB_DPLL1_REFDIV	 0xF8000000
drivers/net/wireless/ath/ath9k/xmit.c +0 -0
index 5e29829..ad3fcd2 100644

drivers/net/wireless/ath/ath9k/xmit.c static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, · line 698

Quoted 8 lines
drivers/net/wireless/ath/ath9k/xmit.c +3 -1
@@ -692,7 +692,9 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid,
 	 * Add delimiter when using RTS/CTS with aggregation
 	 * and non enterprise AR9003 card
 	 */
-	if (first_subfrm)
+	if (first_subfrm && (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
+	    !AR_SREV_9580_10_OR_LATER(sc->sc_ah) &&
+	    (sc->sc_ah->ent_mode & AR_ENT_OTP_MIN_PKT_SIZE_DISABLE))
 		ndelim = max(ndelim, FIRST_DESC_NDELIMS);

Sorry for the regression and thanks for the fix Felix.
The ent_mode is valid only for EDMA chips. hw_cap check in not needed.

--
Rajkumar