aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-10-11 09:37:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-11 15:04:25 -0400
commitfa69560f317d961c56e29dea788b346d2b34fb87 (patch)
treef3102311d1a38906ebaf4a7df988b91a2f38cab3 /drivers/net/wireless/rt2x00/rt2x00usb.c
parenta9325199edb093a5c7311a25d15da20ee984e80b (diff)
rt2x00: Simplify Queue function arguments
A lot of functions accept a struct rt2x00_dev combined with either a struct queue_entry or struct data_queue argument. This can be simplified by only passing on the queue/entry argument. In cases where rt2x00_dev and a sk_buff are send together, we can send the queue_entry instead. rt2x00usb_alloc_urb and rt2x00usb_free_urb have a bit of vague naming. Instead they allocate all the data which belongs to a rt2x00 data queue entry. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 4c5ae3d45625..451d637377a2 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -398,7 +398,7 @@ static void rt2x00usb_work_rxdone(struct work_struct *work)
398 /* 398 /*
399 * Send the frame to rt2x00lib for further processing. 399 * Send the frame to rt2x00lib for further processing.
400 */ 400 */
401 rt2x00lib_rxdone(rt2x00dev, entry); 401 rt2x00lib_rxdone(entry);
402 } 402 }
403} 403}
404 404
@@ -542,9 +542,9 @@ static int rt2x00usb_find_endpoints(struct rt2x00_dev *rt2x00dev)
542 return 0; 542 return 0;
543} 543}
544 544
545static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev, 545static int rt2x00usb_alloc_entries(struct data_queue *queue)
546 struct data_queue *queue)
547{ 546{
547 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
548 struct queue_entry_priv_usb *entry_priv; 548 struct queue_entry_priv_usb *entry_priv;
549 struct queue_entry_priv_usb_bcn *bcn_priv; 549 struct queue_entry_priv_usb_bcn *bcn_priv;
550 unsigned int i; 550 unsigned int i;
@@ -561,7 +561,7 @@ static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev,
561 * no guardian byte was required for the beacon, 561 * no guardian byte was required for the beacon,
562 * then we are done. 562 * then we are done.
563 */ 563 */
564 if (rt2x00dev->bcn != queue || 564 if (queue->qid != QID_BEACON ||
565 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) 565 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
566 return 0; 566 return 0;
567 567
@@ -575,9 +575,9 @@ static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev,
575 return 0; 575 return 0;
576} 576}
577 577
578static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev, 578static void rt2x00usb_free_entries(struct data_queue *queue)
579 struct data_queue *queue)
580{ 579{
580 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
581 struct queue_entry_priv_usb *entry_priv; 581 struct queue_entry_priv_usb *entry_priv;
582 struct queue_entry_priv_usb_bcn *bcn_priv; 582 struct queue_entry_priv_usb_bcn *bcn_priv;
583 unsigned int i; 583 unsigned int i;
@@ -596,7 +596,7 @@ static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev,
596 * no guardian byte was required for the beacon, 596 * no guardian byte was required for the beacon,
597 * then we are done. 597 * then we are done.
598 */ 598 */
599 if (rt2x00dev->bcn != queue || 599 if (queue->qid != QID_BEACON ||
600 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) 600 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
601 return; 601 return;
602 602
@@ -623,7 +623,7 @@ int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev)
623 * Allocate DMA 623 * Allocate DMA
624 */ 624 */
625 queue_for_each(rt2x00dev, queue) { 625 queue_for_each(rt2x00dev, queue) {
626 status = rt2x00usb_alloc_urb(rt2x00dev, queue); 626 status = rt2x00usb_alloc_entries(queue);
627 if (status) 627 if (status)
628 goto exit; 628 goto exit;
629 } 629 }
@@ -642,7 +642,7 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev)
642 struct data_queue *queue; 642 struct data_queue *queue;
643 643
644 queue_for_each(rt2x00dev, queue) 644 queue_for_each(rt2x00dev, queue)
645 rt2x00usb_free_urb(rt2x00dev, queue); 645 rt2x00usb_free_entries(queue);
646} 646}
647EXPORT_SYMBOL_GPL(rt2x00usb_uninitialize); 647EXPORT_SYMBOL_GPL(rt2x00usb_uninitialize);
648 648