aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-04-17 13:41:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:11 -0400
commit1c014420583564ac09e3b67006f2e7050861e66b (patch)
tree12f075007d1e7d603a6142ba0a4f32b2dee1cefb /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent6f4083aadd57e3da12fa4e67fcadaec23138a315 (diff)
mac80211: Replace ieee80211_tx_control->key_idx with ieee80211_key_conf
The hw_key_idx inside the ieee80211_key_conf structure does not provide all the information drivers might need to perform hardware encryption. This is in particular true for rt2x00 who needs to know the key algorithm and whether it is a shared or pairwise key. By passing the ieee80211_key_conf pointer it assures us that drivers can make full use of all information that it should know about a particular key. Additionally this patch updates all drivers to grab the hw_key_idx from the ieee80211_key_conf structure. v2: Removed bogus u16 cast v3: Add warning about ieee80211_tx_control pointers v4: Update warning about ieee80211_tx_control pointers Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 13925b627e3b..7bdffa9cfea6 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2391,7 +2391,8 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2391 struct sk_buff *skb_frag, 2391 struct sk_buff *skb_frag,
2392 int last_frag) 2392 int last_frag)
2393{ 2393{
2394 struct iwl3945_hw_key *keyinfo = &priv->stations[ctl->key_idx].keyinfo; 2394 struct iwl3945_hw_key *keyinfo =
2395 &priv->stations[ctl->hw_key->hw_key_idx].keyinfo;
2395 2396
2396 switch (keyinfo->alg) { 2397 switch (keyinfo->alg) {
2397 case ALG_CCMP: 2398 case ALG_CCMP:
@@ -2414,7 +2415,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2414 2415
2415 case ALG_WEP: 2416 case ALG_WEP:
2416 cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP | 2417 cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP |
2417 (ctl->key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT; 2418 (ctl->hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT;
2418 2419
2419 if (keyinfo->keylen == 13) 2420 if (keyinfo->keylen == 13)
2420 cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128; 2421 cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128;
@@ -2422,7 +2423,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2422 memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen); 2423 memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen);
2423 2424
2424 IWL_DEBUG_TX("Configuring packet for WEP encryption " 2425 IWL_DEBUG_TX("Configuring packet for WEP encryption "
2425 "with key %d\n", ctl->key_idx); 2426 "with key %d\n", ctl->hw_key->hw_key_idx);
2426 break; 2427 break;
2427 2428
2428 default: 2429 default: