mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
9ae4fda332
commit
2bc750899f
|
@ -481,6 +481,7 @@ struct iwl4965_tid_data {
|
||||||
struct iwl4965_hw_key {
|
struct iwl4965_hw_key {
|
||||||
enum ieee80211_key_alg alg;
|
enum ieee80211_key_alg alg;
|
||||||
int keylen;
|
int keylen;
|
||||||
|
struct ieee80211_key_conf *conf;
|
||||||
u8 key[32];
|
u8 key[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1393,7 +1393,27 @@ static int iwl4965_set_tkip_dynamic_key_info(struct iwl_priv *priv,
|
||||||
struct ieee80211_key_conf *keyconf,
|
struct ieee80211_key_conf *keyconf,
|
||||||
u8 sta_id)
|
u8 sta_id)
|
||||||
{
|
{
|
||||||
return -EOPNOTSUPP;
|
unsigned long flags;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
|
||||||
|
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
|
||||||
|
keyconf->hw_key_idx = keyconf->keyidx;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&priv->sta_lock, flags);
|
||||||
|
|
||||||
|
priv->stations[sta_id].keyinfo.alg = keyconf->alg;
|
||||||
|
priv->stations[sta_id].keyinfo.conf = keyconf;
|
||||||
|
priv->stations[sta_id].keyinfo.keylen = 16;
|
||||||
|
|
||||||
|
/* This copy is acutally not needed: we get the key with each TX */
|
||||||
|
memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
|
||||||
|
|
||||||
|
memcpy(priv->stations[sta_id].sta.key.key, keyconf->key, 16);
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&priv->sta_lock, flags);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iwl4965_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id)
|
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,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALG_TKIP:
|
case ALG_TKIP:
|
||||||
#if 0
|
|
||||||
cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP;
|
cmd->cmd.tx.sec_ctl = TX_CMD_SEC_TKIP;
|
||||||
|
ieee80211_get_tkip_key(keyinfo->conf, skb_frag,
|
||||||
if (last_frag)
|
IEEE80211_TKIP_P2_KEY, cmd->cmd.tx.key);
|
||||||
memcpy(cmd->cmd.tx.tkip_mic.byte, skb_frag->tail - 8,
|
IWL_DEBUG_TX("tx_cmd with tkip hwcrypto\n");
|
||||||
8);
|
|
||||||
else
|
|
||||||
memset(cmd->cmd.tx.tkip_mic.byte, 0, 8);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALG_WEP:
|
case ALG_WEP:
|
||||||
|
|
Loading…
Reference in New Issue