diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2008-03-19 19:41:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-25 16:41:53 -0400 |
commit | 2bc750899f2b1da010625d064ad46dc3a8e9a372 (patch) | |
tree | afbe2b0f0460c413a2d2224086851187e6023f08 /drivers | |
parent | 9ae4fda332df616ef47d5bb710c39681641d4303 (diff) |
iwlwifi-2.6: enables HW TKIP encryption
This patch add support for TKIP encryption (TX) in HW.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 33 |
2 files changed, 25 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 7baed4db2f3f..1d7e8f9cf5ee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h | |||
@@ -481,6 +481,7 @@ struct iwl4965_tid_data { | |||
481 | struct iwl4965_hw_key { | 481 | struct iwl4965_hw_key { |
482 | enum ieee80211_key_alg alg; | 482 | enum ieee80211_key_alg alg; |
483 | int keylen; | 483 | int keylen; |
484 | struct ieee80211_key_conf *conf; | ||
484 | u8 key[32]; | 485 | u8 key[32]; |
485 | }; | 486 | }; |
486 | 487 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 8de301d1da8e..ae8fc8cb4d18 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1393,7 +1393,27 @@ static int iwl4965_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
1393 | struct ieee80211_key_conf *keyconf, | 1393 | struct ieee80211_key_conf *keyconf, |
1394 | u8 sta_id) | 1394 | u8 sta_id) |
1395 | { | 1395 | { |
1396 | return -EOPNOTSUPP; | 1396 | unsigned long flags; |
1397 | int ret = 0; | ||
1398 | |||
1399 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | ||
1400 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | ||
1401 | keyconf->hw_key_idx = keyconf->keyidx; | ||
1402 | |||
1403 | spin_lock_irqsave(&priv->sta_lock, flags); | ||
1404 | |||
1405 | priv->stations[sta_id].keyinfo.alg = keyconf->alg; | ||
1406 | priv->stations[sta_id].keyinfo.conf = keyconf; | ||
1407 | priv->stations[sta_id].keyinfo.keylen = 16; | ||
1408 | |||
1409 | /* This copy is acutally not needed: we get the key with each TX */ | ||
1410 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); | ||
1411 | |||
1412 | memcpy(priv->stations[sta_id].sta.key.key, keyconf->key, 16); | ||
1413 | |||
1414 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
1415 | |||
1416 | return ret; | ||
1397 | } | 1417 | } |
1398 | 1418 | ||
1399 | static int iwl4965_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id) | 1419 | static int iwl4965_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id) |
@@ -2341,15 +2361,10 @@ static void iwl4965_build_tx_cmd_hwcrypto(struct iwl_priv *priv, | |||
2341 | break; | 2361 | break; |
2342 | 2362 | ||
2343 | case ALG_TKIP: | 2363 | case ALG_TKIP: |
2344 | #if 0 | ||
2345 | cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP; | 2364 | cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP; |
2346 | 2365 | ieee80211_get_tkip_key(keyinfo->conf, skb_frag, | |
2347 | if (last_frag) | 2366 | IEEE80211_TKIP_P2_KEY, cmd->cmd.tx.key); |
2348 | memcpy(cmd->cmd.tx.tkip_mic.byte, skb_frag->tail - 8, | 2367 | IWL_DEBUG_TX("tx_cmd with tkip hwcrypto\n"); |
2349 | 8); | ||
2350 | else | ||
2351 | memset(cmd->cmd.tx.tkip_mic.byte, 0, 8); | ||
2352 | #endif | ||
2353 | break; | 2368 | break; |
2354 | 2369 | ||
2355 | case ALG_WEP: | 2370 | case ALG_WEP: |