}
}
+static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
+ struct data_queue *queue, enum data_queue_qid qid)
+{
+ spin_lock_init(&queue->lock);
+
+ queue->rt2x00dev = rt2x00dev;
+ queue->qid = qid;
+ queue->aifs = 2;
+ queue->cw_min = 5;
+ queue->cw_max = 10;
+}
+
int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
{
struct data_queue *queue;
* TX: cw_max: 2^10 = 1024.
* BCN & Atim: qid = QID_MGMT
*/
- qid = QID_AC_BE;
- queue_for_each(rt2x00dev, queue) {
- spin_lock_init(&queue->lock);
+ rt2x00queue_init(rt2x00dev, rt2x00dev->rx, QID_RX);
- queue->rt2x00dev = rt2x00dev;
- queue->qid = qid++;
- queue->aifs = 2;
- queue->cw_min = 5;
- queue->cw_max = 10;
- }
+ qid = QID_AC_BE;
+ tx_queue_for_each(rt2x00dev, queue)
+ rt2x00queue_init(rt2x00dev, queue, qid++);
- /*
- * Fix non-TX data qid's
- */
- rt2x00dev->rx->qid = QID_RX;
- rt2x00dev->bcn[0].qid = QID_MGMT;
+ rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[0], QID_MGMT);
if (req_atim)
- rt2x00dev->bcn[1].qid = QID_MGMT;
+ rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[1], QID_MGMT);
return 0;
}