diff options
author | David S. Miller <davem@davemloft.net> | 2008-12-06 01:54:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-06 01:54:40 -0500 |
commit | 730c30ec646bd252a9448a66ecd51d794853513f (patch) | |
tree | c0d413860f9d8bf37374f17cfabb4911143465d7 /drivers/net/wireless/iwlwifi | |
parent | 726e07a8a38168266ac95d87736f9501a2d9e7b2 (diff) | |
parent | 0a0755c9fe47dc9f8271935909c66096e43efbfe (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-sta.c
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 26 |
2 files changed, 22 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 1b021ca74e25..d00dfe4edc3b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -238,7 +238,6 @@ int iwl_hw_nic_init(struct iwl_priv *priv) | |||
238 | } | 238 | } |
239 | EXPORT_SYMBOL(iwl_hw_nic_init); | 239 | EXPORT_SYMBOL(iwl_hw_nic_init); |
240 | 240 | ||
241 | |||
242 | void iwl_reset_qos(struct iwl_priv *priv) | 241 | void iwl_reset_qos(struct iwl_priv *priv) |
243 | { | 242 | { |
244 | u16 cw_min = 15; | 243 | u16 cw_min = 15; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index f86a8ca2aa3b..4a2479a1622a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -494,7 +494,7 @@ static int iwl_get_free_ucode_key_index(struct iwl_priv *priv) | |||
494 | if (!test_and_set_bit(i, &priv->ucode_key_table)) | 494 | if (!test_and_set_bit(i, &priv->ucode_key_table)) |
495 | return i; | 495 | return i; |
496 | 496 | ||
497 | return -1; | 497 | return WEP_INVALID_OFFSET; |
498 | } | 498 | } |
499 | 499 | ||
500 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | 500 | int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) |
@@ -639,6 +639,9 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv, | |||
639 | /* else, we are overriding an existing key => no need to allocated room | 639 | /* else, we are overriding an existing key => no need to allocated room |
640 | * in uCode. */ | 640 | * in uCode. */ |
641 | 641 | ||
642 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | ||
643 | "no space for new kew"); | ||
644 | |||
642 | priv->stations[sta_id].sta.key.key_flags = key_flags; | 645 | priv->stations[sta_id].sta.key.key_flags = key_flags; |
643 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 646 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
644 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 647 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
@@ -656,6 +659,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv, | |||
656 | { | 659 | { |
657 | unsigned long flags; | 660 | unsigned long flags; |
658 | __le16 key_flags = 0; | 661 | __le16 key_flags = 0; |
662 | int ret; | ||
659 | 663 | ||
660 | key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK); | 664 | key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK); |
661 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 665 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
@@ -683,14 +687,18 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv, | |||
683 | /* else, we are overriding an existing key => no need to allocated room | 687 | /* else, we are overriding an existing key => no need to allocated room |
684 | * in uCode. */ | 688 | * in uCode. */ |
685 | 689 | ||
690 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | ||
691 | "no space for new kew"); | ||
692 | |||
686 | priv->stations[sta_id].sta.key.key_flags = key_flags; | 693 | priv->stations[sta_id].sta.key.key_flags = key_flags; |
687 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 694 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
688 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 695 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
689 | 696 | ||
697 | ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
698 | |||
690 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 699 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
691 | 700 | ||
692 | IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n"); | 701 | return ret; |
693 | return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
694 | } | 702 | } |
695 | 703 | ||
696 | static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | 704 | static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, |
@@ -715,7 +723,10 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
715 | /* else, we are overriding an existing key => no need to allocated room | 723 | /* else, we are overriding an existing key => no need to allocated room |
716 | * in uCode. */ | 724 | * in uCode. */ |
717 | 725 | ||
718 | /* This copy is actually not needed: we get the key with each TX */ | 726 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, |
727 | "no space for new kew"); | ||
728 | |||
729 | /* This copy is acutally not needed: we get the key with each TX */ | ||
719 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); | 730 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); |
720 | 731 | ||
721 | memcpy(priv->stations[sta_id].sta.key.key, keyconf->key, 16); | 732 | memcpy(priv->stations[sta_id].sta.key.key, keyconf->key, 16); |
@@ -802,6 +813,13 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
802 | return 0; | 813 | return 0; |
803 | } | 814 | } |
804 | 815 | ||
816 | if (priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | ||
817 | IWL_WARNING("Removing wrong key %d 0x%x\n", | ||
818 | keyconf->keyidx, key_flags); | ||
819 | spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
820 | return 0; | ||
821 | } | ||
822 | |||
805 | if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset, | 823 | if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset, |
806 | &priv->ucode_key_table)) | 824 | &priv->ucode_key_table)) |
807 | IWL_ERROR("index %d not used in uCode key table.\n", | 825 | IWL_ERROR("index %d not used in uCode key table.\n", |