Commit 8f539276 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Fix queue->qid initialization

As Adam Baker reported the queue->qid was not initialized
correctly. The QID_AC_BE was assigned to the RX ring.

This will move the queue initialization into a seperate function
and makes sure that all queues are initialized directly with the
correct qids.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 647d0ca9
...@@ -228,6 +228,18 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev) ...@@ -228,6 +228,18 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev)
} }
} }
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) int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
{ {
struct data_queue *queue; struct data_queue *queue;
...@@ -265,24 +277,15 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) ...@@ -265,24 +277,15 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
* TX: cw_max: 2^10 = 1024. * TX: cw_max: 2^10 = 1024.
* BCN & Atim: qid = QID_MGMT * BCN & Atim: qid = QID_MGMT
*/ */
qid = QID_AC_BE; rt2x00queue_init(rt2x00dev, rt2x00dev->rx, QID_RX);
queue_for_each(rt2x00dev, queue) {
spin_lock_init(&queue->lock);
queue->rt2x00dev = rt2x00dev; qid = QID_AC_BE;
queue->qid = qid++; tx_queue_for_each(rt2x00dev, queue)
queue->aifs = 2; rt2x00queue_init(rt2x00dev, queue, qid++);
queue->cw_min = 5;
queue->cw_max = 10;
}
/* rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[0], QID_MGMT);
* Fix non-TX data qid's
*/
rt2x00dev->rx->qid = QID_RX;
rt2x00dev->bcn[0].qid = QID_MGMT;
if (req_atim) if (req_atim)
rt2x00dev->bcn[1].qid = QID_MGMT; rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[1], QID_MGMT);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment