aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-05-08 05:48:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-08 05:48:30 -0400
commit22f6dacdfcfdc792d068e9c41234808860498d04 (patch)
tree281a7d476f256ea3e2f800177ba685b169cc0540 /drivers/net/wireless/iwlwifi/iwl-sta.c
parent928f308f556f4943e50c5064b546f47bce301f02 (diff)
parent9b05126baa146fc3f41360164141d4e1b3ea93c4 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: include/net/tcp.h
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 17a4dd2be1f2..0072ea2c5361 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
719{ 719{
720 unsigned long flags; 720 unsigned long flags;
721 int ret = 0; 721 int ret = 0;
722 __le16 key_flags = 0;
723
724 key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
725 key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
726 key_flags &= ~STA_KEY_FLG_INVALID;
727
728 if (sta_id == priv->hw_params.bcast_sta_id)
729 key_flags |= STA_KEY_MULTICAST_MSK;
722 730
723 keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 731 keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
724 keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; 732 keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
@@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
738 WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, 746 WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
739 "no space for a new key"); 747 "no space for a new key");
740 748
749 priv->stations[sta_id].sta.key.key_flags = key_flags;
750
751
741 /* This copy is acutally not needed: we get the key with each TX */ 752 /* This copy is acutally not needed: we get the key with each TX */
742 memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); 753 memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
743 754
@@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
754{ 765{
755 u8 sta_id = IWL_INVALID_STATION; 766 u8 sta_id = IWL_INVALID_STATION;
756 unsigned long flags; 767 unsigned long flags;
757 __le16 key_flags = 0;
758 int i; 768 int i;
759 DECLARE_MAC_BUF(mac);
760 769
761 sta_id = priv->cfg->ops->smgmt->find_station(priv, addr); 770 sta_id = priv->cfg->ops->smgmt->find_station(priv, addr);
762 if (sta_id == IWL_INVALID_STATION) { 771 if (sta_id == IWL_INVALID_STATION) {
@@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
771 return; 780 return;
772 } 781 }
773 782
774 key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
775 key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
776 key_flags &= ~STA_KEY_FLG_INVALID;
777
778 if (sta_id == priv->hw_params.bcast_sta_id)
779 key_flags |= STA_KEY_MULTICAST_MSK;
780
781 spin_lock_irqsave(&priv->sta_lock, flags); 783 spin_lock_irqsave(&priv->sta_lock, flags);
782 784
783 priv->stations[sta_id].sta.key.key_flags = key_flags;
784 priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; 785 priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32;
785 786
786 for (i = 0; i < 5; i++) 787 for (i = 0; i < 5; i++)