Hi, I gave this patch a spin and it seemed to work for me.  If
anyone has some older hardware (5212 or earlier) it would be good
to see if this doesn't break anything...

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

Signed-off-by: Bob Copeland <m...@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 9137511..62bddfd 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1033,6 +1033,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 9a84d94..f4d5163 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;
 
@@ -303,6 +304,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 20ba6fa..cbd7b38 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2985,6 +2985,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

-- 
Bob Copeland %% www.bobcopeland.com

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to