aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-13 10:26:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:54 -0500
commitddc827f93a2f2a7dcfda5b691d046af4dfe76427 (patch)
treedfa0c0d573e18fcc95d15984d43dcff4a7d71564 /drivers/net/wireless/rt2x00/rt2500usb.c
parent69f81a2cac860cf183eb9ef7787525c3552d4612 (diff)
[PATCH] rt2x00: Cleanup if-statements
Cleanup if-statements for simple 1/0 register field values. This also fixes a endian bug in rt2500usb when working with the PHY_CSR2 initialization. As well as a bug in the enabling of the LED in rt73usb. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 60f729044427..4f8e388700c0 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -517,18 +517,10 @@ static void rt2500usb_enable_led(struct rt2x00_dev *rt2x00dev)
517 rt2500usb_register_write(rt2x00dev, MAC_CSR21, reg); 517 rt2500usb_register_write(rt2x00dev, MAC_CSR21, reg);
518 518
519 rt2500usb_register_read(rt2x00dev, MAC_CSR20, &reg); 519 rt2500usb_register_read(rt2x00dev, MAC_CSR20, &reg);
520 520 rt2x00_set_field16(&reg, MAC_CSR20_LINK,
521 if (rt2x00dev->led_mode == LED_MODE_TXRX_ACTIVITY) { 521 (rt2x00dev->led_mode != LED_MODE_ASUS));
522 rt2x00_set_field16(&reg, MAC_CSR20_LINK, 1); 522 rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY,
523 rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY, 0); 523 (rt2x00dev->led_mode != LED_MODE_TXRX_ACTIVITY));
524 } else if (rt2x00dev->led_mode == LED_MODE_ASUS) {
525 rt2x00_set_field16(&reg, MAC_CSR20_LINK, 0);
526 rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY, 1);
527 } else {
528 rt2x00_set_field16(&reg, MAC_CSR20_LINK, 1);
529 rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY, 1);
530 }
531
532 rt2500usb_register_write(rt2x00dev, MAC_CSR20, reg); 524 rt2500usb_register_write(rt2x00dev, MAC_CSR20, reg);
533} 525}
534 526
@@ -765,9 +757,11 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
765 757
766 if (rt2x00_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) { 758 if (rt2x00_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) {
767 rt2500usb_register_read(rt2x00dev, PHY_CSR2, &reg); 759 rt2500usb_register_read(rt2x00dev, PHY_CSR2, &reg);
768 reg &= ~0x0002; 760 rt2x00_set_field16(&reg, PHY_CSR2_LNA, 0);
769 } else { 761 } else {
770 reg = 0x3002; 762 reg = 0;
763 rt2x00_set_field16(&reg, PHY_CSR2_LNA, 1);
764 rt2x00_set_field16(&reg, PHY_CSR2_LNA_MODE, 3);
771 } 765 }
772 rt2500usb_register_write(rt2x00dev, PHY_CSR2, reg); 766 rt2500usb_register_write(rt2x00dev, PHY_CSR2, reg);
773 767