linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] ath9k_hw: remove ATH9K_CAP_CIPHER
@ 2010-06-12 15:22 Felix Fietkau
  2010-06-12 15:22 ` [PATCH 2/7] ath9k_hw: remove ATH9K_CAP_TXPOW Felix Fietkau
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

All of the ciphers that are tested for are always supported

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 947de70..a26bc56 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -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 */
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 5a2e72a..94f1258 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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:
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index d60472b..cc01dc8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -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,
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index e1fa268..8bb866d 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -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 */
-- 
1.6.4.2


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

* [PATCH 2/7] ath9k_hw: remove ATH9K_CAP_TXPOW
  2010-06-12 15:22 [PATCH 1/7] ath9k_hw: remove ATH9K_CAP_CIPHER Felix Fietkau
@ 2010-06-12 15:22 ` Felix Fietkau
  2010-06-12 15:22   ` [PATCH 3/7] ath9k_hw: remove ATH9K_CAP_TKIP_MIC Felix Fietkau
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

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

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index c4d022a..312ff1b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -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;
 	}
 }
 
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 94f1258..d908f78 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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))
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index cc01dc8..7456850 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -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
 };
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 7b2f4a7..69b2e3b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -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;
 	}
 }
 
-- 
1.6.4.2


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

* [PATCH 3/7] ath9k_hw: remove ATH9K_CAP_TKIP_MIC
  2010-06-12 15:22 ` [PATCH 2/7] ath9k_hw: remove ATH9K_CAP_TXPOW Felix Fietkau
@ 2010-06-12 15:22   ` Felix Fietkau
  2010-06-12 15:22     ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Felix Fietkau
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

TKIP MIC support is always enabled anyway.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index a26bc56..03100e3 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -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
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index d908f78..f1d9918 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 7456850..5574daa 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -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
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 8bb866d..f66b357 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -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
-- 
1.6.4.2


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

* [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
  2010-06-12 15:22   ` [PATCH 3/7] ath9k_hw: remove ATH9K_CAP_TKIP_MIC Felix Fietkau
@ 2010-06-12 15:22     ` Felix Fietkau
  2010-06-12 15:22       ` [PATCH 5/7] ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH Felix Fietkau
  2010-06-12 17:28       ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Pavel Roskin
  0 siblings, 2 replies; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

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

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 03100e3..5190a88 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -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,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f1d9918..a5203b1 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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:
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 5574daa..28fca9d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -207,7 +207,6 @@ enum ath9k_hw_caps {
 };
 
 enum ath9k_capability_type {
-	ATH9K_CAP_TKIP_SPLIT,
 	ATH9K_CAP_MCAST_KEYSRCH,
 	ATH9K_CAP_DS
 };
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index f66b357..4bdf8c8 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -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 */
-- 
1.6.4.2


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

* [PATCH 5/7] ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH
  2010-06-12 15:22     ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Felix Fietkau
@ 2010-06-12 15:22       ` Felix Fietkau
  2010-06-12 15:22         ` [PATCH 6/7] ath9k/ath9k_htc: remove redundand checks for dual-stream tx support Felix Fietkau
  2010-06-12 17:28       ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Pavel Roskin
  1 sibling, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

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.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 5190a88..d339e5f 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -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)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index a5203b1..9321931 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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 */
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 28fca9d..16b35cd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -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 */
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 4bdf8c8..514a401 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -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)
-- 
1.6.4.2


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

* [PATCH 6/7] ath9k/ath9k_htc: remove redundand checks for dual-stream tx support
  2010-06-12 15:22       ` [PATCH 5/7] ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH Felix Fietkau
@ 2010-06-12 15:22         ` Felix Fietkau
  2010-06-12 15:22           ` [PATCH 7/7] ath9k_hw: remove ATH9K_CAP_DS Felix Fietkau
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

mac80211 already masks the HT sta capabilities based on hardware support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 312ff1b..c0aafa7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -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) &&
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 02b6052..600ee0b 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -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)
-- 
1.6.4.2


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

* [PATCH 7/7] ath9k_hw: remove ATH9K_CAP_DS
  2010-06-12 15:22         ` [PATCH 6/7] ath9k/ath9k_htc: remove redundand checks for dual-stream tx support Felix Fietkau
@ 2010-06-12 15:22           ` Felix Fietkau
  0 siblings, 0 replies; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 15:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: lrodriguez, linville

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

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/hw.c |   15 ---------------
 drivers/net/wireless/ath/ath9k/hw.h |    6 ------
 2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9321931..62597f4 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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 */
 /****************************/
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 16b35cd..5ecbfcf 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -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 */
-- 
1.6.4.2


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

* Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
  2010-06-12 15:22     ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Felix Fietkau
  2010-06-12 15:22       ` [PATCH 5/7] ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH Felix Fietkau
@ 2010-06-12 17:28       ` Pavel Roskin
  2010-06-12 17:36         ` Felix Fietkau
  1 sibling, 1 reply; 10+ messages in thread
From: Pavel Roskin @ 2010-06-12 17:28 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, lrodriguez, linville

On Sat, 2010-06-12 at 17:22 +0200, Felix Fietkau wrote:
> 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.

-- 
Regards,
Pavel Roskin

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

* Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
  2010-06-12 17:28       ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Pavel Roskin
@ 2010-06-12 17:36         ` Felix Fietkau
  2010-06-12 17:46           ` Pavel Roskin
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Fietkau @ 2010-06-12 17:36 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, lrodriguez, linville

On 2010-06-12 7:28 PM, Pavel Roskin wrote:
> On Sat, 2010-06-12 at 17:22 +0200, Felix Fietkau wrote:
>> 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

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

* Re: [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
  2010-06-12 17:36         ` Felix Fietkau
@ 2010-06-12 17:46           ` Pavel Roskin
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Roskin @ 2010-06-12 17:46 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, lrodriguez, linville

On Sat, 2010-06-12 at 19:36 +0200, Felix Fietkau wrote:
> On 2010-06-12 7:28 PM, Pavel Roskin wrote:
> > On Sat, 2010-06-12 at 17:22 +0200, Felix Fietkau wrote:
> >> 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.

-- 
Regards,
Pavel Roskin

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

end of thread, other threads:[~2010-06-12 17:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-12 15:22 [PATCH 1/7] ath9k_hw: remove ATH9K_CAP_CIPHER Felix Fietkau
2010-06-12 15:22 ` [PATCH 2/7] ath9k_hw: remove ATH9K_CAP_TXPOW Felix Fietkau
2010-06-12 15:22   ` [PATCH 3/7] ath9k_hw: remove ATH9K_CAP_TKIP_MIC Felix Fietkau
2010-06-12 15:22     ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Felix Fietkau
2010-06-12 15:22       ` [PATCH 5/7] ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH Felix Fietkau
2010-06-12 15:22         ` [PATCH 6/7] ath9k/ath9k_htc: remove redundand checks for dual-stream tx support Felix Fietkau
2010-06-12 15:22           ` [PATCH 7/7] ath9k_hw: remove ATH9K_CAP_DS Felix Fietkau
2010-06-12 17:28       ` [PATCH 4/7] ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT Pavel Roskin
2010-06-12 17:36         ` Felix Fietkau
2010-06-12 17:46           ` Pavel Roskin

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).