aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.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/rt73usb.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/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 72c2827ee57c..d0e97e1dfaf6 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -497,14 +497,8 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev,
497 else 497 else
498 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3); 498 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3);
499 break; 499 break;
500 case ANTENNA_SW_DIVERSITY:
501 /*
502 * NOTE: We should never come here because rt2x00lib is
503 * supposed to catch this and send us the correct antenna
504 * explicitely. However we are nog going to bug about this.
505 * Instead, just default to antenna B.
506 */
507 case ANTENNA_B: 500 case ANTENNA_B:
501 default:
508 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1); 502 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1);
509 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0); 503 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 0);
510 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) 504 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ)
@@ -545,14 +539,8 @@ static void rt73usb_config_antenna_2x(struct rt2x00_dev *rt2x00dev,
545 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3); 539 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 3);
546 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1); 540 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1);
547 break; 541 break;
548 case ANTENNA_SW_DIVERSITY:
549 /*
550 * NOTE: We should never come here because rt2x00lib is
551 * supposed to catch this and send us the correct antenna
552 * explicitely. However we are nog going to bug about this.
553 * Instead, just default to antenna B.
554 */
555 case ANTENNA_B: 542 case ANTENNA_B:
543 default:
556 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0); 544 rt2x00_set_field8(&r77, BBP_R77_RX_ANTENNA, 0);
557 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1); 545 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 1);
558 break; 546 break;
@@ -602,6 +590,13 @@ static void rt73usb_config_antenna(struct rt2x00_dev *rt2x00dev,
602 unsigned int i; 590 unsigned int i;
603 u32 reg; 591 u32 reg;
604 592
593 /*
594 * We should never come here because rt2x00lib is supposed
595 * to catch this and send us the correct antenna explicitely.
596 */
597 BUG_ON(ant->rx == ANTENNA_SW_DIVERSITY ||
598 ant->tx == ANTENNA_SW_DIVERSITY);
599
605 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 600 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
606 sel = antenna_sel_a; 601 sel = antenna_sel_a;
607 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); 602 lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags);