diff options
author | Gertjan van Wingerde <gwingerde@kpnplanet.nl> | 2008-06-16 13:56:08 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-26 16:49:15 -0400 |
commit | 30caa6e3d586442f7c3ad081260ee1b22bb123de (patch) | |
tree | 094bc3a12f31bc418b95a366d3602f1ab34b75bf /drivers/net/wireless/rt2x00/rt2x00usb.c | |
parent | 14a3bf89212b5c758bd39bb4afc972c4ba6d599f (diff) |
rt2x00: Centralize allocation of RX skbs.
In preparation of replacing the statically allocated DMA buffers with
dynamically mapped skbs, centralize the allocation of RX skbs to rt2x00queue.c
and let rt2x00pci already use them.
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/rt2x00usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index f91901ffda5b..29dba86c8cf0 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -300,7 +300,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb) | |||
300 | * If allocation fails, we should drop the current frame | 300 | * If allocation fails, we should drop the current frame |
301 | * so we can recycle the existing sk buffer for the new frame. | 301 | * so we can recycle the existing sk buffer for the new frame. |
302 | */ | 302 | */ |
303 | skb = rt2x00queue_alloc_rxskb(entry->queue); | 303 | skb = rt2x00queue_alloc_skb(entry->queue); |
304 | if (!skb) | 304 | if (!skb) |
305 | goto skip_entry; | 305 | goto skip_entry; |
306 | 306 | ||
@@ -434,8 +434,6 @@ static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev, | |||
434 | entry_priv = queue->entries[i].priv_data; | 434 | entry_priv = queue->entries[i].priv_data; |
435 | usb_kill_urb(entry_priv->urb); | 435 | usb_kill_urb(entry_priv->urb); |
436 | usb_free_urb(entry_priv->urb); | 436 | usb_free_urb(entry_priv->urb); |
437 | if (queue->entries[i].skb) | ||
438 | kfree_skb(queue->entries[i].skb); | ||
439 | } | 437 | } |
440 | 438 | ||
441 | /* | 439 | /* |
@@ -457,10 +455,7 @@ static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev, | |||
457 | int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev) | 455 | int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev) |
458 | { | 456 | { |
459 | struct data_queue *queue; | 457 | struct data_queue *queue; |
460 | struct sk_buff *skb; | 458 | int status; |
461 | unsigned int entry_size; | ||
462 | unsigned int i; | ||
463 | int uninitialized_var(status); | ||
464 | 459 | ||
465 | /* | 460 | /* |
466 | * Allocate DMA | 461 | * Allocate DMA |
@@ -471,18 +466,6 @@ int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev) | |||
471 | goto exit; | 466 | goto exit; |
472 | } | 467 | } |
473 | 468 | ||
474 | /* | ||
475 | * For the RX queue, skb's should be allocated. | ||
476 | */ | ||
477 | entry_size = rt2x00dev->rx->data_size + rt2x00dev->rx->desc_size; | ||
478 | for (i = 0; i < rt2x00dev->rx->limit; i++) { | ||
479 | skb = rt2x00queue_alloc_rxskb(rt2x00dev->rx); | ||
480 | if (!skb) | ||
481 | goto exit; | ||
482 | |||
483 | rt2x00dev->rx->entries[i].skb = skb; | ||
484 | } | ||
485 | |||
486 | return 0; | 469 | return 0; |
487 | 470 | ||
488 | exit: | 471 | exit: |