diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-09-22 13:40:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:18:03 -0400 |
commit | acaf908d408ccd49f13aeb46cbd4428a4db174d1 (patch) | |
tree | 9ee347bacb617f7729e19a84d76e909908980cc8 /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | 4492bea656b70dad6a9ae7b59b1430fa38ba3345 (diff) |
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/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 27dde3e34603..934f8e03c5aa 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -393,7 +393,7 @@ static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev, | |||
393 | if (reg && reg == mask) | 393 | if (reg && reg == mask) |
394 | return -ENOSPC; | 394 | return -ENOSPC; |
395 | 395 | ||
396 | key->hw_key_idx += reg ? (ffz(reg) - 1) : 0; | 396 | key->hw_key_idx += reg ? ffz(reg) : 0; |
397 | 397 | ||
398 | /* | 398 | /* |
399 | * Upload key to hardware | 399 | * Upload key to hardware |
@@ -494,7 +494,7 @@ static int rt73usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev, | |||
494 | return -ENOSPC; | 494 | return -ENOSPC; |
495 | } | 495 | } |
496 | 496 | ||
497 | key->hw_key_idx += reg ? (ffz(reg) - 1) : 0; | 497 | key->hw_key_idx += reg ? ffz(reg) : 0; |
498 | 498 | ||
499 | /* | 499 | /* |
500 | * Upload key to hardware | 500 | * Upload key to hardware |