aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.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/rt2500pci.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/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 096232763055..d85e1a44d5cd 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -444,6 +444,13 @@ static void rt2500pci_config_antenna(struct rt2x00_dev *rt2x00dev,
444 u8 r14; 444 u8 r14;
445 u8 r2; 445 u8 r2;
446 446
447 /*
448 * We should never come here because rt2x00lib is supposed
449 * to catch this and send us the correct antenna explicitely.
450 */
451 BUG_ON(ant->rx == ANTENNA_SW_DIVERSITY ||
452 ant->tx == ANTENNA_SW_DIVERSITY);
453
447 rt2x00pci_register_read(rt2x00dev, BBPCSR1, &reg); 454 rt2x00pci_register_read(rt2x00dev, BBPCSR1, &reg);
448 rt2500pci_bbp_read(rt2x00dev, 14, &r14); 455 rt2500pci_bbp_read(rt2x00dev, 14, &r14);
449 rt2500pci_bbp_read(rt2x00dev, 2, &r2); 456 rt2500pci_bbp_read(rt2x00dev, 2, &r2);
@@ -457,15 +464,8 @@ static void rt2500pci_config_antenna(struct rt2x00_dev *rt2x00dev,
457 rt2x00_set_field32(&reg, BBPCSR1_CCK, 0); 464 rt2x00_set_field32(&reg, BBPCSR1_CCK, 0);
458 rt2x00_set_field32(&reg, BBPCSR1_OFDM, 0); 465 rt2x00_set_field32(&reg, BBPCSR1_OFDM, 0);
459 break; 466 break;
460 case ANTENNA_HW_DIVERSITY:
461 case ANTENNA_SW_DIVERSITY:
462 /*
463 * NOTE: We should never come here because rt2x00lib is
464 * supposed to catch this and send us the correct antenna
465 * explicitely. However we are nog going to bug about this.
466 * Instead, just default to antenna B.
467 */
468 case ANTENNA_B: 467 case ANTENNA_B:
468 default:
469 rt2x00_set_field8(&r2, BBP_R2_TX_ANTENNA, 2); 469 rt2x00_set_field8(&r2, BBP_R2_TX_ANTENNA, 2);
470 rt2x00_set_field32(&reg, BBPCSR1_CCK, 2); 470 rt2x00_set_field32(&reg, BBPCSR1_CCK, 2);
471 rt2x00_set_field32(&reg, BBPCSR1_OFDM, 2); 471 rt2x00_set_field32(&reg, BBPCSR1_OFDM, 2);
@@ -479,15 +479,8 @@ static void rt2500pci_config_antenna(struct rt2x00_dev *rt2x00dev,
479 case ANTENNA_A: 479 case ANTENNA_A:
480 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 0); 480 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 0);
481 break; 481 break;
482 case ANTENNA_HW_DIVERSITY:
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: 482 case ANTENNA_B:
483 default:
491 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 2); 484 rt2x00_set_field8(&r14, BBP_R14_RX_ANTENNA, 2);
492 break; 485 break;
493 } 486 }