aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.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/rt2400pci.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/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index a1c38a144149..0ac0c6e08732 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -417,6 +417,13 @@ static void rt2400pci_config_antenna(struct rt2x00_dev *rt2x00dev,
417 u8 r1; 417 u8 r1;
418 u8 r4; 418 u8 r4;
419 419
420 /*
421 * We should never come here because rt2x00lib is supposed
422 * to catch this and send us the correct antenna explicitely.
423 */
424 BUG_ON(ant->rx == ANTENNA_SW_DIVERSITY ||
425 ant->tx == ANTENNA_SW_DIVERSITY);
426
420 rt2400pci_bbp_read(rt2x00dev, 4, &r4); 427 rt2400pci_bbp_read(rt2x00dev, 4, &r4);
421 rt2400pci_bbp_read(rt2x00dev, 1, &r1); 428 rt2400pci_bbp_read(rt2x00dev, 1, &r1);
422 429
@@ -430,14 +437,8 @@ static void rt2400pci_config_antenna(struct rt2x00_dev *rt2x00dev,
430 case ANTENNA_A: 437 case ANTENNA_A:
431 rt2x00_set_field8(&r1, BBP_R1_TX_ANTENNA, 0); 438 rt2x00_set_field8(&r1, BBP_R1_TX_ANTENNA, 0);
432 break; 439 break;
433 case ANTENNA_SW_DIVERSITY:
434 /*
435 * NOTE: We should never come here because rt2x00lib is
436 * supposed to catch this and send us the correct antenna
437 * explicitely. However we are nog going to bug about this.
438 * Instead, just default to antenna B.
439 */
440 case ANTENNA_B: 440 case ANTENNA_B:
441 default:
441 rt2x00_set_field8(&r1, BBP_R1_TX_ANTENNA, 2); 442 rt2x00_set_field8(&r1, BBP_R1_TX_ANTENNA, 2);
442 break; 443 break;
443 } 444 }
@@ -452,14 +453,8 @@ static void rt2400pci_config_antenna(struct rt2x00_dev *rt2x00dev,
452 case ANTENNA_A: 453 case ANTENNA_A:
453 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 0); 454 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 0);
454 break; 455 break;
455 case ANTENNA_SW_DIVERSITY:
456 /*
457 * NOTE: We should never come here because rt2x00lib is
458 * supposed to catch this and send us the correct antenna
459 * explicitely. However we are nog going to bug about this.
460 * Instead, just default to antenna B.
461 */
462 case ANTENNA_B: 456 case ANTENNA_B:
457 default:
463 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2); 458 rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2);
464 break; 459 break;
465 } 460 }