diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 560b9c73c0b9..705bc2d41dc1 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1055,11 +1055,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1055 | * TX data initialization | 1055 | * TX data initialization |
1056 | */ | 1056 | */ |
1057 | static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 1057 | static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, |
1058 | const unsigned int queue) | 1058 | const enum data_queue_qid queue) |
1059 | { | 1059 | { |
1060 | u32 reg; | 1060 | u32 reg; |
1061 | 1061 | ||
1062 | if (queue == RT2X00_BCN_QUEUE_BEACON) { | 1062 | if (queue == QID_BEACON) { |
1063 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | 1063 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); |
1064 | if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { | 1064 | if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { |
1065 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); | 1065 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); |
@@ -1071,12 +1071,9 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | |||
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | rt2x00pci_register_read(rt2x00dev, TXCSR0, ®); | 1073 | rt2x00pci_register_read(rt2x00dev, TXCSR0, ®); |
1074 | rt2x00_set_field32(®, TXCSR0_KICK_PRIO, | 1074 | rt2x00_set_field32(®, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); |
1075 | (queue == IEEE80211_TX_QUEUE_DATA0)); | 1075 | rt2x00_set_field32(®, TXCSR0_KICK_TX, (queue == QID_AC_BK)); |
1076 | rt2x00_set_field32(®, TXCSR0_KICK_TX, | 1076 | rt2x00_set_field32(®, TXCSR0_KICK_ATIM, (queue == QID_ATIM)); |
1077 | (queue == IEEE80211_TX_QUEUE_DATA1)); | ||
1078 | rt2x00_set_field32(®, TXCSR0_KICK_ATIM, | ||
1079 | (queue == RT2X00_BCN_QUEUE_ATIM)); | ||
1080 | rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); | 1077 | rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); |
1081 | } | 1078 | } |
1082 | 1079 | ||
@@ -1120,7 +1117,7 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry, | |||
1120 | * Interrupt functions. | 1117 | * Interrupt functions. |
1121 | */ | 1118 | */ |
1122 | static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, | 1119 | static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, |
1123 | const enum ieee80211_tx_queue queue_idx) | 1120 | const enum data_queue_qid queue_idx) |
1124 | { | 1121 | { |
1125 | struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); | 1122 | struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); |
1126 | struct queue_entry_priv_pci_tx *priv_tx; | 1123 | struct queue_entry_priv_pci_tx *priv_tx; |
@@ -1187,19 +1184,19 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) | |||
1187 | * 3 - Atim ring transmit done interrupt. | 1184 | * 3 - Atim ring transmit done interrupt. |
1188 | */ | 1185 | */ |
1189 | if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING)) | 1186 | if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING)) |
1190 | rt2400pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM); | 1187 | rt2400pci_txdone(rt2x00dev, QID_ATIM); |
1191 | 1188 | ||
1192 | /* | 1189 | /* |
1193 | * 4 - Priority ring transmit done interrupt. | 1190 | * 4 - Priority ring transmit done interrupt. |
1194 | */ | 1191 | */ |
1195 | if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING)) | 1192 | if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING)) |
1196 | rt2400pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA0); | 1193 | rt2400pci_txdone(rt2x00dev, QID_AC_BE); |
1197 | 1194 | ||
1198 | /* | 1195 | /* |
1199 | * 5 - Tx ring transmit done interrupt. | 1196 | * 5 - Tx ring transmit done interrupt. |
1200 | */ | 1197 | */ |
1201 | if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING)) | 1198 | if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING)) |
1202 | rt2400pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA1); | 1199 | rt2400pci_txdone(rt2x00dev, QID_AC_BK); |
1203 | 1200 | ||
1204 | return IRQ_HANDLED; | 1201 | return IRQ_HANDLED; |
1205 | } | 1202 | } |
@@ -1521,20 +1518,13 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1521 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1518 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1522 | 1519 | ||
1523 | /* | 1520 | /* |
1524 | * mac80211 doesn't provide the control->queue variable | ||
1525 | * for beacons. Set our own queue identification so | ||
1526 | * it can be used during descriptor initialization. | ||
1527 | */ | ||
1528 | control->queue = RT2X00_BCN_QUEUE_BEACON; | ||
1529 | rt2x00lib_write_tx_desc(rt2x00dev, skb, control); | ||
1530 | |||
1531 | /* | ||
1532 | * Enable beacon generation. | 1521 | * Enable beacon generation. |
1533 | * Write entire beacon with descriptor to register, | 1522 | * Write entire beacon with descriptor to register, |
1534 | * and kick the beacon generator. | 1523 | * and kick the beacon generator. |
1535 | */ | 1524 | */ |
1525 | rt2x00lib_write_tx_desc(rt2x00dev, skb, control); | ||
1536 | memcpy(priv_tx->data, skb->data, skb->len); | 1526 | memcpy(priv_tx->data, skb->data, skb->len); |
1537 | rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue); | 1527 | rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON); |
1538 | 1528 | ||
1539 | return 0; | 1529 | return 0; |
1540 | } | 1530 | } |