Skip to contentSkip to conversation

ath9k_hw: remove ATH9K_CAP_CIPHER

PATCH In review Felix Fietkau 2 participants 10 messages Jun 12, 2010 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 ath9k_hw: remove ATH9K_CAP_CIPHER

All of the ciphers that are tested for are always supported

---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |   24 ++++++++----------------
 drivers/net/wireless/ath/ath9k/hw.c           |   12 ------------
 drivers/net/wireless/ath/ath9k/hw.h           |    1 -
 drivers/net/wireless/ath/ath9k/init.c         |   24 ++++++++----------------
 4 files changed, 16 insertions(+), 45 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +8 -16
index 947de70..a26bc56 100644
@@ -570,16 +570,13 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
 	for (i = 0; i < common->keymax; i++)
 		ath9k_hw_keyreset(priv->ah, (u16) i);
 
-	if (ath9k_hw_getcapability(priv->ah, ATH9K_CAP_CIPHER,
-				   ATH9K_CIPHER_TKIP, NULL)) {
-		/*
-		 * Whether we should enable h/w TKIP MIC.
-		 * XXX: if we don't support WME TKIP MIC, then we wouldn't
-		 * report WMM capable, so it's always safe to turn on
-		 * TKIP MIC in this case.
-		 */
-		ath9k_hw_setcapability(priv->ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
-	}
+	/*
+	 * Whether we should enable h/w TKIP MIC.
+	 * XXX: if we don't support WME TKIP MIC, then we wouldn't
+	 * report WMM capable, so it's always safe to turn on
+	 * TKIP MIC in this case.
+	 */
+	ath9k_hw_setcapability(priv->ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
 
 	/*
 	 * Check whether the separate key cache entries
@@ -587,12 +584,7 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
 	 * With split mic keys the number of stations is limited
 	 * to 27 otherwise 59.
 	 */
-	if (ath9k_hw_getcapability(priv->ah, ATH9K_CAP_CIPHER,
-				   ATH9K_CIPHER_TKIP, NULL)
-	    && ath9k_hw_getcapability(priv->ah, ATH9K_CAP_CIPHER,
-				      ATH9K_CIPHER_MIC, NULL)
-	    && ath9k_hw_getcapability(priv->ah, ATH9K_CAP_TKIP_SPLIT,
-				      0, NULL))
+	if (ath9k_hw_getcapability(priv->ah, ATH9K_CAP_TKIP_SPLIT, 0, NULL))
 		common->splitmic = 1;
 
 	/* turn on mcast key search if possible */
drivers/net/wireless/ath/ath9k/hw.c +0 -12
index 5a2e72a..94f1258 100644
@@ -2260,18 +2260,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 {
 	struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
 	switch (type) {
-	case ATH9K_CAP_CIPHER:
-		switch (capability) {
-		case ATH9K_CIPHER_AES_CCM:
-		case ATH9K_CIPHER_AES_OCB:
-		case ATH9K_CIPHER_TKIP:
-		case ATH9K_CIPHER_WEP:
-		case ATH9K_CIPHER_MIC:
-		case ATH9K_CIPHER_CLR:
-			return true;
-		default:
-			return false;
-		}
 	case ATH9K_CAP_TKIP_MIC:
 		switch (capability) {
 		case 0:
drivers/net/wireless/ath/ath9k/hw.h +0 -1
index d60472b..cc01dc8 100644
@@ -207,7 +207,6 @@ enum ath9k_hw_caps {
 };
 
 enum ath9k_capability_type {
-	ATH9K_CAP_CIPHER = 0,
 	ATH9K_CAP_TKIP_MIC,
 	ATH9K_CAP_TKIP_SPLIT,
 	ATH9K_CAP_TXPOW,
drivers/net/wireless/ath/ath9k/init.c +8 -16
index e1fa268..8bb866d 100644
@@ -379,16 +379,13 @@ static void ath9k_init_crypto(struct ath_softc *sc)
 	for (i = 0; i < common->keymax; i++)
 		ath9k_hw_keyreset(sc->sc_ah, (u16) i);
 
-	if (ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_CIPHER,
-				   ATH9K_CIPHER_TKIP, NULL)) {
-		/*
-		 * Whether we should enable h/w TKIP MIC.
-		 * XXX: if we don't support WME TKIP MIC, then we wouldn't
-		 * report WMM capable, so it's always safe to turn on
-		 * TKIP MIC in this case.
-		 */
-		ath9k_hw_setcapability(sc->sc_ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
-	}
+	/*
+	 * Whether we should enable h/w TKIP MIC.
+	 * XXX: if we don't support WME TKIP MIC, then we wouldn't
+	 * report WMM capable, so it's always safe to turn on
+	 * TKIP MIC in this case.
+	 */
+	ath9k_hw_setcapability(sc->sc_ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
 
 	/*
 	 * Check whether the separate key cache entries
@@ -396,12 +393,7 @@ static void ath9k_init_crypto(struct ath_softc *sc)
 	 * With split mic keys the number of stations is limited
 	 * to 27 otherwise 59.
 	 */
-	if (ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_CIPHER,
-				   ATH9K_CIPHER_TKIP, NULL)
-	    && ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_CIPHER,
-				      ATH9K_CIPHER_MIC, NULL)
-	    && ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_TKIP_SPLIT,
-				      0, NULL))
+	if (ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_TKIP_SPLIT, 0, NULL))
 		common->splitmic = 1;
 
 	/* turn on mcast key search if possible */
Signature · 1 line
1.6.4.2
#1 lore raw

PATCH 2/7 ath9k_hw: remove ATH9K_CAP_TXPOW

replace calls that read this capability with accesses to ath9k_hw's regulatory data.

---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |    4 +---
 drivers/net/wireless/ath/ath9k/hw.c           |   16 ----------------
 drivers/net/wireless/ath/ath9k/hw.h           |    1 -
 drivers/net/wireless/ath/ath9k/main.c         |    4 +---
 4 files changed, 2 insertions(+), 23 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1 -3
index c4d022a..312ff1b 100644
@@ -27,13 +27,11 @@ static struct dentry *ath9k_debugfs_root;
 static void ath_update_txpow(struct ath9k_htc_priv *priv)
 {
 	struct ath_hw *ah = priv->ah;
-	u32 txpow;
 
 	if (priv->curtxpow != priv->txpowlimit) {
 		ath9k_hw_set_txpowerlimit(ah, priv->txpowlimit);
 		/* read back in case value is clamped */
-		ath9k_hw_getcapability(ah, ATH9K_CAP_TXPOW, 1, &txpow);
-		priv->curtxpow = txpow;
+		priv->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
 	}
 }
 
drivers/net/wireless/ath/ath9k/hw.c +0 -16
index 94f1258..d908f78 100644
@@ -2258,7 +2258,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 *result)
 {
-	struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
 	switch (type) {
 	case ATH9K_CAP_TKIP_MIC:
 		switch (capability) {
@@ -2286,21 +2285,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			}
 		}
 		return false;
-	case ATH9K_CAP_TXPOW:
-		switch (capability) {
-		case 0:
-			return 0;
-		case 1:
-			*result = regulatory->power_limit;
-			return 0;
-		case 2:
-			*result = regulatory->max_power_level;
-			return 0;
-		case 3:
-			*result = regulatory->tp_scale;
-			return 0;
-		}
-		return false;
 	case ATH9K_CAP_DS:
 		return (AR_SREV_9280_20_OR_LATER(ah) &&
 			(ah->eep_ops->get_eeprom(ah, EEP_RC_CHAIN_MASK) == 1))
drivers/net/wireless/ath/ath9k/hw.h +0 -1
index cc01dc8..7456850 100644
@@ -209,7 +209,6 @@ enum ath9k_hw_caps {
 enum ath9k_capability_type {
 	ATH9K_CAP_TKIP_MIC,
 	ATH9K_CAP_TKIP_SPLIT,
-	ATH9K_CAP_TXPOW,
 	ATH9K_CAP_MCAST_KEYSRCH,
 	ATH9K_CAP_DS
 };
drivers/net/wireless/ath/ath9k/main.c +1 -3
index 7b2f4a7..69b2e3b 100644
@@ -51,13 +51,11 @@ static void ath_cache_conf_rate(struct ath_softc *sc,
 static void ath_update_txpow(struct ath_softc *sc)
 {
 	struct ath_hw *ah = sc->sc_ah;
-	u32 txpow;
 
 	if (sc->curtxpow != sc->config.txpowlimit) {
 		ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit);
 		/* read back in case value is clamped */
-		ath9k_hw_getcapability(ah, ATH9K_CAP_TXPOW, 1, &txpow);
-		sc->curtxpow = txpow;
+		sc->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
 	}
 }
 
Signature · 1 line
1.6.4.2
#2 lore raw

PATCH 3/7 ath9k_hw: remove ATH9K_CAP_TKIP_MIC

TKIP MIC support is always enabled anyway.

---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |    8 --------
 drivers/net/wireless/ath/ath9k/hw.c           |   17 -----------------
 drivers/net/wireless/ath/ath9k/hw.h           |    1 -
 drivers/net/wireless/ath/ath9k/init.c         |    8 --------
 4 files changed, 0 insertions(+), 34 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +0 -8
index a26bc56..03100e3 100644
@@ -571,14 +571,6 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
 		ath9k_hw_keyreset(priv->ah, (u16) i);
 
 	/*
-	 * Whether we should enable h/w TKIP MIC.
-	 * XXX: if we don't support WME TKIP MIC, then we wouldn't
-	 * report WMM capable, so it's always safe to turn on
-	 * TKIP MIC in this case.
-	 */
-	ath9k_hw_setcapability(priv->ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
-
-	/*
 	 * Check whether the separate key cache entries
 	 * are required to handle both tx+rx MIC keys.
 	 * With split mic keys the number of stations is limited
drivers/net/wireless/ath/ath9k/hw.c +0 -17
index d908f78..f1d9918 100644
@@ -2259,15 +2259,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 *result)
 {
 	switch (type) {
-	case ATH9K_CAP_TKIP_MIC:
-		switch (capability) {
-		case 0:
-			return true;
-		case 1:
-			return (ah->sta_id1_defaults &
-				AR_STA_ID1_CRPT_MIC_ENABLE) ? true :
-			false;
-		}
 	case ATH9K_CAP_TKIP_SPLIT:
 		return (ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA) ?
 			false : true;
@@ -2299,14 +2290,6 @@ bool ath9k_hw_setcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 setting, int *status)
 {
 	switch (type) {
-	case ATH9K_CAP_TKIP_MIC:
-		if (setting)
-			ah->sta_id1_defaults |=
-				AR_STA_ID1_CRPT_MIC_ENABLE;
-		else
-			ah->sta_id1_defaults &=
-				~AR_STA_ID1_CRPT_MIC_ENABLE;
-		return true;
 	case ATH9K_CAP_MCAST_KEYSRCH:
 		if (setting)
 			ah->sta_id1_defaults |= AR_STA_ID1_MCAST_KSRCH;
drivers/net/wireless/ath/ath9k/hw.h +0 -1
index 7456850..5574daa 100644
@@ -207,7 +207,6 @@ enum ath9k_hw_caps {
 };
 
 enum ath9k_capability_type {
-	ATH9K_CAP_TKIP_MIC,
 	ATH9K_CAP_TKIP_SPLIT,
 	ATH9K_CAP_MCAST_KEYSRCH,
 	ATH9K_CAP_DS
drivers/net/wireless/ath/ath9k/init.c +0 -8
index 8bb866d..f66b357 100644
@@ -380,14 +380,6 @@ static void ath9k_init_crypto(struct ath_softc *sc)
 		ath9k_hw_keyreset(sc->sc_ah, (u16) i);
 
 	/*
-	 * Whether we should enable h/w TKIP MIC.
-	 * XXX: if we don't support WME TKIP MIC, then we wouldn't
-	 * report WMM capable, so it's always safe to turn on
-	 * TKIP MIC in this case.
-	 */
-	ath9k_hw_setcapability(sc->sc_ah, ATH9K_CAP_TKIP_MIC, 0, 1, NULL);
-
-	/*
 	 * Check whether the separate key cache entries
 	 * are required to handle both tx+rx MIC keys.
 	 * With split mic keys the number of stations is limited
Signature · 1 line
1.6.4.2
#3 lore raw

PATCH 4/7 ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT

This is only used as a workaround for an issue in one specific hw revision.

---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |    9 ---------
 drivers/net/wireless/ath/ath9k/hw.c           |    3 ---
 drivers/net/wireless/ath/ath9k/hw.h           |    1 -
 drivers/net/wireless/ath/ath9k/init.c         |    2 +-
 4 files changed, 1 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +0 -9
index 03100e3..5190a88 100644
@@ -570,15 +570,6 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
 	for (i = 0; i < common->keymax; i++)
 		ath9k_hw_keyreset(priv->ah, (u16) i);
 
-	/*
-	 * Check whether the separate key cache entries
-	 * are required to handle both tx+rx MIC keys.
-	 * With split mic keys the number of stations is limited
-	 * to 27 otherwise 59.
-	 */
-	if (ath9k_hw_getcapability(priv->ah, ATH9K_CAP_TKIP_SPLIT, 0, NULL))
-		common->splitmic = 1;
-
 	/* turn on mcast key search if possible */
 	if (!ath9k_hw_getcapability(priv->ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL))
 		(void)ath9k_hw_setcapability(priv->ah, ATH9K_CAP_MCAST_KEYSRCH,
drivers/net/wireless/ath/ath9k/hw.c +0 -3
index f1d9918..a5203b1 100644
@@ -2259,9 +2259,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 *result)
 {
 	switch (type) {
-	case ATH9K_CAP_TKIP_SPLIT:
-		return (ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA) ?
-			false : true;
 	case ATH9K_CAP_MCAST_KEYSRCH:
 		switch (capability) {
 		case 0:
drivers/net/wireless/ath/ath9k/hw.h +0 -1
index 5574daa..28fca9d 100644
@@ -207,7 +207,6 @@ enum ath9k_hw_caps {
 };
 
 enum ath9k_capability_type {
-	ATH9K_CAP_TKIP_SPLIT,
 	ATH9K_CAP_MCAST_KEYSRCH,
 	ATH9K_CAP_DS
 };
drivers/net/wireless/ath/ath9k/init.c +1 -1
index f66b357..4bdf8c8 100644
@@ -385,7 +385,7 @@ static void ath9k_init_crypto(struct ath_softc *sc)
 	 * With split mic keys the number of stations is limited
 	 * to 27 otherwise 59.
 	 */
-	if (ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_TKIP_SPLIT, 0, NULL))
+	if (!(sc->sc_ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA))
 		common->splitmic = 1;
 
 	/* turn on mcast key search if possible */
Signature · 1 line
1.6.4.2
#4 lore raw

PATCH 5/7 ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH

The driver always sets this to enabled, but this can be simplified with a small change to ah->sta_id1_defaults instead.
This change also removes the now-obsolete ath9k_hw_setcapability function.

---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |    5 ----
 drivers/net/wireless/ath/ath9k/hw.c           |   33 ++----------------------
 drivers/net/wireless/ath/ath9k/hw.h           |    3 --
 drivers/net/wireless/ath/ath9k/init.c         |    6 ----
 4 files changed, 3 insertions(+), 44 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +0 -5
index 5190a88..d339e5f 100644
@@ -569,11 +569,6 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
 	 */
 	for (i = 0; i < common->keymax; i++)
 		ath9k_hw_keyreset(priv->ah, (u16) i);
-
-	/* turn on mcast key search if possible */
-	if (!ath9k_hw_getcapability(priv->ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL))
-		(void)ath9k_hw_setcapability(priv->ah, ATH9K_CAP_MCAST_KEYSRCH,
-					     1, 1, NULL);
 }
 
 static void ath9k_init_channels_rates(struct ath9k_htc_priv *priv)
drivers/net/wireless/ath/ath9k/hw.c +3 -30
index a5203b1..9321931 100644
@@ -425,7 +425,9 @@ static void ath9k_hw_init_defaults(struct ath_hw *ah)
 		ah->ah_flags = AH_USE_EEPROM;
 
 	ah->atim_window = 0;
-	ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
+	ah->sta_id1_defaults =
+		AR_STA_ID1_CRPT_MIC_ENABLE |
+		AR_STA_ID1_MCAST_KSRCH;
 	ah->beacon_interval = 100;
 	ah->enable_32kHz_clock = DONT_USE_32KHZ;
 	ah->slottime = (u32) -1;
@@ -2259,20 +2261,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 *result)
 {
 	switch (type) {
-	case ATH9K_CAP_MCAST_KEYSRCH:
-		switch (capability) {
-		case 0:
-			return true;
-		case 1:
-			if (REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_ADHOC) {
-				return false;
-			} else {
-				return (ah->sta_id1_defaults &
-					AR_STA_ID1_MCAST_KSRCH) ? true :
-					false;
-			}
-		}
-		return false;
 	case ATH9K_CAP_DS:
 		return (AR_SREV_9280_20_OR_LATER(ah) &&
 			(ah->eep_ops->get_eeprom(ah, EEP_RC_CHAIN_MASK) == 1))
@@ -2283,21 +2271,6 @@ bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 }
 EXPORT_SYMBOL(ath9k_hw_getcapability);
 
-bool ath9k_hw_setcapability(struct ath_hw *ah, enum ath9k_capability_type type,
-			    u32 capability, u32 setting, int *status)
-{
-	switch (type) {
-	case ATH9K_CAP_MCAST_KEYSRCH:
-		if (setting)
-			ah->sta_id1_defaults |= AR_STA_ID1_MCAST_KSRCH;
-		else
-			ah->sta_id1_defaults &= ~AR_STA_ID1_MCAST_KSRCH;
-		return true;
-	default:
-		return false;
-	}
-}
-EXPORT_SYMBOL(ath9k_hw_setcapability);
 
 /****************************/
 /* GPIO / RFKILL / Antennae */
drivers/net/wireless/ath/ath9k/hw.h +0 -3
index 28fca9d..16b35cd 100644
@@ -207,7 +207,6 @@ enum ath9k_hw_caps {
 };
 
 enum ath9k_capability_type {
-	ATH9K_CAP_MCAST_KEYSRCH,
 	ATH9K_CAP_DS
 };
 
@@ -855,8 +854,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 int ath9k_hw_fill_cap_info(struct ath_hw *ah);
 bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
 			    u32 capability, u32 *result);
-bool ath9k_hw_setcapability(struct ath_hw *ah, enum ath9k_capability_type type,
-			    u32 capability, u32 setting, int *status);
 u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan);
 
 /* Key Cache Management */
drivers/net/wireless/ath/ath9k/init.c +0 -6
index 4bdf8c8..514a401 100644
@@ -387,12 +387,6 @@ static void ath9k_init_crypto(struct ath_softc *sc)
 	 */
 	if (!(sc->sc_ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA))
 		common->splitmic = 1;
-
-	/* turn on mcast key search if possible */
-	if (!ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL))
-		(void)ath9k_hw_setcapability(sc->sc_ah, ATH9K_CAP_MCAST_KEYSRCH,
-					     1, 1, NULL);
-
 }
 
 static int ath9k_init_btcoex(struct ath_softc *sc)
Signature · 1 line
1.6.4.2
#5 lore raw

PATCH 6/7 ath9k/ath9k_htc: remove redundand checks for dual-stream tx support

mac80211 already masks the HT sta capabilities based on hardware support

---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |    7 ++-----
 drivers/net/wireless/ath/ath9k/rc.c           |    7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +2 -5
index 312ff1b..c0aafa7 100644
@@ -362,11 +362,8 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
 		trate->rates.ht_rates.rs_nrates = j;
 
 		caps = WLAN_RC_HT_FLAG;
-		if (priv->ah->caps.tx_chainmask != 1 &&
-		    ath9k_hw_getcapability(priv->ah, ATH9K_CAP_DS, 0, NULL)) {
-			if (sta->ht_cap.mcs.rx_mask[1])
-				caps |= WLAN_RC_DS_FLAG;
-		}
+		if (sta->ht_cap.mcs.rx_mask[1])
+			caps |= WLAN_RC_DS_FLAG;
 		if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
 			caps |= WLAN_RC_40_FLAG;
 		if (conf_is_ht40(&priv->hw->conf) &&
drivers/net/wireless/ath/ath9k/rc.c +2 -5
index 02b6052..600ee0b 100644
@@ -1203,11 +1203,8 @@ static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta,
 
 	if (sta->ht_cap.ht_supported) {
 		caps = WLAN_RC_HT_FLAG;
-		if (sc->sc_ah->caps.tx_chainmask != 1 &&
-		    ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_DS, 0, NULL)) {
-			if (sta->ht_cap.mcs.rx_mask[1])
-				caps |= WLAN_RC_DS_FLAG;
-		}
+		if (sta->ht_cap.mcs.rx_mask[1])
+			caps |= WLAN_RC_DS_FLAG;
 		if (is_cw40)
 			caps |= WLAN_RC_40_FLAG;
 		if (is_sgi)
Signature · 1 line
1.6.4.2
#6 lore raw

PATCH 7/7 ath9k_hw: remove ATH9K_CAP_DS

This capability check is no longer used, so it can be removed along with the now-obsolete ath9k_hw_getcapability function.

---
 drivers/net/wireless/ath/ath9k/hw.c |   15 ---------------
 drivers/net/wireless/ath/ath9k/hw.h |    6 ------
 2 files changed, 0 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +0 -15
index 9321931..62597f4 100644
@@ -2257,21 +2257,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 	return 0;
 }
 
-bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
-			    u32 capability, u32 *result)
-{
-	switch (type) {
-	case ATH9K_CAP_DS:
-		return (AR_SREV_9280_20_OR_LATER(ah) &&
-			(ah->eep_ops->get_eeprom(ah, EEP_RC_CHAIN_MASK) == 1))
-			? false : true;
-	default:
-		return false;
-	}
-}
-EXPORT_SYMBOL(ath9k_hw_getcapability);
-
-
 /****************************/
 /* GPIO / RFKILL / Antennae */
 /****************************/
drivers/net/wireless/ath/ath9k/hw.h +0 -6
index 16b35cd..5ecbfcf 100644
@@ -206,10 +206,6 @@ enum ath9k_hw_caps {
 	ATH9K_HW_CAP_PAPRD			= BIT(22),
 };
 
-enum ath9k_capability_type {
-	ATH9K_CAP_DS
-};
-
 struct ath9k_hw_capabilities {
 	u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
 	DECLARE_BITMAP(wireless_modes, ATH9K_MODE_MAX); /* ATH9K_MODE_* */
@@ -852,8 +848,6 @@ int ath9k_hw_init(struct ath_hw *ah);
 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 		   bool bChannelChange);
 int ath9k_hw_fill_cap_info(struct ath_hw *ah);
-bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,
-			    u32 capability, u32 *result);
 u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan);
 
 /* Key Cache Management */
Signature · 1 line
1.6.4.2
#7 lore raw

Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT

In reply to Felix Fietkau
Quoted 1 line · Felix Fietkau

This is only used as a workaround for an issue in one specific hw revision.

Is that workaround needed for both PCI and USB? If not, common->splitmic should not be needed and further cleanup should be possible.

Signature · 2 lines
Regards,
Pavel Roskin
#8 lore raw

Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT

Quoted 6 lines · Pavel Roskin
Quoted 1 line · Felix Fietkau

This is only used as a workaround for an issue in one specific hw revision.

Is that workaround needed for both PCI and USB? If not, common->splitmic should not be needed and further cleanup should be possible.

It's only needed for PCI.

- Felix

#9 lore raw

Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT

Quoted 8 lines · Felix Fietkau
Quoted 6 lines · Pavel Roskin
Quoted 1 line · Felix Fietkau

This is only used as a workaround for an issue in one specific hw revision.

Is that workaround needed for both PCI and USB? If not, common->splitmic should not be needed and further cleanup should be possible.

It's only needed for PCI.

Oh, I see that common->splitmic is used in common.c where misc_mode is not available. Then further simplification would not be as trivial as I though. Sorry for the noise.

Signature · 2 lines
Regards,
Pavel Roskin