소스 검색

ath5k: enable hardware encryption for WEP

This change re-enables hardware encryption for ath5k after setting up
mac80211 to handle the initialization vectors which happens to make it
work.  Add a module param (nohwcrypt) to optionally turn it off.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland 16 년 전
부모
커밋
9ad9a26e7b
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      drivers/net/wireless/ath5k/base.c

+ 8 - 3
drivers/net/wireless/ath5k/base.c

@@ -60,6 +60,9 @@
 #include "debug.h"
 #include "debug.h"
 
 
 static int ath5k_calinterval = 10; /* Calibrate PHY every 10 secs (TODO: Fixme) */
 static int ath5k_calinterval = 10; /* Calibrate PHY every 10 secs (TODO: Fixme) */
+static int modparam_nohwcrypt;
+module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
+MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
 
 
 
 
 /******************\
 /******************\
@@ -2975,11 +2978,12 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	struct ath5k_softc *sc = hw->priv;
 	struct ath5k_softc *sc = hw->priv;
 	int ret = 0;
 	int ret = 0;
 
 
+	if (modparam_nohwcrypt)
+		return -EOPNOTSUPP;
+
 	switch (key->alg) {
 	switch (key->alg) {
 	case ALG_WEP:
 	case ALG_WEP:
-	/* XXX: fix hardware encryption, its not working. For now
-	 * allow software encryption */
-		/* break; */
+		break;
 	case ALG_TKIP:
 	case ALG_TKIP:
 	case ALG_CCMP:
 	case ALG_CCMP:
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;
@@ -2999,6 +3003,7 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		}
 		}
 		__set_bit(key->keyidx, sc->keymap);
 		__set_bit(key->keyidx, sc->keymap);
 		key->hw_key_idx = key->keyidx;
 		key->hw_key_idx = key->keyidx;
+		key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
 		break;
 		break;
 	case DISABLE_KEY:
 	case DISABLE_KEY:
 		ath5k_hw_reset_key(sc->ah, key->keyidx);
 		ath5k_hw_reset_key(sc->ah, key->keyidx);