diff options
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 97597543c70b..1c91812df173 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -211,9 +211,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
211 | struct txentry_desc *txdesc) | 211 | struct txentry_desc *txdesc) |
212 | { | 212 | { |
213 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 213 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
214 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | ||
215 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | ||
216 | u32 length; | ||
217 | 214 | ||
218 | /* | 215 | /* |
219 | * Add the descriptor in front of the skb. | 216 | * Add the descriptor in front of the skb. |
@@ -222,18 +219,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
222 | memset(entry->skb->data, 0, entry->queue->desc_size); | 219 | memset(entry->skb->data, 0, entry->queue->desc_size); |
223 | 220 | ||
224 | /* | 221 | /* |
225 | * USB devices cannot blindly pass the skb->len as the | ||
226 | * length of the data to usb_fill_bulk_urb. Pass the skb | ||
227 | * to the driver to determine what the length should be. | ||
228 | */ | ||
229 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); | ||
230 | |||
231 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, | ||
232 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), | ||
233 | entry->skb->data, length, | ||
234 | rt2x00usb_interrupt_txdone, entry); | ||
235 | |||
236 | /* | ||
237 | * Call the driver's write_tx_datadesc function, if it exists. | 222 | * Call the driver's write_tx_datadesc function, if it exists. |
238 | */ | 223 | */ |
239 | if (rt2x00dev->ops->lib->write_tx_datadesc) | 224 | if (rt2x00dev->ops->lib->write_tx_datadesc) |
@@ -245,10 +230,26 @@ EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data); | |||
245 | 230 | ||
246 | static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) | 231 | static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) |
247 | { | 232 | { |
233 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
234 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | ||
248 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | 235 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; |
236 | u32 length; | ||
237 | |||
238 | if (test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags)) { | ||
239 | /* | ||
240 | * USB devices cannot blindly pass the skb->len as the | ||
241 | * length of the data to usb_fill_bulk_urb. Pass the skb | ||
242 | * to the driver to determine what the length should be. | ||
243 | */ | ||
244 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); | ||
245 | |||
246 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, | ||
247 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), | ||
248 | entry->skb->data, length, | ||
249 | rt2x00usb_interrupt_txdone, entry); | ||
249 | 250 | ||
250 | if (test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags)) | ||
251 | usb_submit_urb(entry_priv->urb, GFP_ATOMIC); | 251 | usb_submit_urb(entry_priv->urb, GFP_ATOMIC); |
252 | } | ||
252 | } | 253 | } |
253 | 254 | ||
254 | void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 255 | void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, |