summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorIvo van Doorn2008-09-22 19:40:04 +0200
committerJohn W. Linville2008-09-24 22:18:03 +0200
commitacaf908d408ccd49f13aeb46cbd4428a4db174d1 (patch)
tree9ee347bacb617f7729e19a84d76e909908980cc8 /drivers/net/wireless/rt2x00/rt2x00mac.c
parentmac80211: fix led behavior in IBSS (diff)
downloadkernel-qcow2-linux-acaf908d408ccd49f13aeb46cbd4428a4db174d1.tar.gz
kernel-qcow2-linux-acaf908d408ccd49f13aeb46cbd4428a4db174d1.tar.xz
kernel-qcow2-linux-acaf908d408ccd49f13aeb46cbd4428a4db174d1.zip
rt2x00: Fix HW crypto key handling
When a crypto key is being removed, rt2x00mac should not reset the key->hw_key_idx value because that will prevent the driver from removing the correct key from the hardware. Furthermore ffz() starts counting at 0 instead of 1, so we don't need to substract 1 from the resulting value. Signed-off-by: Stephen Blackheath <tramp.enshrine.stephen@blacksapphire.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 485c40de5cc0..2c6cc5c374ff 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -543,7 +543,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
* provided but key 0 is not, then the key is not found
* by the hardware during RX).
*/
- key->hw_key_idx = 0;
+ if (cmd == SET_KEY)
+ key->hw_key_idx = 0;
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
set_key = rt2x00dev->ops->lib->config_pairwise_key;