diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 18324210c13a..e3d5e78661ea 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -200,8 +200,8 @@ rf_write: | |||
200 | * all others contain 20 bits. | 200 | * all others contain 20 bits. |
201 | */ | 201 | */ |
202 | rt2x00_set_field32(®, PHY_CSR4_NUMBER_OF_BITS, | 202 | rt2x00_set_field32(®, PHY_CSR4_NUMBER_OF_BITS, |
203 | 20 + !!(rt2x00_rf(&rt2x00dev->chip, RF5225) || | 203 | 20 + (rt2x00_rf(&rt2x00dev->chip, RF5225) || |
204 | rt2x00_rf(&rt2x00dev->chip, RF2527))); | 204 | rt2x00_rf(&rt2x00dev->chip, RF2527))); |
205 | rt2x00_set_field32(®, PHY_CSR4_IF_SELECT, 0); | 205 | rt2x00_set_field32(®, PHY_CSR4_IF_SELECT, 0); |
206 | rt2x00_set_field32(®, PHY_CSR4_BUSY, 1); | 206 | rt2x00_set_field32(®, PHY_CSR4_BUSY, 1); |
207 | 207 | ||
@@ -412,7 +412,7 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev, | |||
412 | case ANTENNA_HW_DIVERSITY: | 412 | case ANTENNA_HW_DIVERSITY: |
413 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2); | 413 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2); |
414 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, | 414 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, |
415 | !!(rt2x00dev->curr_hwmode != HWMODE_A)); | 415 | (rt2x00dev->curr_hwmode != HWMODE_A)); |
416 | break; | 416 | break; |
417 | case ANTENNA_A: | 417 | case ANTENNA_A: |
418 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 1); | 418 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 1); |
@@ -531,17 +531,17 @@ static void rt73usb_config_antenna(struct rt2x00_dev *rt2x00dev, | |||
531 | if (rt2x00dev->curr_hwmode == HWMODE_A) { | 531 | if (rt2x00dev->curr_hwmode == HWMODE_A) { |
532 | sel = antenna_sel_a; | 532 | sel = antenna_sel_a; |
533 | lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); | 533 | lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); |
534 | |||
535 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, 0); | ||
536 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, 1); | ||
537 | } else { | 534 | } else { |
538 | sel = antenna_sel_bg; | 535 | sel = antenna_sel_bg; |
539 | lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); | 536 | lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); |
540 | |||
541 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, 1); | ||
542 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, 0); | ||
543 | } | 537 | } |
544 | 538 | ||
539 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, | ||
540 | (rt2x00dev->curr_hwmode == HWMODE_B || | ||
541 | rt2x00dev->curr_hwmode == HWMODE_G)); | ||
542 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, | ||
543 | (rt2x00dev->curr_hwmode == HWMODE_A)); | ||
544 | |||
545 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) | 545 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) |
546 | rt73usb_bbp_write(rt2x00dev, sel[i].word, sel[i].value[lna]); | 546 | rt73usb_bbp_write(rt2x00dev, sel[i].word, sel[i].value[lna]); |
547 | 547 | ||
@@ -614,12 +614,10 @@ static void rt73usb_enable_led(struct rt2x00_dev *rt2x00dev) | |||
614 | rt73usb_register_write(rt2x00dev, MAC_CSR14, reg); | 614 | rt73usb_register_write(rt2x00dev, MAC_CSR14, reg); |
615 | 615 | ||
616 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_RADIO_STATUS, 1); | 616 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_RADIO_STATUS, 1); |
617 | if (rt2x00dev->rx_status.phymode == MODE_IEEE80211A) | 617 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_A_STATUS, |
618 | rt2x00_set_field16(&rt2x00dev->led_reg, | 618 | (rt2x00dev->rx_status.phymode == MODE_IEEE80211A)); |
619 | MCU_LEDCS_LINK_A_STATUS, 1); | 619 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_BG_STATUS, |
620 | else | 620 | (rt2x00dev->rx_status.phymode != MODE_IEEE80211A)); |
621 | rt2x00_set_field16(&rt2x00dev->led_reg, | ||
622 | MCU_LEDCS_LINK_BG_STATUS, 1); | ||
623 | 621 | ||
624 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_LED_CONTROL, 0x0000, | 622 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_LED_CONTROL, 0x0000, |
625 | rt2x00dev->led_reg, REGISTER_TIMEOUT); | 623 | rt2x00dev->led_reg, REGISTER_TIMEOUT); |