diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 1e31050dafc9..2eea3866504d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -298,12 +298,22 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void* data) | |||
298 | return false; | 298 | return false; |
299 | 299 | ||
300 | /* | 300 | /* |
301 | * USB devices cannot blindly pass the skb->len as the | 301 | * USB devices require certain padding at the end of each frame |
302 | * length of the data to usb_fill_bulk_urb. Pass the skb | 302 | * and urb. Those paddings are not included in skbs. Pass entry |
303 | * to the driver to determine what the length should be. | 303 | * to the driver to determine what the overall length should be. |
304 | */ | 304 | */ |
305 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); | 305 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); |
306 | 306 | ||
307 | status = skb_padto(entry->skb, length); | ||
308 | if (unlikely(status)) { | ||
309 | /* TODO: report something more appropriate than IO_FAILED. */ | ||
310 | WARNING(rt2x00dev, "TX SKB padding error, out of memory\n"); | ||
311 | set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); | ||
312 | rt2x00lib_dmadone(entry); | ||
313 | |||
314 | return false; | ||
315 | } | ||
316 | |||
307 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, | 317 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, |
308 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), | 318 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), |
309 | entry->skb->data, length, | 319 | entry->skb->data, length, |