diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 53 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 3 |
6 files changed, 59 insertions, 31 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h index a7630d5ec892..d78c495a86a0 100644 --- a/drivers/net/wireless/rt2x00/rt2800.h +++ b/drivers/net/wireless/rt2x00/rt2800.h | |||
@@ -100,7 +100,7 @@ | |||
100 | #define CSR_REG_BASE 0x1000 | 100 | #define CSR_REG_BASE 0x1000 |
101 | #define CSR_REG_SIZE 0x0800 | 101 | #define CSR_REG_SIZE 0x0800 |
102 | #define EEPROM_BASE 0x0000 | 102 | #define EEPROM_BASE 0x0000 |
103 | #define EEPROM_SIZE 0x0110 | 103 | #define EEPROM_SIZE 0x0200 |
104 | #define BBP_BASE 0x0000 | 104 | #define BBP_BASE 0x0000 |
105 | #define BBP_SIZE 0x00ff | 105 | #define BBP_SIZE 0x00ff |
106 | #define RF_BASE 0x0004 | 106 | #define RF_BASE 0x0004 |
@@ -2625,11 +2625,13 @@ struct mac_iveiv_entry { | |||
2625 | /* | 2625 | /* |
2626 | * DMA descriptor defines. | 2626 | * DMA descriptor defines. |
2627 | */ | 2627 | */ |
2628 | #define TXWI_DESC_SIZE (4 * sizeof(__le32)) | ||
2629 | #define RXWI_DESC_SIZE (4 * sizeof(__le32)) | ||
2630 | 2628 | ||
2631 | #define TXWI_DESC_SIZE_5592 (5 * sizeof(__le32)) | 2629 | #define TXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) |
2632 | #define RXWI_DESC_SIZE_5592 (6 * sizeof(__le32)) | 2630 | #define TXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32)) |
2631 | |||
2632 | #define RXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) | ||
2633 | #define RXWI_DESC_SIZE_6WORDS (6 * sizeof(__le32)) | ||
2634 | |||
2633 | /* | 2635 | /* |
2634 | * TX WI structure | 2636 | * TX WI structure |
2635 | */ | 2637 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 3aa30ddcbfea..1f80ea5e29dd 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -2392,7 +2392,7 @@ static void rt2800_config_channel_rf55xx(struct rt2x00_dev *rt2x00dev, | |||
2392 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); | 2392 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); |
2393 | 2393 | ||
2394 | rt2800_rfcsr_read(rt2x00dev, 50, &rfcsr); | 2394 | rt2800_rfcsr_read(rt2x00dev, 50, &rfcsr); |
2395 | if (info->default_power1 > power_bound) | 2395 | if (info->default_power2 > power_bound) |
2396 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, power_bound); | 2396 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, power_bound); |
2397 | else | 2397 | else |
2398 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, info->default_power2); | 2398 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, info->default_power2); |
@@ -2678,30 +2678,53 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
2678 | 2678 | ||
2679 | tx_pin = 0; | 2679 | tx_pin = 0; |
2680 | 2680 | ||
2681 | /* Turn on unused PA or LNA when not using 1T or 1R */ | 2681 | switch (rt2x00dev->default_ant.tx_chain_num) { |
2682 | if (rt2x00dev->default_ant.tx_chain_num == 2) { | 2682 | case 3: |
2683 | /* Turn on tertiary PAs */ | ||
2684 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN, | ||
2685 | rf->channel > 14); | ||
2686 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G2_EN, | ||
2687 | rf->channel <= 14); | ||
2688 | /* fall-through */ | ||
2689 | case 2: | ||
2690 | /* Turn on secondary PAs */ | ||
2683 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, | 2691 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A1_EN, |
2684 | rf->channel > 14); | 2692 | rf->channel > 14); |
2685 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, | 2693 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G1_EN, |
2686 | rf->channel <= 14); | 2694 | rf->channel <= 14); |
2695 | /* fall-through */ | ||
2696 | case 1: | ||
2697 | /* Turn on primary PAs */ | ||
2698 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, | ||
2699 | rf->channel > 14); | ||
2700 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) | ||
2701 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1); | ||
2702 | else | ||
2703 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, | ||
2704 | rf->channel <= 14); | ||
2705 | break; | ||
2687 | } | 2706 | } |
2688 | 2707 | ||
2689 | /* Turn on unused PA or LNA when not using 1T or 1R */ | 2708 | switch (rt2x00dev->default_ant.rx_chain_num) { |
2690 | if (rt2x00dev->default_ant.rx_chain_num == 2) { | 2709 | case 3: |
2710 | /* Turn on tertiary LNAs */ | ||
2711 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1); | ||
2712 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1); | ||
2713 | /* fall-through */ | ||
2714 | case 2: | ||
2715 | /* Turn on secondary LNAs */ | ||
2691 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); | 2716 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1); |
2692 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); | 2717 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1); |
2718 | /* fall-through */ | ||
2719 | case 1: | ||
2720 | /* Turn on primary LNAs */ | ||
2721 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); | ||
2722 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); | ||
2723 | break; | ||
2693 | } | 2724 | } |
2694 | 2725 | ||
2695 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1); | ||
2696 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1); | ||
2697 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); | 2726 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_RFTR_EN, 1); |
2698 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); | 2727 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_TRSW_EN, 1); |
2699 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) | ||
2700 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, 1); | ||
2701 | else | ||
2702 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_G0_EN, | ||
2703 | rf->channel <= 14); | ||
2704 | rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A0_EN, rf->channel > 14); | ||
2705 | 2728 | ||
2706 | rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); | 2729 | rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); |
2707 | 2730 | ||
@@ -6254,8 +6277,8 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
6254 | default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2); | 6277 | default_power2 = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A2); |
6255 | 6278 | ||
6256 | for (i = 14; i < spec->num_channels; i++) { | 6279 | for (i = 14; i < spec->num_channels; i++) { |
6257 | info[i].default_power1 = default_power1[i]; | 6280 | info[i].default_power1 = default_power1[i - 14]; |
6258 | info[i].default_power2 = default_power2[i]; | 6281 | info[i].default_power2 = default_power2[i - 14]; |
6259 | } | 6282 | } |
6260 | } | 6283 | } |
6261 | 6284 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 7c7478219bbc..00055627eb8d 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry, | |||
637 | struct queue_entry_priv_mmio *entry_priv = entry->priv_data; | 637 | struct queue_entry_priv_mmio *entry_priv = entry->priv_data; |
638 | __le32 *txd = entry_priv->desc; | 638 | __le32 *txd = entry_priv->desc; |
639 | u32 word; | 639 | u32 word; |
640 | const unsigned int txwi_size = entry->queue->winfo_size; | ||
640 | 641 | ||
641 | /* | 642 | /* |
642 | * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1 | 643 | * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1 |
@@ -659,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry, | |||
659 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | 660 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); |
660 | rt2x00_set_field32(&word, TXD_W1_BURST, | 661 | rt2x00_set_field32(&word, TXD_W1_BURST, |
661 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 662 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
662 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE); | 663 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size); |
663 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); | 664 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); |
664 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); | 665 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); |
665 | rt2x00_desc_write(txd, 1, word); | 666 | rt2x00_desc_write(txd, 1, word); |
666 | 667 | ||
667 | word = 0; | 668 | word = 0; |
668 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, | 669 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, |
669 | skbdesc->skb_dma + TXWI_DESC_SIZE); | 670 | skbdesc->skb_dma + txwi_size); |
670 | rt2x00_desc_write(txd, 2, word); | 671 | rt2x00_desc_write(txd, 2, word); |
671 | 672 | ||
672 | word = 0; | 673 | word = 0; |
@@ -1193,7 +1194,7 @@ static void rt2800pci_queue_init(struct data_queue *queue) | |||
1193 | queue->limit = 128; | 1194 | queue->limit = 128; |
1194 | queue->data_size = AGGREGATION_SIZE; | 1195 | queue->data_size = AGGREGATION_SIZE; |
1195 | queue->desc_size = RXD_DESC_SIZE; | 1196 | queue->desc_size = RXD_DESC_SIZE; |
1196 | queue->winfo_size = RXWI_DESC_SIZE; | 1197 | queue->winfo_size = RXWI_DESC_SIZE_4WORDS; |
1197 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | 1198 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
1198 | break; | 1199 | break; |
1199 | 1200 | ||
@@ -1204,7 +1205,7 @@ static void rt2800pci_queue_init(struct data_queue *queue) | |||
1204 | queue->limit = 64; | 1205 | queue->limit = 64; |
1205 | queue->data_size = AGGREGATION_SIZE; | 1206 | queue->data_size = AGGREGATION_SIZE; |
1206 | queue->desc_size = TXD_DESC_SIZE; | 1207 | queue->desc_size = TXD_DESC_SIZE; |
1207 | queue->winfo_size = TXWI_DESC_SIZE; | 1208 | queue->winfo_size = TXWI_DESC_SIZE_4WORDS; |
1208 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | 1209 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
1209 | break; | 1210 | break; |
1210 | 1211 | ||
@@ -1212,7 +1213,7 @@ static void rt2800pci_queue_init(struct data_queue *queue) | |||
1212 | queue->limit = 8; | 1213 | queue->limit = 8; |
1213 | queue->data_size = 0; /* No DMA required for beacons */ | 1214 | queue->data_size = 0; /* No DMA required for beacons */ |
1214 | queue->desc_size = TXD_DESC_SIZE; | 1215 | queue->desc_size = TXD_DESC_SIZE; |
1215 | queue->winfo_size = TXWI_DESC_SIZE; | 1216 | queue->winfo_size = TXWI_DESC_SIZE_4WORDS; |
1216 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); | 1217 | queue->priv_size = sizeof(struct queue_entry_priv_mmio); |
1217 | break; | 1218 | break; |
1218 | 1219 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 7edd903dd749..840833b26bfa 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -855,11 +855,11 @@ static void rt2800usb_queue_init(struct data_queue *queue) | |||
855 | unsigned short txwi_size, rxwi_size; | 855 | unsigned short txwi_size, rxwi_size; |
856 | 856 | ||
857 | if (rt2x00_rt(rt2x00dev, RT5592)) { | 857 | if (rt2x00_rt(rt2x00dev, RT5592)) { |
858 | txwi_size = TXWI_DESC_SIZE_5592; | 858 | txwi_size = TXWI_DESC_SIZE_5WORDS; |
859 | rxwi_size = RXWI_DESC_SIZE_5592; | 859 | rxwi_size = RXWI_DESC_SIZE_6WORDS; |
860 | } else { | 860 | } else { |
861 | txwi_size = TXWI_DESC_SIZE; | 861 | txwi_size = TXWI_DESC_SIZE_4WORDS; |
862 | rxwi_size = RXWI_DESC_SIZE; | 862 | rxwi_size = RXWI_DESC_SIZE_4WORDS; |
863 | } | 863 | } |
864 | 864 | ||
865 | switch (queue->qid) { | 865 | switch (queue->qid) { |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 53754bc66d05..54d3ddfc9888 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2825,7 +2825,8 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2825 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); | 2825 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); |
2826 | for (i = 14; i < spec->num_channels; i++) { | 2826 | for (i = 14; i < spec->num_channels; i++) { |
2827 | info[i].max_power = MAX_TXPOWER; | 2827 | info[i].max_power = MAX_TXPOWER; |
2828 | info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); | 2828 | info[i].default_power1 = |
2829 | TXPOWER_FROM_DEV(tx_power[i - 14]); | ||
2829 | } | 2830 | } |
2830 | } | 2831 | } |
2831 | 2832 | ||
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 1616ed484ceb..1d3880e09a13 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2167,7 +2167,8 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2167 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); | 2167 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); |
2168 | for (i = 14; i < spec->num_channels; i++) { | 2168 | for (i = 14; i < spec->num_channels; i++) { |
2169 | info[i].max_power = MAX_TXPOWER; | 2169 | info[i].max_power = MAX_TXPOWER; |
2170 | info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); | 2170 | info[i].default_power1 = |
2171 | TXPOWER_FROM_DEV(tx_power[i - 14]); | ||
2171 | } | 2172 | } |
2172 | } | 2173 | } |
2173 | 2174 | ||