diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2011-03-03 13:46:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-04 14:06:49 -0500 |
commit | e74df4a7562da56a7e4dbf41ff167b2f44e84a50 (patch) | |
tree | a845c66206b7a7cb3425ae1b6c39608aaaeafabb /drivers/net/wireless/rt2x00/rt2x00queue.c | |
parent | 3736fe5808577f9d3a31a565ef4e78ceae250c98 (diff) |
rt2x00: Don't treat ATIM queue as second beacon queue.
Current code for the atim queue is strange, as it is considered in the
rt2x00_dev structure as a second beacon queue.
Normalize this by letting the atim queue have its own struct data_queue
pointer in the rt2x00_dev structure.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
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/rt2x00queue.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index f06b5c797492..fcaacc6dc0f1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -708,21 +708,17 @@ EXPORT_SYMBOL_GPL(rt2x00queue_for_each_entry); | |||
708 | struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev, | 708 | struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev, |
709 | const enum data_queue_qid queue) | 709 | const enum data_queue_qid queue) |
710 | { | 710 | { |
711 | int atim = test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); | ||
712 | |||
713 | if (queue == QID_RX) | 711 | if (queue == QID_RX) |
714 | return rt2x00dev->rx; | 712 | return rt2x00dev->rx; |
715 | 713 | ||
716 | if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx) | 714 | if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx) |
717 | return &rt2x00dev->tx[queue]; | 715 | return &rt2x00dev->tx[queue]; |
718 | 716 | ||
719 | if (!rt2x00dev->bcn) | ||
720 | return NULL; | ||
721 | |||
722 | if (queue == QID_BEACON) | 717 | if (queue == QID_BEACON) |
723 | return &rt2x00dev->bcn[0]; | 718 | return rt2x00dev->bcn; |
724 | else if (queue == QID_ATIM && atim) | 719 | |
725 | return &rt2x00dev->bcn[1]; | 720 | if (queue == QID_ATIM) |
721 | return rt2x00dev->atim; | ||
726 | 722 | ||
727 | return NULL; | 723 | return NULL; |
728 | } | 724 | } |
@@ -1103,7 +1099,7 @@ int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev) | |||
1103 | goto exit; | 1099 | goto exit; |
1104 | 1100 | ||
1105 | if (test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) { | 1101 | if (test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags)) { |
1106 | status = rt2x00queue_alloc_entries(&rt2x00dev->bcn[1], | 1102 | status = rt2x00queue_alloc_entries(rt2x00dev->atim, |
1107 | rt2x00dev->ops->atim); | 1103 | rt2x00dev->ops->atim); |
1108 | if (status) | 1104 | if (status) |
1109 | goto exit; | 1105 | goto exit; |
@@ -1177,6 +1173,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) | |||
1177 | rt2x00dev->rx = queue; | 1173 | rt2x00dev->rx = queue; |
1178 | rt2x00dev->tx = &queue[1]; | 1174 | rt2x00dev->tx = &queue[1]; |
1179 | rt2x00dev->bcn = &queue[1 + rt2x00dev->ops->tx_queues]; | 1175 | rt2x00dev->bcn = &queue[1 + rt2x00dev->ops->tx_queues]; |
1176 | rt2x00dev->atim = req_atim ? &queue[2 + rt2x00dev->ops->tx_queues] : NULL; | ||
1180 | 1177 | ||
1181 | /* | 1178 | /* |
1182 | * Initialize queue parameters. | 1179 | * Initialize queue parameters. |
@@ -1193,9 +1190,9 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev) | |||
1193 | tx_queue_for_each(rt2x00dev, queue) | 1190 | tx_queue_for_each(rt2x00dev, queue) |
1194 | rt2x00queue_init(rt2x00dev, queue, qid++); | 1191 | rt2x00queue_init(rt2x00dev, queue, qid++); |
1195 | 1192 | ||
1196 | rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[0], QID_BEACON); | 1193 | rt2x00queue_init(rt2x00dev, rt2x00dev->bcn, QID_BEACON); |
1197 | if (req_atim) | 1194 | if (req_atim) |
1198 | rt2x00queue_init(rt2x00dev, &rt2x00dev->bcn[1], QID_ATIM); | 1195 | rt2x00queue_init(rt2x00dev, rt2x00dev->atim, QID_ATIM); |
1199 | 1196 | ||
1200 | return 0; | 1197 | return 0; |
1201 | } | 1198 | } |