aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-03-09 17:45:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-13 16:02:36 -0400
commita4fe07d913096f4573512c9369f8ca824fbc2d8f (patch)
tree9d47ba6a24083e84527075e12a41263a3f77ec74 /drivers/net/wireless/rt2x00/rt2500usb.c
parenta7f3a06cbb63a16ad7a1720506591d8d12a03029 (diff)
rt2x00: Start bugging when rt2x00lib doesn't filter SW diversity
rt2x00lib should filter SW diversity out before sending any configuration changes to the driver. When rt2x00lib fails to do this, it is important that such events are reported because it _must_ be fixed. So upgrading the error level to a BUG_ON() which will make sure this bug gets noticed whenever it happens. 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/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index b9e2f3a4990b..7ea4247442b3 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -437,6 +437,13 @@ static void rt2500usb_config_antenna(struct rt2x00_dev *rt2x00dev,
437 u16 csr5; 437 u16 csr5;
438 u16 csr6; 438 u16 csr6;
439 439
440 /*
441 * We should never come here because rt2x00lib is supposed
442 * to catch this and send us the correct antenna explicitely.
443 */
444 BUG_ON(ant->rx == ANTENNA_SW_DIVERSITY ||
445 ant->tx == ANTENNA_SW_DIVERSITY);
446
440 rt2500usb_bbp_read(rt2x00dev, 2, &r2); 447 rt2500usb_bbp_read(rt2x00dev, 2, &r2);
441 rt2500usb_bbp_read(rt2x00dev, 14, &r14); 448 rt2500usb_bbp_read(rt2x00dev, 14, &r14);
442 rt2500usb_register_read(rt2x00dev, PHY_CSR5, &csr5); 449 rt2500usb_register_read(rt2x00dev, PHY_CSR5, &csr5);
@@ -456,14 +463,8 @@ static void rt2500usb_config_antenna(struct rt2x00_dev *rt2x00dev,
456 rt2x00_set_field16(&csr5, PHY_CSR5_CCK, 0); 463 rt2x00_set_field16(&csr5, PHY_CSR5_CCK, 0);
457 rt2x00_set_field16(&csr6, PHY_CSR6_OFDM, 0); 464 rt2x00_set_field16(&csr6, PHY_CSR6_OFDM, 0);
458 break; 465 break;
459 case ANTENNA_SW_DIVERSITY:
460 /*
461 * NOTE: We should never come here because rt2x00lib is
462 * supposed to catch this and send us the correct antenna
463 * explicitely. However we are nog going to bug about this.
464 * Instead, just default to antenna B.
465 */
466 case ANTENNA_B: 466 case ANTENNA_B:
467 default:
467 rt2x00_set_field8(&r2, BBP_R2_TX_ANTENNA, 2); 468 rt2x00_set_field8(&r2, BBP_R2_TX_ANTENNA, 2);
468 rt2x00_set_field16(&csr5, PHY_CSR5_CCK, 2); 469 rt2x00_set_field16(&csr5, PHY_CSR5_CCK, 2);
469 rt2x00_set_field16(&csr6, PHY_CSR6_OFDM, 2); 470 rt2x00_set_field16(&csr6, PHY_CSR6_OFDM, 2);
@@ -480,14 +481,8 @@ static void rt2500usb_config_antenna(struct rt2x00_dev *rt2x00dev,
480 case ANTENNA_A: 481 case ANTENNA_A:
481 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 0); 482 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 0);
482 break; 483 break;
483 case ANTENNA_SW_DIVERSITY:
484 /*
485 * NOTE: We should never come here because rt2x00lib is
486 * supposed to catch this and send us the correct antenna
487 * explicitely. However we are nog going to bug about this.
488 * Instead, just default to antenna B.
489 */
490 case ANTENNA_B: 484 case ANTENNA_B:
485 default:
491 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 2); 486 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 2);
492 break; 487 break;
493 } 488 }