summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-mac80211.c
diff options
context:
space:
mode:
authorJohannes Berg2011-11-25 12:20:09 +0100
committerWey-Yi Guy2011-12-02 17:21:32 +0100
commita7e12c8e229b89fa23469718b605bfdbe66962d7 (patch)
tree7d58d9167af5ae4a3ac031f0905e77bdfb19209a /drivers/net/wireless/iwlwifi/iwl-mac80211.c
parentiwlwifi: declare static for iwl_sram_cleanup function (diff)
downloadkernel-qcow2-linux-a7e12c8e229b89fa23469718b605bfdbe66962d7.tar.gz
kernel-qcow2-linux-a7e12c8e229b89fa23469718b605bfdbe66962d7.tar.xz
kernel-qcow2-linux-a7e12c8e229b89fa23469718b605bfdbe66962d7.zip
iwlagn: fix HW crypto for TX-only keys
Group keys in IBSS or AP mode are not programmed into the device since we give the key to it with every TX packet. However, we do need mac80211 to create the MMIC & PN in all cases. Move the code around to set the key flags all the time. We set them even when the key is removed again but that is obviously harmless. Cc: stable@vger.kernel.org Reported-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-mac80211.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index ec31482435ba..bafd52597678 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -521,6 +521,17 @@ static int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
return -EOPNOTSUPP;
}
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_TKIP:
+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
+ /* fall through */
+ case WLAN_CIPHER_SUITE_CCMP:
+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
+ break;
+ default:
+ break;
+ }
+
/*
* We could program these keys into the hardware as well, but we
* don't expect much multicast traffic in IBSS and having keys