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.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 29dba86c8cf0..552f0e94f800 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -266,9 +266,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
266{ 266{
267 struct queue_entry *entry = (struct queue_entry *)urb->context; 267 struct queue_entry *entry = (struct queue_entry *)urb->context;
268 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 268 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
269 struct sk_buff *skb; 269 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
270 struct skb_frame_desc *skbdesc;
271 struct rxdone_entry_desc rxdesc;
272 u8 rxd[32]; 270 u8 rxd[32];
273 271
274 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || 272 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -284,36 +282,19 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
284 goto skip_entry; 282 goto skip_entry;
285 283
286 /* 284 /*
287 * Fill in skb descriptor 285 * Fill in desc fields of the skb descriptor
288 */ 286 */
289 skbdesc = get_skb_frame_desc(entry->skb);
290 memset(skbdesc, 0, sizeof(*skbdesc));
291 skbdesc->entry = entry;
292 skbdesc->desc = rxd; 287 skbdesc->desc = rxd;
293 skbdesc->desc_len = entry->queue->desc_size; 288 skbdesc->desc_len = entry->queue->desc_size;
294 289
295 memset(&rxdesc, 0, sizeof(rxdesc));
296 rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);
297
298 /*
299 * Allocate a new sk buffer to replace the current one.
300 * If allocation fails, we should drop the current frame
301 * so we can recycle the existing sk buffer for the new frame.
302 */
303 skb = rt2x00queue_alloc_skb(entry->queue);
304 if (!skb)
305 goto skip_entry;
306
307 /* 290 /*
308 * Send the frame to rt2x00lib for further processing. 291 * Send the frame to rt2x00lib for further processing.
309 */ 292 */
310 rt2x00lib_rxdone(entry, &rxdesc); 293 rt2x00lib_rxdone(rt2x00dev, entry);
311 294
312 /* 295 /*
313 * Replace current entry's skb with the newly allocated one, 296 * Reinitialize the urb.
314 * and reinitialize the urb.
315 */ 297 */
316 entry->skb = skb;
317 urb->transfer_buffer = entry->skb->data; 298 urb->transfer_buffer = entry->skb->data;
318 urb->transfer_buffer_length = entry->skb->len; 299 urb->transfer_buffer_length = entry->skb->len;
319 300