ath5k: Use common crypt capabilities flags
authorBruno Randolf <br1@einfach.org>
Wed, 8 Sep 2010 07:04:59 +0000 (16:04 +0900)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 16 Sep 2010 19:19:45 +0000 (15:19 -0400)
Replace ah_aes_support and ah_combined_mic with common ath_crypt_caps
ATH_CRYPT_CAP_CIPHER_AESCCM and ATH_CRYPT_CAP_MIC_COMBINED.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/ath5k.h
drivers/net/wireless/ath/ath5k/attach.c
drivers/net/wireless/ath/ath5k/base.c

index 932ed5613355215304ce44e0fe6f048b04e6a68d..50209aed0ed23662d8e8e0877afff4bebfb75c84 100644 (file)
@@ -1028,8 +1028,6 @@ 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;
        enum ath5k_radio        ah_radio;
index eb125d69fb78daafd880e57fea1aec46d1d67808..a0e08201c9397162b2449db79864c4f9b6fb40b9 100644 (file)
@@ -317,12 +317,14 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
        common->keymax = (sc->ah->ah_version == AR5K_AR5210 ?
                          AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211);
 
-       ah->ah_aes_support = srev >= AR5K_SREV_AR5212_V4 &&
-               (ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
-                !AR5K_EEPROM_AES_DIS(ee->ee_misc5));
+       if (srev >= AR5K_SREV_AR5212_V4 &&
+           (ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
+           !AR5K_EEPROM_AES_DIS(ee->ee_misc5)))
+               common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM |
+                                       ATH_CRYPT_CAP_MIC_AESCCM;
 
        if (srev >= AR5K_SREV_AR2414) {
-               ah->ah_combined_mic = true;
+               common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED;
                AR5K_REG_ENABLE_BITS(ah, AR5K_MISC_MODE,
                        AR5K_MISC_MODE_COMBINED_MIC);
        }
index 7933646583a9a0a77805d34a43dc03895069e55e..0709bb091b2fdc7384f5b5ca5b3dd31be8700592 100644 (file)
@@ -3294,7 +3294,7 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        case WLAN_CIPHER_SUITE_TKIP:
                break;
        case WLAN_CIPHER_SUITE_CCMP:
-               if (sc->ah->ah_aes_support)
+               if (common->crypt_caps & ATH_CRYPT_CAP_CIPHER_AESCCM)
                        break;
                return -EOPNOTSUPP;
        default: