aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2010-06-23 06:57:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-24 15:42:38 -0400
commit75f64dd54a185150ebfc45e99351c890d4a2252f (patch)
tree31cf4cf828c41d5958469b6d86658df81f06d495 /drivers/net/wireless/rt2x00/rt2500usb.c
parent98d2ff8bec82fc35fe2008a187a5fef9241dab10 (diff)
rt2500usb: fallback to SW encryption for TKIP+AES
HW crypto in rt2500usb does not seem to support keys with different ciphers, which breaks TKIP+AES mode. Fall back to software encryption to fix it. This should fix long-standing problems with rt2500usb and WPA, such as: http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=4&t=4834 https://bugzilla.redhat.com/show_bug.cgi?id=484888 Also tested that it does not break WEP, TKIP-only and AES-only modes. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 002db646ae0b..963238c89080 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -347,6 +347,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
347{ 347{
348 u32 mask; 348 u32 mask;
349 u16 reg; 349 u16 reg;
350 enum cipher curr_cipher;
350 351
351 if (crypto->cmd == SET_KEY) { 352 if (crypto->cmd == SET_KEY) {
352 /* 353 /*
@@ -357,6 +358,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
357 mask = TXRX_CSR0_KEY_ID.bit_mask; 358 mask = TXRX_CSR0_KEY_ID.bit_mask;
358 359
359 rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg); 360 rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
361 curr_cipher = rt2x00_get_field16(reg, TXRX_CSR0_ALGORITHM);
360 reg &= mask; 362 reg &= mask;
361 363
362 if (reg && reg == mask) 364 if (reg && reg == mask)
@@ -365,6 +367,14 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
365 reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID); 367 reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);
366 368
367 key->hw_key_idx += reg ? ffz(reg) : 0; 369 key->hw_key_idx += reg ? ffz(reg) : 0;
370 /*
371 * Hardware requires that all keys use the same cipher
372 * (e.g. TKIP-only, AES-only, but not TKIP+AES).
373 * If this is not the first key, compare the cipher with the
374 * first one and fall back to SW crypto if not the same.
375 */
376 if (key->hw_key_idx > 0 && crypto->cipher != curr_cipher)
377 return -EOPNOTSUPP;
368 378
369 rt2500usb_register_multiwrite(rt2x00dev, reg, 379 rt2500usb_register_multiwrite(rt2x00dev, reg,
370 crypto->key, sizeof(crypto->key)); 380 crypto->key, sizeof(crypto->key));