]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
rt2x00: Use rt2x00 queue numbering
authorIvo van Doorn <ivdoorn@gmail.com>
Mon, 21 Apr 2008 17:00:47 +0000 (19:00 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 May 2008 19:02:21 +0000 (15:02 -0400)
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>
12 files changed:
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00mac.c
drivers/net/wireless/rt2x00/rt2x00pci.c
drivers/net/wireless/rt2x00/rt2x00queue.c
drivers/net/wireless/rt2x00/rt2x00queue.h
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 560b9c73c0b9bcd41e1c0698818be95b59445084..705bc2d41dc171b76fd1bf95cbb2dafaa140938e 100644 (file)
@@ -1055,11 +1055,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-                                   const unsigned int queue)
+                                   const enum data_queue_qid queue)
 {
        u32 reg;
 
-       if (queue == RT2X00_BCN_QUEUE_BEACON) {
+       if (queue == QID_BEACON) {
                rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
                if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
                        rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
@@ -1071,12 +1071,9 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
        }
 
        rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
-       rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO,
-                          (queue == IEEE80211_TX_QUEUE_DATA0));
-       rt2x00_set_field32(&reg, TXCSR0_KICK_TX,
-                          (queue == IEEE80211_TX_QUEUE_DATA1));
-       rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM,
-                          (queue == RT2X00_BCN_QUEUE_ATIM));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM));
        rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
 }
 
@@ -1120,7 +1117,7 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry,
  * Interrupt functions.
  */
 static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
-                            const enum ieee80211_tx_queue queue_idx)
+                            const enum data_queue_qid queue_idx)
 {
        struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
        struct queue_entry_priv_pci_tx *priv_tx;
@@ -1187,19 +1184,19 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
         * 3 - Atim ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING))
-               rt2400pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM);
+               rt2400pci_txdone(rt2x00dev, QID_ATIM);
 
        /*
         * 4 - Priority ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING))
-               rt2400pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA0);
+               rt2400pci_txdone(rt2x00dev, QID_AC_BE);
 
        /*
         * 5 - Tx ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING))
-               rt2400pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA1);
+               rt2400pci_txdone(rt2x00dev, QID_AC_BK);
 
        return IRQ_HANDLED;
 }
@@ -1520,21 +1517,14 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
        rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
        rt2x00pci_register_write(rt2x00dev, CSR14, reg);
 
-       /*
-        * mac80211 doesn't provide the control->queue variable
-        * for beacons. Set our own queue identification so
-        * it can be used during descriptor initialization.
-        */
-       control->queue = RT2X00_BCN_QUEUE_BEACON;
-       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
-
        /*
         * Enable beacon generation.
         * Write entire beacon with descriptor to register,
         * and kick the beacon generator.
         */
+       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
        memcpy(priv_tx->data, skb->data, skb->len);
-       rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
+       rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
 }
index a5ed54b69262f8f6b167ebf87d6613b9c4319ec0..0d53c75d55dd15af716d715eb784c9a4453aae2f 100644 (file)
@@ -317,8 +317,7 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev,
                                  struct rt2x00intf_conf *conf,
                                  const unsigned int flags)
 {
-       struct data_queue *queue =
-           rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_BEACON);
+       struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, QID_BEACON);
        unsigned int bcn_preload;
        u32 reg;
 
@@ -1210,11 +1209,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-                                   const unsigned int queue)
+                                   const enum data_queue_qid queue)
 {
        u32 reg;
 
-       if (queue == RT2X00_BCN_QUEUE_BEACON) {
+       if (queue == QID_BEACON) {
                rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
                if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
                        rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
@@ -1226,12 +1225,9 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
        }
 
        rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
-       rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO,
-                          (queue == IEEE80211_TX_QUEUE_DATA0));
-       rt2x00_set_field32(&reg, TXCSR0_KICK_TX,
-                          (queue == IEEE80211_TX_QUEUE_DATA1));
-       rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM,
-                          (queue == RT2X00_BCN_QUEUE_ATIM));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK));
+       rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM));
        rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
 }
 
@@ -1276,7 +1272,7 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,
  * Interrupt functions.
  */
 static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
-                            const enum ieee80211_tx_queue queue_idx)
+                            const enum data_queue_qid queue_idx)
 {
        struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
        struct queue_entry_priv_pci_tx *priv_tx;
@@ -1343,19 +1339,19 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
         * 3 - Atim ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING))
-               rt2500pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM);
+               rt2500pci_txdone(rt2x00dev, QID_ATIM);
 
        /*
         * 4 - Priority ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_PRIORING))
-               rt2500pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA0);
+               rt2500pci_txdone(rt2x00dev, QID_AC_BE);
 
        /*
         * 5 - Tx ring transmit done interrupt.
         */
        if (rt2x00_get_field32(reg, CSR7_TXDONE_TXRING))
-               rt2500pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_DATA1);
+               rt2500pci_txdone(rt2x00dev, QID_AC_BK);
 
        return IRQ_HANDLED;
 }
@@ -1833,21 +1829,14 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
        rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
        rt2x00pci_register_write(rt2x00dev, CSR14, reg);
 
-       /*
-        * mac80211 doesn't provide the control->queue variable
-        * for beacons. Set our own queue identification so
-        * it can be used during descriptor initialization.
-        */
-       control->queue = RT2X00_BCN_QUEUE_BEACON;
-       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
-
        /*
         * Enable beacon generation.
         * Write entire beacon with descriptor to register,
         * and kick the beacon generator.
         */
+       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
        memcpy(priv_tx->data, skb->data, skb->len);
-       rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
+       rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
 }
index fdbd0ef2be4bceef492431262796e6466a11e0b8..0dac1f5b5c4ad64c41494d5d00030d59c7289088 100644 (file)
@@ -1094,11 +1094,11 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-                                   const unsigned int queue)
+                                   const enum data_queue_qid queue)
 {
        u16 reg;
 
-       if (queue != RT2X00_BCN_QUEUE_BEACON)
+       if (queue != QID_BEACON)
                return;
 
        rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
@@ -1720,12 +1720,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
        rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 0);
        rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
 
-       /*
-        * mac80211 doesn't provide the control->queue variable
-        * for beacons. Set our own queue identification so
-        * it can be used during descriptor initialization.
-        */
-       control->queue = RT2X00_BCN_QUEUE_BEACON;
        rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
 
        /*
@@ -1757,7 +1751,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
        /*
         * Enable beacon generation.
         */
-       rt2500usb_kick_tx_queue(rt2x00dev, control->queue);
+       rt2500usb_kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
 }
index 7a23b00c6895669a4f932659ce0ce485c45d358b..d85553f6351e8d0004d958c03709599d8ea35e76 100644 (file)
@@ -548,7 +548,7 @@ struct rt2x00lib_ops {
        int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
                                struct sk_buff *skb);
        void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
-                              const unsigned int queue);
+                              const enum data_queue_qid queue);
 
        /*
         * RX control handlers
@@ -927,13 +927,12 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate)
 }
 
 /**
- * rt2x00queue_get_queue - Convert mac80211 queue index to rt2x00 queue
+ * rt2x00queue_get_queue - Convert queue index to queue pointer
  * @rt2x00dev: Pointer to &struct rt2x00_dev.
- * @queue: mac80211/rt2x00 queue index
- *     (see &enum ieee80211_tx_queue and &enum rt2x00_bcn_queue).
+ * @queue: rt2x00 queue index (see &enum data_queue_qid).
  */
 struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
-                                        const unsigned int queue);
+                                        const enum data_queue_qid queue);
 
 /**
  * rt2x00queue_get_entry - Get queue entry where the given index points to.
index 8d8657fb64dd4517de49b1d9adf74d5b8ec28dcb..b1a324dead5f5bf690a274e422a4d1e668035b8c 100644 (file)
@@ -687,8 +687,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
         * Beacons and probe responses require the tsf timestamp
         * to be inserted into the frame.
         */
-       if (control->queue == RT2X00_BCN_QUEUE_BEACON ||
-           is_probe_resp(frame_control))
+       if (txdesc.queue == QID_BEACON || is_probe_resp(frame_control))
                __set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc.flags);
 
        /*
index e078e0ad0d0647e0490b68e84716a626aed19af5..d4ceab7646e7cfffe3f3f218cf32d162720236ab 100644 (file)
@@ -81,6 +81,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
        struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data;
+       enum data_queue_qid qid = mac80211_queue_to_qid(control->queue);
        struct data_queue *queue;
        struct skb_frame_desc *skbdesc;
        u16 frame_control;
@@ -101,14 +102,13 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
         */
        if (control->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM &&
            test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags))
-               queue = rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_ATIM);
+               queue = rt2x00queue_get_queue(rt2x00dev, QID_ATIM);
        else
-               queue = rt2x00queue_get_queue(rt2x00dev, control->queue);
+               queue = rt2x00queue_get_queue(rt2x00dev, qid);
        if (unlikely(!queue)) {
                ERROR(rt2x00dev,
                      "Attempt to send packet over invalid queue %d.\n"
-                     "Please file bug report to %s.\n",
-                     control->queue, DRV_PROJECT);
+                     "Please file bug report to %s.\n", qid, DRV_PROJECT);
                dev_kfree_skb_any(skb);
                return NETDEV_TX_OK;
        }
@@ -154,7 +154,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
                ieee80211_stop_queue(rt2x00dev->hw, control->queue);
 
        if (rt2x00dev->ops->lib->kick_tx_queue)
-               rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
+               rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, qid);
 
        return NETDEV_TX_OK;
 }
@@ -187,8 +187,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
        struct rt2x00_intf *intf = vif_to_intf(conf->vif);
-       struct data_queue *queue =
-           rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_BEACON);
+       struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, QID_BEACON);
        struct queue_entry *entry = NULL;
        unsigned int i;
 
index 7867ec64bd2cceda4b25c7a97ddc8ae4ab9a0da1..9e5d94e44c5cb420600040a1bf2214db74b128e2 100644 (file)
@@ -53,7 +53,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
                ERROR(rt2x00dev,
                      "Arrived at non-free entry in the non-full queue %d.\n"
                      "Please file bug report to %s.\n",
-                     control->queue, DRV_PROJECT);
+                     entry->queue->qid, DRV_PROJECT);
                return -EINVAL;
        }
 
index 659e9f44c40c76e1bac4a4c05fab2c342ff6d161..e5b861f8416d9db11b34563a8ee5d67a859080ee 100644 (file)
@@ -30,7 +30,7 @@
 #include "rt2x00lib.h"
 
 struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
-                                        const unsigned int queue)
+                                        const enum data_queue_qid queue)
 {
        int atim = test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
 
@@ -40,9 +40,9 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
        if (!rt2x00dev->bcn)
                return NULL;
 
-       if (queue == RT2X00_BCN_QUEUE_BEACON)
+       if (queue == QID_BEACON)
                return &rt2x00dev->bcn[0];
-       else if (queue == RT2X00_BCN_QUEUE_ATIM && atim)
+       else if (queue == QID_ATIM && atim)
                return &rt2x00dev->bcn[1];
 
        return NULL;
index 7027c9f47d3f0f1d509c67a857ecd648b3317cf4..29fe26525550f5fe554ab1b6e07220573b542780 100644 (file)
 
 /**
  * enum data_queue_qid: Queue identification
+ *
+ * @QID_AC_BE: AC BE queue
+ * @QID_AC_BK: AC BK queue
+ * @QID_AC_VI: AC VI queue
+ * @QID_AC_VO: AC VO queue
+ * @QID_HCCA: HCCA queue
+ * @QID_MGMT: MGMT queue (prio queue)
+ * @QID_RX: RX queue
+ * @QID_OTHER: None of the above (don't use, only present for completeness)
+ * @QID_BEACON: Beacon queue (value unspecified, don't send it to device)
+ * @QID_ATIM: Atim queue (value unspeficied, don't send it to device)
  */
 enum data_queue_qid {
        QID_AC_BE = 0,
@@ -64,22 +75,25 @@ enum data_queue_qid {
        QID_MGMT = 13,
        QID_RX = 14,
        QID_OTHER = 15,
+       QID_BEACON,
+       QID_ATIM,
 };
 
 /**
- * enum rt2x00_bcn_queue: Beacon queue index
- *
- * Start counting with a high offset, this because this enumeration
- * supplements &enum ieee80211_tx_queue and we should prevent value
- * conflicts.
- *
- * @RT2X00_BCN_QUEUE_BEACON: Beacon queue
- * @RT2X00_BCN_QUEUE_ATIM: Atim queue (sends frame after beacon)
+ * mac80211_queue_to_qid - Convert mac80211 queue to rt2x00 qid
+ * @queue: mac80211 queue.
  */
-enum rt2x00_bcn_queue {
-       RT2X00_BCN_QUEUE_BEACON = 100,
-       RT2X00_BCN_QUEUE_ATIM = 101,
-};
+static inline enum data_queue_qid mac80211_queue_to_qid(unsigned int queue)
+{
+       /* Regular TX queues are mapped directly */
+       if (queue < NUM_TX_DATA_QUEUES)
+               return queue;
+       else if (queue == IEEE80211_TX_QUEUE_BEACON)
+               return QID_BEACON;
+       else if (queue == IEEE80211_TX_QUEUE_AFTER_BEACON)
+               return QID_ATIM;
+       return QID_OTHER;
+}
 
 /**
  * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc
@@ -105,7 +119,6 @@ enum skb_frame_desc_flags {
  *     of the scope of the skb->data pointer.
  * @data_len: Length of the frame data.
  * @desc_len: Length of the frame descriptor.
-
  * @entry: The entry to which this sk buffer belongs.
  */
 struct skb_frame_desc {
@@ -240,7 +253,6 @@ struct txentry_desc {
  *     encryption or decryption. The entry should only be touched after
  *     the device has signaled it is done with it.
  */
-
 enum queue_entry_flags {
        ENTRY_BCN_ASSIGNED,
        ENTRY_OWNER_DEVICE_DATA,
index 5a331674dcb2384c036f77b08aa79f93b819946a..47f96b34087ef56f21b0a5b756a443cd6b6924f1 100644 (file)
@@ -186,7 +186,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
                ERROR(rt2x00dev,
                      "Arrived at non-free entry in the non-full queue %d.\n"
                      "Please file bug report to %s.\n",
-                     control->queue, DRV_PROJECT);
+                     entry->queue->qid, DRV_PROJECT);
                return -EINVAL;
        }
 
index ae12dcdd3c24f60df4d1bdc0bd97f011e43caa42..98af4d26583d47330b9f9abcf81468c2c2f16d01 100644 (file)
@@ -1591,11 +1591,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-                                 const unsigned int queue)
+                                 const enum data_queue_qid queue)
 {
        u32 reg;
 
-       if (queue == RT2X00_BCN_QUEUE_BEACON) {
+       if (queue == QID_BEACON) {
                /*
                 * For Wi-Fi faily generated beacons between participating
                 * stations. Set TBTT phase adaptive adjustment step to 8us.
@@ -1613,14 +1613,10 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
        }
 
        rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg);
-       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0,
-                          (queue == IEEE80211_TX_QUEUE_DATA0));
-       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1,
-                          (queue == IEEE80211_TX_QUEUE_DATA1));
-       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC2,
-                          (queue == IEEE80211_TX_QUEUE_DATA2));
-       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC3,
-                          (queue == IEEE80211_TX_QUEUE_DATA3));
+       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0, (queue == QID_AC_BE));
+       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1, (queue == QID_AC_BK));
+       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC2, (queue == QID_AC_VI));
+       rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC3, (queue == QID_AC_VO));
        rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg);
 }
 
@@ -2411,22 +2407,15 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
        rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
        rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
 
-       /*
-        * mac80211 doesn't provide the control->queue variable
-        * for beacons. Set our own queue identification so
-        * it can be used during descriptor initialization.
-        */
-       control->queue = RT2X00_BCN_QUEUE_BEACON;
-       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
-
        /*
         * Write entire beacon with descriptor to register,
         * and kick the beacon generator.
         */
+       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
        beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
        rt2x00pci_register_multiwrite(rt2x00dev, beacon_base,
                                      skb->data, skb->len);
-       rt61pci_kick_tx_queue(rt2x00dev, control->queue);
+       rt61pci_kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
 }
index da19a3a91f4d3909fd21d732a5f833862b6bdb10..a6419c9007723137dd1da2af407fbcc352cacf4c 100644 (file)
@@ -1331,11 +1331,11 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt73usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-                                 const unsigned int queue)
+                                 const enum data_queue_qid queue)
 {
        u32 reg;
 
-       if (queue != RT2X00_BCN_QUEUE_BEACON)
+       if (queue != QID_BEACON)
                return;
 
        /*
@@ -2000,24 +2000,17 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
        rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
        rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg);
 
-       /*
-        * mac80211 doesn't provide the control->queue variable
-        * for beacons. Set our own queue identification so
-        * it can be used during descriptor initialization.
-        */
-       control->queue = RT2X00_BCN_QUEUE_BEACON;
-       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
-
        /*
         * Write entire beacon with descriptor to register,
         * and kick the beacon generator.
         */
+       rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
        beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
        timeout = REGISTER_TIMEOUT * (skb->len / sizeof(u32));
        rt2x00usb_vendor_request(rt2x00dev, USB_MULTI_WRITE,
                                 USB_VENDOR_REQUEST_OUT, beacon_base, 0,
                                 skb->data, skb->len, timeout);
-       rt73usb_kick_tx_queue(rt2x00dev, control->queue);
+       rt73usb_kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
 }