linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ath5k: misc updates
@ 2009-08-25  3:00 Bob Copeland
  2009-08-25  3:00 ` [PATCH 1/4] ath5k: clean up filter flags setting Bob Copeland
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Bob Copeland @ 2009-08-25  3:00 UTC (permalink / raw)
  To: linville, jirislaby, mickflemm, lrodriguez
  Cc: linux-wireless, ath5k-devel, Bob Copeland

Hi John,

Here are a few patches that have been sitting around in my tree
for a while.  A cleanup or two, rxs conversion, and CCMP support.

Bob Copeland (4):
  ath5k: clean up filter flags setting
  ath5k: add led pin configuration for compaq c700 laptop
  ath5k: use the skb->cb directly for RX status
  ath5k: add hardware CCMP encyption support

 drivers/net/wireless/ath/ath5k/ath5k.h  |    1 +
 drivers/net/wireless/ath/ath5k/attach.c |   10 ++++
 drivers/net/wireless/ath/ath5k/base.c   |   83 +++++++++++++++++-------------
 drivers/net/wireless/ath/ath5k/led.c    |    2 +
 4 files changed, 60 insertions(+), 36 deletions(-)



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

* [PATCH 1/4] ath5k: clean up filter flags setting
  2009-08-25  3:00 [PATCH 0/4] ath5k: misc updates Bob Copeland
@ 2009-08-25  3:00 ` Bob Copeland
  2009-08-25  3:00 ` [PATCH 2/4] ath5k: add led pin configuration for compaq c700 laptop Bob Copeland
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Bob Copeland @ 2009-08-25  3:00 UTC (permalink / raw)
  To: linville, jirislaby, mickflemm, lrodriguez
  Cc: linux-wireless, ath5k-devel, Bob Copeland

The maze of if() statements in configure_filter is confusing.
Reorganizing it as a switch statement makes it more apparent what
is going on and reveals several suspicious settings.  This has no
functional changes, though it does remove some redundant flags
that are set earlier.

Also now that we can sleep, protect sc->filter_flags with the
sc lock.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/base.c |   39 +++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5056410..c4adf98 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2918,6 +2918,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
 	struct ath5k_hw *ah = sc->ah;
 	u32 mfilt[2], rfilt;
 
+	mutex_lock(&sc->lock);
+
 	mfilt[0] = multicast;
 	mfilt[1] = multicast >> 32;
 
@@ -2968,22 +2970,25 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
 
 	/* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */
 
-	if (sc->opmode == NL80211_IFTYPE_MONITOR)
-		rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
-			AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
-	if (sc->opmode != NL80211_IFTYPE_STATION)
-		rfilt |= AR5K_RX_FILTER_PROBEREQ;
-	if (sc->opmode != NL80211_IFTYPE_AP &&
-		sc->opmode != NL80211_IFTYPE_MESH_POINT &&
-		test_bit(ATH_STAT_PROMISC, sc->status))
-		rfilt |= AR5K_RX_FILTER_PROM;
-	if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) ||
-		sc->opmode == NL80211_IFTYPE_ADHOC ||
-		sc->opmode == NL80211_IFTYPE_AP)
-		rfilt |= AR5K_RX_FILTER_BEACON;
-	if (sc->opmode == NL80211_IFTYPE_MESH_POINT)
-		rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
-			AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
+	switch (sc->opmode) {
+	case NL80211_IFTYPE_MESH_POINT:
+	case NL80211_IFTYPE_MONITOR:
+		rfilt |= AR5K_RX_FILTER_CONTROL |
+			 AR5K_RX_FILTER_BEACON |
+			 AR5K_RX_FILTER_PROBEREQ |
+			 AR5K_RX_FILTER_PROM;
+		break;
+	case NL80211_IFTYPE_AP:
+	case NL80211_IFTYPE_ADHOC:
+		rfilt |= AR5K_RX_FILTER_PROBEREQ |
+			 AR5K_RX_FILTER_BEACON;
+		break;
+	case NL80211_IFTYPE_STATION:
+		if (sc->assoc)
+			rfilt |= AR5K_RX_FILTER_BEACON;
+	default:
+		break;
+	}
 
 	/* Set filters */
 	ath5k_hw_set_rx_filter(ah, rfilt);
@@ -2993,6 +2998,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
 	/* Set the cached hw filter flags, this will alter actually
 	 * be set in HW */
 	sc->filter_flags = rfilt;
+
+	mutex_unlock(&sc->lock);
 }
 
 static int
-- 
1.6.2.5



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

* [PATCH 2/4] ath5k: add led pin configuration for compaq c700 laptop
  2009-08-25  3:00 [PATCH 0/4] ath5k: misc updates Bob Copeland
  2009-08-25  3:00 ` [PATCH 1/4] ath5k: clean up filter flags setting Bob Copeland
@ 2009-08-25  3:00 ` Bob Copeland
  2009-08-25  3:00 ` [PATCH 3/4] ath5k: use the skb->cb directly for RX status Bob Copeland
  2009-08-25  3:00 ` [PATCH 4/4] ath5k: add hardware CCMP encyption support Bob Copeland
  3 siblings, 0 replies; 9+ messages in thread
From: Bob Copeland @ 2009-08-25  3:00 UTC (permalink / raw)
  To: linville, jirislaby, mickflemm, lrodriguez
  Cc: linux-wireless, ath5k-devel, Bob Copeland, Marcos Chaparro

From: Marcos Chaparro <nitrousnrg@gmail.com>

With this patch, a compaq c700 can turn on the wifi led.
The array of compatible devices now includes the hardware
present in this computer, as well as the led pin and
polarity.

Signed-off-by: Marcos Chaparro <nitrousnrg@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/led.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index 876725f..b767c3b 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -69,6 +69,8 @@ static const struct pci_device_id ath5k_led_devices[] = {
 	{ ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) },
 	/* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */
 	{ ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) },
+	/* HP Compaq C700 (nitrousnrg@gmail.com) */
+	{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) },
 	/* IBM-specific AR5212 (all others) */
 	{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM), ATH_LED(0, 0) },
 	{ }
-- 
1.6.2.5



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

* [PATCH 3/4] ath5k: use the skb->cb directly for RX status
  2009-08-25  3:00 [PATCH 0/4] ath5k: misc updates Bob Copeland
  2009-08-25  3:00 ` [PATCH 1/4] ath5k: clean up filter flags setting Bob Copeland
  2009-08-25  3:00 ` [PATCH 2/4] ath5k: add led pin configuration for compaq c700 laptop Bob Copeland
@ 2009-08-25  3:00 ` Bob Copeland
  2009-08-25  3:00 ` [PATCH 4/4] ath5k: add hardware CCMP encyption support Bob Copeland
  3 siblings, 0 replies; 9+ messages in thread
From: Bob Copeland @ 2009-08-25  3:00 UTC (permalink / raw)
  To: linville, jirislaby, mickflemm, lrodriguez
  Cc: linux-wireless, ath5k-devel, Bob Copeland

Save a memcpy by just storing updates directly in the skb
control block.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/base.c |   41 +++++++++++++++++----------------
 1 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c4adf98..10bf015 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1741,7 +1741,7 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb,
 static void
 ath5k_tasklet_rx(unsigned long data)
 {
-	struct ieee80211_rx_status rxs = {};
+	struct ieee80211_rx_status *rxs;
 	struct ath5k_rx_status rs = {};
 	struct sk_buff *skb, *next_skb;
 	dma_addr_t next_skb_addr;
@@ -1751,6 +1751,7 @@ ath5k_tasklet_rx(unsigned long data)
 	int ret;
 	int hdrlen;
 	int padsize;
+	int rx_flag;
 
 	spin_lock(&sc->rxbuflock);
 	if (list_empty(&sc->rxbuf)) {
@@ -1758,7 +1759,7 @@ ath5k_tasklet_rx(unsigned long data)
 		goto unlock;
 	}
 	do {
-		rxs.flag = 0;
+		rx_flag = 0;
 
 		bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
 		BUG_ON(bf->skb == NULL);
@@ -1802,7 +1803,7 @@ ath5k_tasklet_rx(unsigned long data)
 					goto accept;
 			}
 			if (rs.rs_status & AR5K_RXERR_MIC) {
-				rxs.flag |= RX_FLAG_MMIC_ERROR;
+				rx_flag |= RX_FLAG_MMIC_ERROR;
 				goto accept;
 			}
 
@@ -1840,6 +1841,7 @@ accept:
 			memmove(skb->data + padsize, skb->data, hdrlen);
 			skb_pull(skb, padsize);
 		}
+		rxs = IEEE80211_SKB_RXCB(skb);
 
 		/*
 		 * always extend the mac timestamp, since this information is
@@ -1861,41 +1863,40 @@ accept:
 		 * impossible to comply to that. This affects IBSS merge only
 		 * right now, so it's not too bad...
 		 */
-		rxs.mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
-		rxs.flag |= RX_FLAG_TSFT;
+		rxs->mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
+		rxs->flag = rx_flag | RX_FLAG_TSFT;
 
-		rxs.freq = sc->curchan->center_freq;
-		rxs.band = sc->curband->band;
+		rxs->freq = sc->curchan->center_freq;
+		rxs->band = sc->curband->band;
 
-		rxs.noise = sc->ah->ah_noise_floor;
-		rxs.signal = rxs.noise + rs.rs_rssi;
+		rxs->noise = sc->ah->ah_noise_floor;
+		rxs->signal = rxs->noise + rs.rs_rssi;
 
 		/* An rssi of 35 indicates you should be able use
 		 * 54 Mbps reliably. A more elaborate scheme can be used
 		 * here but it requires a map of SNR/throughput for each
 		 * possible mode used */
-		rxs.qual = rs.rs_rssi * 100 / 35;
+		rxs->qual = rs.rs_rssi * 100 / 35;
 
 		/* rssi can be more than 35 though, anything above that
 		 * should be considered at 100% */
-		if (rxs.qual > 100)
-			rxs.qual = 100;
+		if (rxs->qual > 100)
+			rxs->qual = 100;
 
-		rxs.antenna = rs.rs_antenna;
-		rxs.rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
-		rxs.flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
+		rxs->antenna = rs.rs_antenna;
+		rxs->rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
+		rxs->flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
 
-		if (rxs.rate_idx >= 0 && rs.rs_rate ==
-		    sc->curband->bitrates[rxs.rate_idx].hw_value_short)
-			rxs.flag |= RX_FLAG_SHORTPRE;
+		if (rxs->rate_idx >= 0 && rs.rs_rate ==
+		    sc->curband->bitrates[rxs->rate_idx].hw_value_short)
+			rxs->flag |= RX_FLAG_SHORTPRE;
 
 		ath5k_debug_dump_skb(sc, skb, "RX  ", 0);
 
 		/* check beacons in IBSS mode */
 		if (sc->opmode == NL80211_IFTYPE_ADHOC)
-			ath5k_check_ibss_tsf(sc, skb, &rxs);
+			ath5k_check_ibss_tsf(sc, skb, rxs);
 
-		memcpy(IEEE80211_SKB_RXCB(skb), &rxs, sizeof(rxs));
 		ieee80211_rx(sc->hw, skb);
 
 		bf->skb = next_skb;
-- 
1.6.2.5



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

* [PATCH 4/4] ath5k: add hardware CCMP encyption support
  2009-08-25  3:00 [PATCH 0/4] ath5k: misc updates Bob Copeland
                   ` (2 preceding siblings ...)
  2009-08-25  3:00 ` [PATCH 3/4] ath5k: use the skb->cb directly for RX status Bob Copeland
@ 2009-08-25  3:00 ` Bob Copeland
  2009-08-27  2:09   ` Pavel Roskin
  3 siblings, 1 reply; 9+ messages in thread
From: Bob Copeland @ 2009-08-25  3:00 UTC (permalink / raw)
  To: linville, jirislaby, mickflemm, lrodriguez
  Cc: linux-wireless, ath5k-devel, Bob Copeland

Recent ath5k hardware is capable of doing CCMP acceleration.
Enable it for the cards that support it.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/ath5k.h  |    1 +
 drivers/net/wireless/ath/ath5k/attach.c |   10 ++++++++++
 drivers/net/wireless/ath/ath5k/base.c   |    3 +++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 862762c..cdc79cd 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1037,6 +1037,7 @@ struct ath5k_hw {
 	bool			ah_turbo;
 	bool			ah_calibration;
 	bool			ah_single_chip;
+	bool			ah_aes_support;
 	bool			ah_combined_mic;
 
 	enum ath5k_version	ah_version;
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index 65d438b..109ab7b 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -106,6 +106,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 {
 	struct ath5k_hw *ah;
 	struct pci_dev *pdev = sc->pdev;
+	struct ath5k_eeprom_info *ee;
 	int ret;
 	u32 srev;
 
@@ -315,6 +316,15 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 		goto err_free;
 	}
 
+	/* Crypto settings */
+	ee = &ah->ah_capabilities.cap_eeprom;
+	ah->ah_aes_support =
+		(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
+		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
+		 (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
+		  (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
+		   ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));
+
 	if (srev >= AR5K_SREV_AR2414) {
 		ah->ah_combined_mic = true;
 		AR5K_REG_ENABLE_BITS(ah, AR5K_MISC_MODE,
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 10bf015..94d46fd 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3022,6 +3022,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	case ALG_TKIP:
 		break;
 	case ALG_CCMP:
+		if (sc->ah->ah_aes_support)
+			break;
+
 		return -EOPNOTSUPP;
 	default:
 		WARN_ON(1);
-- 
1.6.2.5



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

* Re: [PATCH 4/4] ath5k: add hardware CCMP encyption support
  2009-08-25  3:00 ` [PATCH 4/4] ath5k: add hardware CCMP encyption support Bob Copeland
@ 2009-08-27  2:09   ` Pavel Roskin
  2009-08-27  3:27     ` Bob Copeland
  2009-08-27 19:17     ` Bob Copeland
  0 siblings, 2 replies; 9+ messages in thread
From: Pavel Roskin @ 2009-08-27  2:09 UTC (permalink / raw)
  To: Bob Copeland
  Cc: linville, jirislaby, mickflemm, lrodriguez, linux-wireless, ath5k-devel

On Mon, 2009-08-24 at 23:00 -0400, Bob Copeland wrote:
> +	ah->ah_aes_support =
> +		(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
> +		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
> +		 (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
> +		  (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
> +		   ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));

The above use of ah->ah_mac_revision is clearly incorrect.  You are
comparing a revision with a symbol for a version.

I suggest that you use ah_mac_srev instead.  Before this patch,
ah_mac_revision was a write-only variable and was a good candidate for
removal.

The last three quoted lines are equivalent to (ah->ah_mac_srev >= 0x54)

-- 
Regards,
Pavel Roskin

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

* Re: [PATCH 4/4] ath5k: add hardware CCMP encyption support
  2009-08-27  2:09   ` Pavel Roskin
@ 2009-08-27  3:27     ` Bob Copeland
  2009-08-27 19:17     ` Bob Copeland
  1 sibling, 0 replies; 9+ messages in thread
From: Bob Copeland @ 2009-08-27  3:27 UTC (permalink / raw)
  To: Pavel Roskin
  Cc: linville, jirislaby, mickflemm, lrodriguez, linux-wireless, ath5k-devel

On Wed, Aug 26, 2009 at 10:09:31PM -0400, Pavel Roskin wrote:
> On Mon, 2009-08-24 at 23:00 -0400, Bob Copeland wrote:
> > +	ah->ah_aes_support =
> > +		(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
> > +		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
> > +		 (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
> > +		  (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
> > +		   ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));
> 
> The above use of ah->ah_mac_revision is clearly incorrect.  You are
> comparing a revision with a symbol for a version.

Well, this is exactly what legacy-hal does... so blame atheros :)

But yeah, we can just change it to look directly at the mac srev
since the revision check is confusing and the whole thing is needlessly
complex.

-- 
Bob Copeland %% www.bobcopeland.com


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

* Re: [PATCH 4/4] ath5k: add hardware CCMP encyption support
  2009-08-27  2:09   ` Pavel Roskin
  2009-08-27  3:27     ` Bob Copeland
@ 2009-08-27 19:17     ` Bob Copeland
  2009-09-01 22:03       ` Pavel Roskin
  1 sibling, 1 reply; 9+ messages in thread
From: Bob Copeland @ 2009-08-27 19:17 UTC (permalink / raw)
  To: Pavel Roskin
  Cc: linville, jirislaby, mickflemm, lrodriguez, linux-wireless, ath5k-devel

Subject: [PATCH] ath5k: clarify srev comparison for CCMP check

As Pavel Roskin noted, the check for mac version as copied from
legacy_hal made no sense.  This replaces it with the equivalent
and makes up a suitable #define for the mac version legacy_hal
checked.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---

On Wed, Aug 26, 2009 at 10:09:31PM -0400, Pavel Roskin wrote:
> On Mon, 2009-08-24 at 23:00 -0400, Bob Copeland wrote:
> > +	ah->ah_aes_support =
> > +		(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
> > +		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
> > +		 (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
> > +		  (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
> > +		   ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));
> 
> The above use of ah->ah_mac_revision is clearly incorrect.  You are
> comparing a revision with a symbol for a version.
> 
> I suggest that you use ah_mac_srev instead.  Before this patch,
> ah_mac_revision was a write-only variable and was a good candidate for
> removal.
> 
> The last three quoted lines are equivalent to (ah->ah_mac_srev >= 0x54)

Ok, here's a fixup.  I'm not sure if 0x54 was really intended since we
don't know what srev that is, but this assumes legacy hal is correct.

 drivers/net/wireless/ath/ath5k/ath5k.h  |    1 +
 drivers/net/wireless/ath/ath5k/attach.c |    7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index cdc79cd..1275ba0 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -306,6 +306,7 @@ struct ath5k_srev_name {
 #define AR5K_SREV_AR5311B	0x30 /* Spirit */
 #define AR5K_SREV_AR5211	0x40 /* Oahu */
 #define AR5K_SREV_AR5212	0x50 /* Venice */
+#define AR5K_SREV_AR5212_V4	0x54 /* ??? */
 #define AR5K_SREV_AR5213	0x55 /* ??? */
 #define AR5K_SREV_AR5213A	0x59 /* Hainan */
 #define AR5K_SREV_AR2413	0x78 /* Griffin lite */
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index 109ab7b..4819f39 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -318,12 +318,9 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 
 	/* Crypto settings */
 	ee = &ah->ah_capabilities.cap_eeprom;
-	ah->ah_aes_support =
+	ah->ah_aes_support = srev >= AR5K_SREV_AR5212_V4 &&
 		(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
-		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
-		 (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
-		  (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
-		   ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));
+		 !AR5K_EEPROM_AES_DIS(ee->ee_misc5));
 
 	if (srev >= AR5K_SREV_AR2414) {
 		ah->ah_combined_mic = true;
-- 
1.6.2.5



-- 
Bob Copeland %% www.bobcopeland.com


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

* Re: [PATCH 4/4] ath5k: add hardware CCMP encyption support
  2009-08-27 19:17     ` Bob Copeland
@ 2009-09-01 22:03       ` Pavel Roskin
  0 siblings, 0 replies; 9+ messages in thread
From: Pavel Roskin @ 2009-09-01 22:03 UTC (permalink / raw)
  To: Bob Copeland
  Cc: linville, jirislaby, mickflemm, lrodriguez, linux-wireless, ath5k-devel

On Thu, 2009-08-27 at 15:17 -0400, Bob Copeland wrote:
> -	ah->ah_aes_support =
> +	ah->ah_aes_support = srev >= AR5K_SREV_AR5212_V4 &&

Fine with me, but please use parentheses here, just for readability:

h->ah_aes_support = (srev >= AR5K_SREV_AR5212_V4) && ...

Also, let's call it AR5K_SREV_AR5212_R4 because 4 is the revision, not
the version.

-- 
Regards,
Pavel Roskin

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

end of thread, other threads:[~2009-09-01 22:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25  3:00 [PATCH 0/4] ath5k: misc updates Bob Copeland
2009-08-25  3:00 ` [PATCH 1/4] ath5k: clean up filter flags setting Bob Copeland
2009-08-25  3:00 ` [PATCH 2/4] ath5k: add led pin configuration for compaq c700 laptop Bob Copeland
2009-08-25  3:00 ` [PATCH 3/4] ath5k: use the skb->cb directly for RX status Bob Copeland
2009-08-25  3:00 ` [PATCH 4/4] ath5k: add hardware CCMP encyption support Bob Copeland
2009-08-27  2:09   ` Pavel Roskin
2009-08-27  3:27     ` Bob Copeland
2009-08-27 19:17     ` Bob Copeland
2009-09-01 22:03       ` 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).