Commit 781f3136 authored by Bruno Randolf's avatar Bruno Randolf Committed by John W. Linville

ath5k: Use common crypt capabilities flags

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: default avatarBruno Randolf <br1@einfach.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 117675d0
...@@ -1028,8 +1028,6 @@ struct ath5k_hw { ...@@ -1028,8 +1028,6 @@ struct ath5k_hw {
bool ah_turbo; bool ah_turbo;
bool ah_calibration; bool ah_calibration;
bool ah_single_chip; bool ah_single_chip;
bool ah_aes_support;
bool ah_combined_mic;
enum ath5k_version ah_version; enum ath5k_version ah_version;
enum ath5k_radio ah_radio; enum ath5k_radio ah_radio;
......
...@@ -317,12 +317,14 @@ int ath5k_hw_attach(struct ath5k_softc *sc) ...@@ -317,12 +317,14 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
common->keymax = (sc->ah->ah_version == AR5K_AR5210 ? common->keymax = (sc->ah->ah_version == AR5K_AR5210 ?
AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211); AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211);
ah->ah_aes_support = srev >= AR5K_SREV_AR5212_V4 && if (srev >= AR5K_SREV_AR5212_V4 &&
(ee->ee_version >= AR5K_EEPROM_VERSION_5_0 && (ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
!AR5K_EEPROM_AES_DIS(ee->ee_misc5)); !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) { 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_REG_ENABLE_BITS(ah, AR5K_MISC_MODE,
AR5K_MISC_MODE_COMBINED_MIC); AR5K_MISC_MODE_COMBINED_MIC);
} }
......
...@@ -3294,7 +3294,7 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -3294,7 +3294,7 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_TKIP:
break; break;
case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_CCMP:
if (sc->ah->ah_aes_support) if (common->crypt_caps & ATH_CRYPT_CAP_CIPHER_AESCCM)
break; break;
return -EOPNOTSUPP; return -EOPNOTSUPP;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment