diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index aebc96344cd8..c57d39002bfb 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -428,7 +428,7 @@ static void rt61pci_config_antenna_5x(struct rt2x00_dev *rt2x00dev, | |||
428 | case ANTENNA_HW_DIVERSITY: | 428 | case ANTENNA_HW_DIVERSITY: |
429 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2); | 429 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 2); |
430 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, | 430 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, |
431 | !!(rt2x00dev->curr_hwmode != HWMODE_A)); | 431 | (rt2x00dev->curr_hwmode != HWMODE_A)); |
432 | break; | 432 | break; |
433 | case ANTENNA_A: | 433 | case ANTENNA_A: |
434 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 1); | 434 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA, 1); |
@@ -646,17 +646,17 @@ static void rt61pci_config_antenna(struct rt2x00_dev *rt2x00dev, | |||
646 | if (rt2x00dev->curr_hwmode == HWMODE_A) { | 646 | if (rt2x00dev->curr_hwmode == HWMODE_A) { |
647 | sel = antenna_sel_a; | 647 | sel = antenna_sel_a; |
648 | lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); | 648 | lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); |
649 | |||
650 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, 0); | ||
651 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, 1); | ||
652 | } else { | 649 | } else { |
653 | sel = antenna_sel_bg; | 650 | sel = antenna_sel_bg; |
654 | lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); | 651 | lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); |
655 | |||
656 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, 1); | ||
657 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, 0); | ||
658 | } | 652 | } |
659 | 653 | ||
654 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_BG, | ||
655 | (rt2x00dev->curr_hwmode == HWMODE_B || | ||
656 | rt2x00dev->curr_hwmode == HWMODE_G)); | ||
657 | rt2x00_set_field32(®, PHY_CSR0_PA_PE_A, | ||
658 | (rt2x00dev->curr_hwmode == HWMODE_A)); | ||
659 | |||
660 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) | 660 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) |
661 | rt61pci_bbp_write(rt2x00dev, sel[i].word, sel[i].value[lna]); | 661 | rt61pci_bbp_write(rt2x00dev, sel[i].word, sel[i].value[lna]); |
662 | 662 | ||
@@ -727,7 +727,6 @@ static void rt61pci_config(struct rt2x00_dev *rt2x00dev, | |||
727 | static void rt61pci_enable_led(struct rt2x00_dev *rt2x00dev) | 727 | static void rt61pci_enable_led(struct rt2x00_dev *rt2x00dev) |
728 | { | 728 | { |
729 | u32 reg; | 729 | u32 reg; |
730 | u16 led_reg; | ||
731 | u8 arg0; | 730 | u8 arg0; |
732 | u8 arg1; | 731 | u8 arg1; |
733 | 732 | ||
@@ -736,15 +735,14 @@ static void rt61pci_enable_led(struct rt2x00_dev *rt2x00dev) | |||
736 | rt2x00_set_field32(®, MAC_CSR14_OFF_PERIOD, 30); | 735 | rt2x00_set_field32(®, MAC_CSR14_OFF_PERIOD, 30); |
737 | rt2x00pci_register_write(rt2x00dev, MAC_CSR14, reg); | 736 | rt2x00pci_register_write(rt2x00dev, MAC_CSR14, reg); |
738 | 737 | ||
739 | led_reg = rt2x00dev->led_reg; | 738 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_RADIO_STATUS, 1); |
740 | rt2x00_set_field16(&led_reg, MCU_LEDCS_RADIO_STATUS, 1); | 739 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_A_STATUS, |
741 | if (rt2x00dev->rx_status.phymode == MODE_IEEE80211A) | 740 | (rt2x00dev->rx_status.phymode == MODE_IEEE80211A)); |
742 | rt2x00_set_field16(&led_reg, MCU_LEDCS_LINK_A_STATUS, 1); | 741 | rt2x00_set_field16(&rt2x00dev->led_reg, MCU_LEDCS_LINK_BG_STATUS, |
743 | else | 742 | (rt2x00dev->rx_status.phymode != MODE_IEEE80211A)); |
744 | rt2x00_set_field16(&led_reg, MCU_LEDCS_LINK_BG_STATUS, 1); | ||
745 | 743 | ||
746 | arg0 = led_reg & 0xff; | 744 | arg0 = rt2x00dev->led_reg & 0xff; |
747 | arg1 = (led_reg >> 8) & 0xff; | 745 | arg1 = (rt2x00dev->led_reg >> 8) & 0xff; |
748 | 746 | ||
749 | rt61pci_mcu_request(rt2x00dev, MCU_LED, 0xff, arg0, arg1); | 747 | rt61pci_mcu_request(rt2x00dev, MCU_LED, 0xff, arg0, arg1); |
750 | } | 748 | } |
@@ -1655,16 +1653,16 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | |||
1655 | } | 1653 | } |
1656 | 1654 | ||
1657 | rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, ®); | 1655 | rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, ®); |
1658 | if (queue == IEEE80211_TX_QUEUE_DATA0) | 1656 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC0, |
1659 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC0, 1); | 1657 | (queue == IEEE80211_TX_QUEUE_DATA0)); |
1660 | else if (queue == IEEE80211_TX_QUEUE_DATA1) | 1658 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC1, |
1661 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC1, 1); | 1659 | (queue == IEEE80211_TX_QUEUE_DATA1)); |
1662 | else if (queue == IEEE80211_TX_QUEUE_DATA2) | 1660 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC2, |
1663 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC2, 1); | 1661 | (queue == IEEE80211_TX_QUEUE_DATA2)); |
1664 | else if (queue == IEEE80211_TX_QUEUE_DATA3) | 1662 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC3, |
1665 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_AC3, 1); | 1663 | (queue == IEEE80211_TX_QUEUE_DATA3)); |
1666 | else if (queue == IEEE80211_TX_QUEUE_DATA4) | 1664 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_MGMT, |
1667 | rt2x00_set_field32(®, TX_CNTL_CSR_KICK_TX_MGMT, 1); | 1665 | (queue == IEEE80211_TX_QUEUE_DATA4)); |
1668 | rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg); | 1666 | rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg); |
1669 | } | 1667 | } |
1670 | 1668 | ||