aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-04-21 13:00:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:21 -0400
commite58c6aca99357d7f85f18e0b661d8c5a87f926a9 (patch)
tree8f7f5c3b78a1beae3121d8fbe95d21a21e361df9 /drivers/net/wireless/rt2x00/rt2500pci.c
parent62e70cf8568151a41e8525ddf0e56c0380a71cfd (diff)
rt2x00: Use rt2x00 queue numbering
Use the rt2x00 queue enumeration as much as possible, removing the usage of the mac80211 queue numbering wherever it is possible. This makes it easier for mac80211 to change it queue identification scheme without having to deal with big changes in the rt2x00 code. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index a5ed54b69262..0d53c75d55dd 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -317,8 +317,7 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev,
317 struct rt2x00intf_conf *conf, 317 struct rt2x00intf_conf *conf,
318 const unsigned int flags) 318 const unsigned int flags)
319{ 319{
320 struct data_queue *queue = 320 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, QID_BEACON);
321 rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_BEACON);
322 unsigned int bcn_preload; 321 unsigned int bcn_preload;
323 u32 reg; 322 u32 reg;
324 323
@@ -1210,11 +1209,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1210 * TX data initialization 1209 * TX data initialization
1211 */ 1210 */
1212static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1211static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1213 const unsigned int queue) 1212 const enum data_queue_qid queue)
1214{ 1213{
1215 u32 reg; 1214 u32 reg;
1216 1215
1217 if (queue == RT2X00_BCN_QUEUE_BEACON) { 1216 if (queue == QID_BEACON) {
1218 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 1217 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1219 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { 1218 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
1220 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1); 1219 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
@@ -1226,12 +1225,9 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1226 } 1225 }
1227 1226
1228 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); 1227 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
1229 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, 1228 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE));
1230 (queue == IEEE80211_TX_QUEUE_DATA0)); 1229 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK));
1231 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, 1230 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM));
1232 (queue == IEEE80211_TX_QUEUE_DATA1));
1233 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM,
1234 (queue == RT2X00_BCN_QUEUE_ATIM));
1235 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); 1231 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
1236} 1232}
1237 1233
@@ -1276,7 +1272,7 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,
1276 * Interrupt functions. 1272 * Interrupt functions.
1277 */ 1273 */
1278static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, 1274static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
1279 const enum ieee80211_tx_queue queue_idx) 1275 const enum data_queue_qid queue_idx)
1280{ 1276{
1281 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); 1277 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
1282 struct queue_entry_priv_pci_tx *priv_tx; 1278 struct queue_entry_priv_pci_tx *priv_tx;
@@ -1343,19 +1339,19 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
1343 * 3 - Atim ring transmit done interrupt. 1339 * 3 - Atim ring transmit done interrupt.
1344 */ 1340 */
1345 if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING)) 1341 if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING))
1346 rt2500pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM); 1342 rt2500pci_txdone(rt2x00dev, QID_ATIM);
1347 1343
1348 /* 1344 /*
1349 * 4 - Priority ring transmit done interrupt. 1345 * 4 - Priority ring transmit done interrupt.
1350 */ 1346 */
1351 if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING)) 1347 if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING))
1352 rt2500pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA0); 1348 rt2500pci_txdone(rt2x00dev, QID_AC_BE);
1353 1349
1354 /* 1350 /*
1355 * 5 - Tx ring transmit done interrupt. 1351 * 5 - Tx ring transmit done interrupt.
1356 */ 1352 */
1357 if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING)) 1353 if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING))
1358 rt2500pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA1); 1354 rt2500pci_txdone(rt2x00dev, QID_AC_BK);
1359 1355
1360 return IRQ_HANDLED; 1356 return IRQ_HANDLED;
1361} 1357}
@@ -1834,20 +1830,13 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1834 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1830 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1835 1831
1836 /* 1832 /*
1837 * mac80211 doesn't provide the control->queue variable
1838 * for beacons. Set our own queue identification so
1839 * it can be used during descriptor initialization.
1840 */
1841 control->queue = RT2X00_BCN_QUEUE_BEACON;
1842 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
1843
1844 /*
1845 * Enable beacon generation. 1833 * Enable beacon generation.
1846 * Write entire beacon with descriptor to register, 1834 * Write entire beacon with descriptor to register,
1847 * and kick the beacon generator. 1835 * and kick the beacon generator.
1848 */ 1836 */
1837 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
1849 memcpy(priv_tx->data, skb->data, skb->len); 1838 memcpy(priv_tx->data, skb->data, skb->len);
1850 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue); 1839 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
1851 1840
1852 return 0; 1841 return 0;
1853} 1842}