diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index b45bc24c3dae..a22837c560fd 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -178,11 +178,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
178 | return; | 178 | return; |
179 | 179 | ||
180 | /* | 180 | /* |
181 | * Remove the descriptor from the front of the skb. | ||
182 | */ | ||
183 | skb_pull(entry->skb, entry->queue->desc_size); | ||
184 | |||
185 | /* | ||
186 | * Obtain the status about this packet. | 181 | * Obtain the status about this packet. |
187 | * Note that when the status is 0 it does not mean the | 182 | * Note that when the status is 0 it does not mean the |
188 | * frame was send out correctly. It only means the frame | 183 | * frame was send out correctly. It only means the frame |
@@ -201,48 +196,28 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
201 | rt2x00lib_txdone(entry, &txdesc); | 196 | rt2x00lib_txdone(entry, &txdesc); |
202 | } | 197 | } |
203 | 198 | ||
204 | int rt2x00usb_write_tx_data(struct queue_entry *entry, | 199 | static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) |
205 | struct txentry_desc *txdesc) | ||
206 | { | 200 | { |
207 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 201 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
208 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 202 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
209 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | 203 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; |
210 | u32 length; | 204 | u32 length; |
211 | 205 | ||
212 | /* | 206 | if (test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags)) { |
213 | * Add the descriptor in front of the skb. | 207 | /* |
214 | */ | 208 | * USB devices cannot blindly pass the skb->len as the |
215 | skb_push(entry->skb, entry->queue->desc_size); | 209 | * length of the data to usb_fill_bulk_urb. Pass the skb |
216 | memset(entry->skb->data, 0, entry->queue->desc_size); | 210 | * to the driver to determine what the length should be. |
217 | 211 | */ | |
218 | /* | 212 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); |
219 | * USB devices cannot blindly pass the skb->len as the | ||
220 | * length of the data to usb_fill_bulk_urb. Pass the skb | ||
221 | * to the driver to determine what the length should be. | ||
222 | */ | ||
223 | length = rt2x00dev->ops->lib->get_tx_data_len(entry); | ||
224 | |||
225 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, | ||
226 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), | ||
227 | entry->skb->data, length, | ||
228 | rt2x00usb_interrupt_txdone, entry); | ||
229 | |||
230 | /* | ||
231 | * Call the driver's write_tx_datadesc function, if it exists. | ||
232 | */ | ||
233 | if (rt2x00dev->ops->lib->write_tx_datadesc) | ||
234 | rt2x00dev->ops->lib->write_tx_datadesc(entry, txdesc); | ||
235 | |||
236 | return 0; | ||
237 | } | ||
238 | EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data); | ||
239 | 213 | ||
240 | static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) | 214 | usb_fill_bulk_urb(entry_priv->urb, usb_dev, |
241 | { | 215 | usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint), |
242 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | 216 | entry->skb->data, length, |
217 | rt2x00usb_interrupt_txdone, entry); | ||
243 | 218 | ||
244 | if (test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags)) | ||
245 | usb_submit_urb(entry_priv->urb, GFP_ATOMIC); | 219 | usb_submit_urb(entry_priv->urb, GFP_ATOMIC); |
220 | } | ||
246 | } | 221 | } |
247 | 222 | ||
248 | void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 223 | void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, |