aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index c89d1520838c..7d50ca82375e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -296,6 +296,41 @@ void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
296} 296}
297EXPORT_SYMBOL_GPL(rt2x00usb_kick_tx_queue); 297EXPORT_SYMBOL_GPL(rt2x00usb_kick_tx_queue);
298 298
299void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev,
300 const enum data_queue_qid qid)
301{
302 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, qid);
303 struct queue_entry_priv_usb *entry_priv;
304 struct queue_entry_priv_usb_bcn *bcn_priv;
305 unsigned int i;
306 bool kill_guard;
307
308 /*
309 * When killing the beacon queue, we must also kill
310 * the beacon guard byte.
311 */
312 kill_guard =
313 (qid == QID_BEACON) &&
314 (test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags));
315
316 /*
317 * Cancel all entries.
318 */
319 for (i = 0; i < queue->limit; i++) {
320 entry_priv = queue->entries[i].priv_data;
321 usb_kill_urb(entry_priv->urb);
322
323 /*
324 * Kill guardian urb (if required by driver).
325 */
326 if (kill_guard) {
327 bcn_priv = queue->entries[i].priv_data;
328 usb_kill_urb(bcn_priv->guardian_urb);
329 }
330 }
331}
332EXPORT_SYMBOL_GPL(rt2x00usb_kill_tx_queue);
333
299/* 334/*
300 * RX data handlers. 335 * RX data handlers.
301 */ 336 */
@@ -338,35 +373,14 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
338 */ 373 */
339void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev) 374void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
340{ 375{
341 struct queue_entry_priv_usb *entry_priv;
342 struct queue_entry_priv_usb_bcn *bcn_priv;
343 struct data_queue *queue;
344 unsigned int i;
345
346 rt2x00usb_vendor_request_sw(rt2x00dev, USB_RX_CONTROL, 0, 0, 376 rt2x00usb_vendor_request_sw(rt2x00dev, USB_RX_CONTROL, 0, 0,
347 REGISTER_TIMEOUT); 377 REGISTER_TIMEOUT);
348 378
349 /* 379 /*
350 * Cancel all queues. 380 * The USB version of kill_tx_queue also works
381 * on the RX queue.
351 */ 382 */
352 queue_for_each(rt2x00dev, queue) { 383 rt2x00dev->ops->lib->kill_tx_queue(rt2x00dev, QID_RX);
353 for (i = 0; i < queue->limit; i++) {
354 entry_priv = queue->entries[i].priv_data;
355 usb_kill_urb(entry_priv->urb);
356 }
357 }
358
359 /*
360 * Kill guardian urb (if required by driver).
361 */
362 if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
363 return;
364
365 for (i = 0; i < rt2x00dev->bcn->limit; i++) {
366 bcn_priv = rt2x00dev->bcn->entries[i].priv_data;
367 if (bcn_priv->guardian_urb)
368 usb_kill_urb(bcn_priv->guardian_urb);
369 }
370} 384}
371EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio); 385EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio);
372 386