Skip to content

Commit

Permalink
ath5k: add hardware CCMP encyption support
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Aug 28, 2009
1 parent 1c5256b commit 1c81874
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions drivers/net/wireless/ath/ath5k/attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c81874

Please sign in to comment.