aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@kpnplanet.nl>2008-05-10 07:43:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:32 -0400
commit61448f88078e813bbaaa58eb775d650c85e7d407 (patch)
tree1a64fc0de784a3288369f9e554e7e2ec122ebc65 /drivers/net/wireless/rt2x00/rt2x00queue.c
parent61486e0f68d1f8966c09b734566a187d42d65c54 (diff)
rt2x00: Fix queue related oops in case of deselected mac80211 multi-queue feature.
With the integration of the mac80211 multiqueue patches it has become possible that the mac80211 layer modifies the number of TX queues that is stored inside the ieee80211_hw structure, especially when multi-queue is not selected. The rt2x00 drivers are not well suited to handle that situation, as they allocate the queue structures before mac80211 has modified the number of queues it is going to use, and also expect the number of allocated queues to match the hardware implementation. Hence, ensure that rt2x00 maintains by itself the number of queues that the hardware supports, and, at the same time, making is not dependent on the preservation of contents inside a mac80211 structure. Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl> 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index e5b861f8416d..95f8dd3462f6 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -34,7 +34,7 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
34{ 34{
35 int atim = test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); 35 int atim = test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
36 36
37 if (queue < rt2x00dev->hw->queues && rt2x00dev->tx) 37 if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx)
38 return &rt2x00dev->tx[queue]; 38 return &rt2x00dev->tx[queue];
39 39
40 if (!rt2x00dev->bcn) 40 if (!rt2x00dev->bcn)
@@ -255,11 +255,11 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
255 /* 255 /*
256 * We need the following queues: 256 * We need the following queues:
257 * RX: 1 257 * RX: 1
258 * TX: hw->queues 258 * TX: ops->tx_queues
259 * Beacon: 1 259 * Beacon: 1
260 * Atim: 1 (if required) 260 * Atim: 1 (if required)
261 */ 261 */
262 rt2x00dev->data_queues = 2 + rt2x00dev->hw->queues + req_atim; 262 rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim;
263 263
264 queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL); 264 queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL);
265 if (!queue) { 265 if (!queue) {
@@ -272,7 +272,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
272 */ 272 */
273 rt2x00dev->rx = queue; 273 rt2x00dev->rx = queue;
274 rt2x00dev->tx = &queue[1]; 274 rt2x00dev->tx = &queue[1];
275 rt2x00dev->bcn = &queue[1 + rt2x00dev->hw->queues]; 275 rt2x00dev->bcn = &queue[1 + rt2x00dev->ops->tx_queues];
276 276
277 /* 277 /*
278 * Initialize queue parameters. 278 * Initialize queue parameters.