diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 133 |
1 files changed, 72 insertions, 61 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index edddbf35bbab..e13ed5ced26e 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1018,49 +1018,34 @@ static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, void *data, | |||
1018 | static void rt61pci_init_rxentry(struct rt2x00_dev *rt2x00dev, | 1018 | static void rt61pci_init_rxentry(struct rt2x00_dev *rt2x00dev, |
1019 | struct queue_entry *entry) | 1019 | struct queue_entry *entry) |
1020 | { | 1020 | { |
1021 | struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; | 1021 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
1022 | u32 word; | 1022 | u32 word; |
1023 | 1023 | ||
1024 | rt2x00_desc_read(priv_rx->desc, 5, &word); | 1024 | rt2x00_desc_read(entry_priv->desc, 5, &word); |
1025 | rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS, | 1025 | rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS, |
1026 | priv_rx->data_dma); | 1026 | entry_priv->data_dma); |
1027 | rt2x00_desc_write(priv_rx->desc, 5, word); | 1027 | rt2x00_desc_write(entry_priv->desc, 5, word); |
1028 | 1028 | ||
1029 | rt2x00_desc_read(priv_rx->desc, 0, &word); | 1029 | rt2x00_desc_read(entry_priv->desc, 0, &word); |
1030 | rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); | 1030 | rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); |
1031 | rt2x00_desc_write(priv_rx->desc, 0, word); | 1031 | rt2x00_desc_write(entry_priv->desc, 0, word); |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | static void rt61pci_init_txentry(struct rt2x00_dev *rt2x00dev, | 1034 | static void rt61pci_init_txentry(struct rt2x00_dev *rt2x00dev, |
1035 | struct queue_entry *entry) | 1035 | struct queue_entry *entry) |
1036 | { | 1036 | { |
1037 | struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; | 1037 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
1038 | u32 word; | 1038 | u32 word; |
1039 | 1039 | ||
1040 | rt2x00_desc_read(priv_tx->desc, 1, &word); | 1040 | rt2x00_desc_read(entry_priv->desc, 0, &word); |
1041 | rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1); | ||
1042 | rt2x00_desc_write(priv_tx->desc, 1, word); | ||
1043 | |||
1044 | rt2x00_desc_read(priv_tx->desc, 5, &word); | ||
1045 | rt2x00_set_field32(&word, TXD_W5_PID_TYPE, entry->queue->qid); | ||
1046 | rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, entry->entry_idx); | ||
1047 | rt2x00_desc_write(priv_tx->desc, 5, word); | ||
1048 | |||
1049 | rt2x00_desc_read(priv_tx->desc, 6, &word); | ||
1050 | rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS, | ||
1051 | priv_tx->data_dma); | ||
1052 | rt2x00_desc_write(priv_tx->desc, 6, word); | ||
1053 | |||
1054 | rt2x00_desc_read(priv_tx->desc, 0, &word); | ||
1055 | rt2x00_set_field32(&word, TXD_W0_VALID, 0); | 1041 | rt2x00_set_field32(&word, TXD_W0_VALID, 0); |
1056 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); | 1042 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); |
1057 | rt2x00_desc_write(priv_tx->desc, 0, word); | 1043 | rt2x00_desc_write(entry_priv->desc, 0, word); |
1058 | } | 1044 | } |
1059 | 1045 | ||
1060 | static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev) | 1046 | static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev) |
1061 | { | 1047 | { |
1062 | struct queue_entry_priv_pci_rx *priv_rx; | 1048 | struct queue_entry_priv_pci *entry_priv; |
1063 | struct queue_entry_priv_pci_tx *priv_tx; | ||
1064 | u32 reg; | 1049 | u32 reg; |
1065 | 1050 | ||
1066 | /* | 1051 | /* |
@@ -1082,28 +1067,28 @@ static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev) | |||
1082 | rt2x00dev->tx[0].desc_size / 4); | 1067 | rt2x00dev->tx[0].desc_size / 4); |
1083 | rt2x00pci_register_write(rt2x00dev, TX_RING_CSR1, reg); | 1068 | rt2x00pci_register_write(rt2x00dev, TX_RING_CSR1, reg); |
1084 | 1069 | ||
1085 | priv_tx = rt2x00dev->tx[0].entries[0].priv_data; | 1070 | entry_priv = rt2x00dev->tx[0].entries[0].priv_data; |
1086 | rt2x00pci_register_read(rt2x00dev, AC0_BASE_CSR, ®); | 1071 | rt2x00pci_register_read(rt2x00dev, AC0_BASE_CSR, ®); |
1087 | rt2x00_set_field32(®, AC0_BASE_CSR_RING_REGISTER, | 1072 | rt2x00_set_field32(®, AC0_BASE_CSR_RING_REGISTER, |
1088 | priv_tx->desc_dma); | 1073 | entry_priv->desc_dma); |
1089 | rt2x00pci_register_write(rt2x00dev, AC0_BASE_CSR, reg); | 1074 | rt2x00pci_register_write(rt2x00dev, AC0_BASE_CSR, reg); |
1090 | 1075 | ||
1091 | priv_tx = rt2x00dev->tx[1].entries[0].priv_data; | 1076 | entry_priv = rt2x00dev->tx[1].entries[0].priv_data; |
1092 | rt2x00pci_register_read(rt2x00dev, AC1_BASE_CSR, ®); | 1077 | rt2x00pci_register_read(rt2x00dev, AC1_BASE_CSR, ®); |
1093 | rt2x00_set_field32(®, AC1_BASE_CSR_RING_REGISTER, | 1078 | rt2x00_set_field32(®, AC1_BASE_CSR_RING_REGISTER, |
1094 | priv_tx->desc_dma); | 1079 | entry_priv->desc_dma); |
1095 | rt2x00pci_register_write(rt2x00dev, AC1_BASE_CSR, reg); | 1080 | rt2x00pci_register_write(rt2x00dev, AC1_BASE_CSR, reg); |
1096 | 1081 | ||
1097 | priv_tx = rt2x00dev->tx[2].entries[0].priv_data; | 1082 | entry_priv = rt2x00dev->tx[2].entries[0].priv_data; |
1098 | rt2x00pci_register_read(rt2x00dev, AC2_BASE_CSR, ®); | 1083 | rt2x00pci_register_read(rt2x00dev, AC2_BASE_CSR, ®); |
1099 | rt2x00_set_field32(®, AC2_BASE_CSR_RING_REGISTER, | 1084 | rt2x00_set_field32(®, AC2_BASE_CSR_RING_REGISTER, |
1100 | priv_tx->desc_dma); | 1085 | entry_priv->desc_dma); |
1101 | rt2x00pci_register_write(rt2x00dev, AC2_BASE_CSR, reg); | 1086 | rt2x00pci_register_write(rt2x00dev, AC2_BASE_CSR, reg); |
1102 | 1087 | ||
1103 | priv_tx = rt2x00dev->tx[3].entries[0].priv_data; | 1088 | entry_priv = rt2x00dev->tx[3].entries[0].priv_data; |
1104 | rt2x00pci_register_read(rt2x00dev, AC3_BASE_CSR, ®); | 1089 | rt2x00pci_register_read(rt2x00dev, AC3_BASE_CSR, ®); |
1105 | rt2x00_set_field32(®, AC3_BASE_CSR_RING_REGISTER, | 1090 | rt2x00_set_field32(®, AC3_BASE_CSR_RING_REGISTER, |
1106 | priv_tx->desc_dma); | 1091 | entry_priv->desc_dma); |
1107 | rt2x00pci_register_write(rt2x00dev, AC3_BASE_CSR, reg); | 1092 | rt2x00pci_register_write(rt2x00dev, AC3_BASE_CSR, reg); |
1108 | 1093 | ||
1109 | rt2x00pci_register_read(rt2x00dev, RX_RING_CSR, ®); | 1094 | rt2x00pci_register_read(rt2x00dev, RX_RING_CSR, ®); |
@@ -1113,10 +1098,10 @@ static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev) | |||
1113 | rt2x00_set_field32(®, RX_RING_CSR_RXD_WRITEBACK_SIZE, 4); | 1098 | rt2x00_set_field32(®, RX_RING_CSR_RXD_WRITEBACK_SIZE, 4); |
1114 | rt2x00pci_register_write(rt2x00dev, RX_RING_CSR, reg); | 1099 | rt2x00pci_register_write(rt2x00dev, RX_RING_CSR, reg); |
1115 | 1100 | ||
1116 | priv_rx = rt2x00dev->rx->entries[0].priv_data; | 1101 | entry_priv = rt2x00dev->rx->entries[0].priv_data; |
1117 | rt2x00pci_register_read(rt2x00dev, RX_BASE_CSR, ®); | 1102 | rt2x00pci_register_read(rt2x00dev, RX_BASE_CSR, ®); |
1118 | rt2x00_set_field32(®, RX_BASE_CSR_RING_REGISTER, | 1103 | rt2x00_set_field32(®, RX_BASE_CSR_RING_REGISTER, |
1119 | priv_rx->desc_dma); | 1104 | entry_priv->desc_dma); |
1120 | rt2x00pci_register_write(rt2x00dev, RX_BASE_CSR, reg); | 1105 | rt2x00pci_register_write(rt2x00dev, RX_BASE_CSR, reg); |
1121 | 1106 | ||
1122 | rt2x00pci_register_read(rt2x00dev, TX_DMA_DST_CSR, ®); | 1107 | rt2x00pci_register_read(rt2x00dev, TX_DMA_DST_CSR, ®); |
@@ -1526,10 +1511,10 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
1526 | */ | 1511 | */ |
1527 | static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 1512 | static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, |
1528 | struct sk_buff *skb, | 1513 | struct sk_buff *skb, |
1529 | struct txentry_desc *txdesc, | 1514 | struct txentry_desc *txdesc) |
1530 | struct ieee80211_tx_control *control) | ||
1531 | { | 1515 | { |
1532 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1516 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1517 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | ||
1533 | __le32 *txd = skbdesc->desc; | 1518 | __le32 *txd = skbdesc->desc; |
1534 | u32 word; | 1519 | u32 word; |
1535 | 1520 | ||
@@ -1543,6 +1528,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1543 | rt2x00_set_field32(&word, TXD_W1_CWMAX, txdesc->cw_max); | 1528 | rt2x00_set_field32(&word, TXD_W1_CWMAX, txdesc->cw_max); |
1544 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, IEEE80211_HEADER); | 1529 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, IEEE80211_HEADER); |
1545 | rt2x00_set_field32(&word, TXD_W1_HW_SEQUENCE, 1); | 1530 | rt2x00_set_field32(&word, TXD_W1_HW_SEQUENCE, 1); |
1531 | rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1); | ||
1546 | rt2x00_desc_write(txd, 1, word); | 1532 | rt2x00_desc_write(txd, 1, word); |
1547 | 1533 | ||
1548 | rt2x00_desc_read(txd, 2, &word); | 1534 | rt2x00_desc_read(txd, 2, &word); |
@@ -1553,11 +1539,19 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1553 | rt2x00_desc_write(txd, 2, word); | 1539 | rt2x00_desc_write(txd, 2, word); |
1554 | 1540 | ||
1555 | rt2x00_desc_read(txd, 5, &word); | 1541 | rt2x00_desc_read(txd, 5, &word); |
1542 | rt2x00_set_field32(&word, TXD_W5_PID_TYPE, skbdesc->entry->queue->qid); | ||
1543 | rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, | ||
1544 | skbdesc->entry->entry_idx); | ||
1556 | rt2x00_set_field32(&word, TXD_W5_TX_POWER, | 1545 | rt2x00_set_field32(&word, TXD_W5_TX_POWER, |
1557 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); | 1546 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); |
1558 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1547 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1559 | rt2x00_desc_write(txd, 5, word); | 1548 | rt2x00_desc_write(txd, 5, word); |
1560 | 1549 | ||
1550 | rt2x00_desc_read(txd, 6, &word); | ||
1551 | rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS, | ||
1552 | entry_priv->data_dma); | ||
1553 | rt2x00_desc_write(txd, 6, word); | ||
1554 | |||
1561 | if (skbdesc->desc_len > TXINFO_SIZE) { | 1555 | if (skbdesc->desc_len > TXINFO_SIZE) { |
1562 | rt2x00_desc_read(txd, 11, &word); | 1556 | rt2x00_desc_read(txd, 11, &word); |
1563 | rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len); | 1557 | rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len); |
@@ -1577,8 +1571,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1577 | test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags)); | 1571 | test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags)); |
1578 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | 1572 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); |
1579 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | 1573 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, |
1580 | !!(control->flags & | 1574 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); |
1581 | IEEE80211_TXCTL_LONG_RETRY_LIMIT)); | ||
1582 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); | 1575 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); |
1583 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len); | 1576 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len); |
1584 | rt2x00_set_field32(&word, TXD_W0_BURST, | 1577 | rt2x00_set_field32(&word, TXD_W0_BURST, |
@@ -1667,14 +1660,13 @@ static int rt61pci_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1) | |||
1667 | static void rt61pci_fill_rxdone(struct queue_entry *entry, | 1660 | static void rt61pci_fill_rxdone(struct queue_entry *entry, |
1668 | struct rxdone_entry_desc *rxdesc) | 1661 | struct rxdone_entry_desc *rxdesc) |
1669 | { | 1662 | { |
1670 | struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; | 1663 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
1671 | u32 word0; | 1664 | u32 word0; |
1672 | u32 word1; | 1665 | u32 word1; |
1673 | 1666 | ||
1674 | rt2x00_desc_read(priv_rx->desc, 0, &word0); | 1667 | rt2x00_desc_read(entry_priv->desc, 0, &word0); |
1675 | rt2x00_desc_read(priv_rx->desc, 1, &word1); | 1668 | rt2x00_desc_read(entry_priv->desc, 1, &word1); |
1676 | 1669 | ||
1677 | rxdesc->flags = 0; | ||
1678 | if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) | 1670 | if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) |
1679 | rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; | 1671 | rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; |
1680 | 1672 | ||
@@ -1688,7 +1680,6 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry, | |||
1688 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); | 1680 | rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1); |
1689 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); | 1681 | rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT); |
1690 | 1682 | ||
1691 | rxdesc->dev_flags = 0; | ||
1692 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) | 1683 | if (rt2x00_get_field32(word0, RXD_W0_OFDM)) |
1693 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; | 1684 | rxdesc->dev_flags |= RXDONE_SIGNAL_PLCP; |
1694 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) | 1685 | if (rt2x00_get_field32(word0, RXD_W0_MY_BSS)) |
@@ -1703,7 +1694,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1703 | struct data_queue *queue; | 1694 | struct data_queue *queue; |
1704 | struct queue_entry *entry; | 1695 | struct queue_entry *entry; |
1705 | struct queue_entry *entry_done; | 1696 | struct queue_entry *entry_done; |
1706 | struct queue_entry_priv_pci_tx *priv_tx; | 1697 | struct queue_entry_priv_pci *entry_priv; |
1707 | struct txdone_entry_desc txdesc; | 1698 | struct txdone_entry_desc txdesc; |
1708 | u32 word; | 1699 | u32 word; |
1709 | u32 reg; | 1700 | u32 reg; |
@@ -1748,8 +1739,8 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1748 | continue; | 1739 | continue; |
1749 | 1740 | ||
1750 | entry = &queue->entries[index]; | 1741 | entry = &queue->entries[index]; |
1751 | priv_tx = entry->priv_data; | 1742 | entry_priv = entry->priv_data; |
1752 | rt2x00_desc_read(priv_tx->desc, 0, &word); | 1743 | rt2x00_desc_read(entry_priv->desc, 0, &word); |
1753 | 1744 | ||
1754 | if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || | 1745 | if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || |
1755 | !rt2x00_get_field32(word, TXD_W0_VALID)) | 1746 | !rt2x00_get_field32(word, TXD_W0_VALID)) |
@@ -1764,7 +1755,8 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1764 | "TX status report missed for entry %d\n", | 1755 | "TX status report missed for entry %d\n", |
1765 | entry_done->entry_idx); | 1756 | entry_done->entry_idx); |
1766 | 1757 | ||
1767 | txdesc.status = TX_FAIL_OTHER; | 1758 | txdesc.flags = 0; |
1759 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); | ||
1768 | txdesc.retry = 0; | 1760 | txdesc.retry = 0; |
1769 | 1761 | ||
1770 | rt2x00pci_txdone(rt2x00dev, entry_done, &txdesc); | 1762 | rt2x00pci_txdone(rt2x00dev, entry_done, &txdesc); |
@@ -1774,7 +1766,17 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1774 | /* | 1766 | /* |
1775 | * Obtain the status about this packet. | 1767 | * Obtain the status about this packet. |
1776 | */ | 1768 | */ |
1777 | txdesc.status = rt2x00_get_field32(reg, STA_CSR4_TX_RESULT); | 1769 | txdesc.flags = 0; |
1770 | switch (rt2x00_get_field32(reg, STA_CSR4_TX_RESULT)) { | ||
1771 | case 0: /* Success, maybe with retry */ | ||
1772 | __set_bit(TXDONE_SUCCESS, &txdesc.flags); | ||
1773 | break; | ||
1774 | case 6: /* Failure, excessive retries */ | ||
1775 | __set_bit(TXDONE_EXCESSIVE_RETRY, &txdesc.flags); | ||
1776 | /* Don't break, this is a failed frame! */ | ||
1777 | default: /* Failure */ | ||
1778 | __set_bit(TXDONE_FAILURE, &txdesc.flags); | ||
1779 | } | ||
1778 | txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT); | 1780 | txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT); |
1779 | 1781 | ||
1780 | rt2x00pci_txdone(rt2x00dev, entry, &txdesc); | 1782 | rt2x00pci_txdone(rt2x00dev, entry, &txdesc); |
@@ -2248,7 +2250,6 @@ static void rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2248 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 2250 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
2249 | IEEE80211_HW_SIGNAL_DBM; | 2251 | IEEE80211_HW_SIGNAL_DBM; |
2250 | rt2x00dev->hw->extra_tx_headroom = 0; | 2252 | rt2x00dev->hw->extra_tx_headroom = 0; |
2251 | rt2x00dev->hw->queues = 4; | ||
2252 | 2253 | ||
2253 | SET_IEEE80211_DEV(rt2x00dev->hw, &rt2x00dev_pci(rt2x00dev)->dev); | 2254 | SET_IEEE80211_DEV(rt2x00dev->hw, &rt2x00dev_pci(rt2x00dev)->dev); |
2254 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 2255 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
@@ -2356,21 +2357,30 @@ static u64 rt61pci_get_tsf(struct ieee80211_hw *hw) | |||
2356 | return tsf; | 2357 | return tsf; |
2357 | } | 2358 | } |
2358 | 2359 | ||
2359 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 2360 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
2360 | struct ieee80211_tx_control *control) | ||
2361 | { | 2361 | { |
2362 | struct rt2x00_dev *rt2x00dev = hw->priv; | 2362 | struct rt2x00_dev *rt2x00dev = hw->priv; |
2363 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 2363 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
2364 | struct queue_entry_priv_pci_tx *priv_tx; | 2364 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); |
2365 | struct queue_entry_priv_pci *entry_priv; | ||
2365 | struct skb_frame_desc *skbdesc; | 2366 | struct skb_frame_desc *skbdesc; |
2367 | struct txentry_desc txdesc; | ||
2366 | unsigned int beacon_base; | 2368 | unsigned int beacon_base; |
2367 | u32 reg; | 2369 | u32 reg; |
2368 | 2370 | ||
2369 | if (unlikely(!intf->beacon)) | 2371 | if (unlikely(!intf->beacon)) |
2370 | return -ENOBUFS; | 2372 | return -ENOBUFS; |
2371 | 2373 | ||
2372 | priv_tx = intf->beacon->priv_data; | 2374 | /* |
2373 | memset(priv_tx->desc, 0, intf->beacon->queue->desc_size); | 2375 | * Copy all TX descriptor information into txdesc, |
2376 | * after that we are free to use the skb->cb array | ||
2377 | * for our information. | ||
2378 | */ | ||
2379 | intf->beacon->skb = skb; | ||
2380 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); | ||
2381 | |||
2382 | entry_priv = intf->beacon->priv_data; | ||
2383 | memset(entry_priv->desc, 0, intf->beacon->queue->desc_size); | ||
2374 | 2384 | ||
2375 | /* | 2385 | /* |
2376 | * Fill in skb descriptor | 2386 | * Fill in skb descriptor |
@@ -2380,7 +2390,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2380 | skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; | 2390 | skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; |
2381 | skbdesc->data = skb->data; | 2391 | skbdesc->data = skb->data; |
2382 | skbdesc->data_len = skb->len; | 2392 | skbdesc->data_len = skb->len; |
2383 | skbdesc->desc = priv_tx->desc; | 2393 | skbdesc->desc = entry_priv->desc; |
2384 | skbdesc->desc_len = intf->beacon->queue->desc_size; | 2394 | skbdesc->desc_len = intf->beacon->queue->desc_size; |
2385 | skbdesc->entry = intf->beacon; | 2395 | skbdesc->entry = intf->beacon; |
2386 | 2396 | ||
@@ -2398,7 +2408,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2398 | * Write entire beacon with descriptor to register, | 2408 | * Write entire beacon with descriptor to register, |
2399 | * and kick the beacon generator. | 2409 | * and kick the beacon generator. |
2400 | */ | 2410 | */ |
2401 | rt2x00lib_write_tx_desc(rt2x00dev, skb, control); | 2411 | rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); |
2402 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); | 2412 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); |
2403 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, | 2413 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, |
2404 | skbdesc->desc, skbdesc->desc_len); | 2414 | skbdesc->desc, skbdesc->desc_len); |
@@ -2457,21 +2467,21 @@ static const struct data_queue_desc rt61pci_queue_rx = { | |||
2457 | .entry_num = RX_ENTRIES, | 2467 | .entry_num = RX_ENTRIES, |
2458 | .data_size = DATA_FRAME_SIZE, | 2468 | .data_size = DATA_FRAME_SIZE, |
2459 | .desc_size = RXD_DESC_SIZE, | 2469 | .desc_size = RXD_DESC_SIZE, |
2460 | .priv_size = sizeof(struct queue_entry_priv_pci_rx), | 2470 | .priv_size = sizeof(struct queue_entry_priv_pci), |
2461 | }; | 2471 | }; |
2462 | 2472 | ||
2463 | static const struct data_queue_desc rt61pci_queue_tx = { | 2473 | static const struct data_queue_desc rt61pci_queue_tx = { |
2464 | .entry_num = TX_ENTRIES, | 2474 | .entry_num = TX_ENTRIES, |
2465 | .data_size = DATA_FRAME_SIZE, | 2475 | .data_size = DATA_FRAME_SIZE, |
2466 | .desc_size = TXD_DESC_SIZE, | 2476 | .desc_size = TXD_DESC_SIZE, |
2467 | .priv_size = sizeof(struct queue_entry_priv_pci_tx), | 2477 | .priv_size = sizeof(struct queue_entry_priv_pci), |
2468 | }; | 2478 | }; |
2469 | 2479 | ||
2470 | static const struct data_queue_desc rt61pci_queue_bcn = { | 2480 | static const struct data_queue_desc rt61pci_queue_bcn = { |
2471 | .entry_num = 4 * BEACON_ENTRIES, | 2481 | .entry_num = 4 * BEACON_ENTRIES, |
2472 | .data_size = 0, /* No DMA required for beacons */ | 2482 | .data_size = 0, /* No DMA required for beacons */ |
2473 | .desc_size = TXINFO_SIZE, | 2483 | .desc_size = TXINFO_SIZE, |
2474 | .priv_size = sizeof(struct queue_entry_priv_pci_tx), | 2484 | .priv_size = sizeof(struct queue_entry_priv_pci), |
2475 | }; | 2485 | }; |
2476 | 2486 | ||
2477 | static const struct rt2x00_ops rt61pci_ops = { | 2487 | static const struct rt2x00_ops rt61pci_ops = { |
@@ -2480,6 +2490,7 @@ static const struct rt2x00_ops rt61pci_ops = { | |||
2480 | .max_ap_intf = 4, | 2490 | .max_ap_intf = 4, |
2481 | .eeprom_size = EEPROM_SIZE, | 2491 | .eeprom_size = EEPROM_SIZE, |
2482 | .rf_size = RF_SIZE, | 2492 | .rf_size = RF_SIZE, |
2493 | .tx_queues = NUM_TX_QUEUES, | ||
2483 | .rx = &rt61pci_queue_rx, | 2494 | .rx = &rt61pci_queue_rx, |
2484 | .tx = &rt61pci_queue_tx, | 2495 | .tx = &rt61pci_queue_tx, |
2485 | .bcn = &rt61pci_queue_bcn, | 2496 | .bcn = &rt61pci_queue_bcn, |