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.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 2050227ea530..b73a7e0aeed4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -163,16 +163,11 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
163 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 163 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
164 struct txdone_entry_desc txdesc; 164 struct txdone_entry_desc txdesc;
165 165
166 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || 166 if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) ||
167 !test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) 167 !test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
168 return; 168 return;
169 169
170 /* 170 /*
171 * Remove the descriptor data from the buffer.
172 */
173 skb_pull(entry->skb, entry->queue->desc_size);
174
175 /*
176 * Obtain the status about this packet. 171 * Obtain the status about this packet.
177 * Note that when the status is 0 it does not mean the 172 * Note that when the status is 0 it does not mean the
178 * frame was send out correctly. It only means the frame 173 * frame was send out correctly. It only means the frame
@@ -224,6 +219,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry)
224 entry->skb->data, length, 219 entry->skb->data, length,
225 rt2x00usb_interrupt_txdone, entry); 220 rt2x00usb_interrupt_txdone, entry);
226 221
222 /*
223 * Make sure the skb->data pointer points to the frame, not the
224 * descriptor.
225 */
226 skb_pull(entry->skb, entry->queue->desc_size);
227
227 return 0; 228 return 0;
228} 229}
229EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data); 230EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);
@@ -232,7 +233,7 @@ static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
232{ 233{
233 struct queue_entry_priv_usb *entry_priv = entry->priv_data; 234 struct queue_entry_priv_usb *entry_priv = entry->priv_data;
234 235
235 if (__test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags)) 236 if (test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags))
236 usb_submit_urb(entry_priv->urb, GFP_ATOMIC); 237 usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
237} 238}
238 239
@@ -283,7 +284,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
283 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); 284 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
284 u8 rxd[32]; 285 u8 rxd[32];
285 286
286 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || 287 if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) ||
287 !test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) 288 !test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
288 return; 289 return;
289 290
@@ -293,7 +294,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
293 * a problem. 294 * a problem.
294 */ 295 */
295 if (urb->actual_length < entry->queue->desc_size || urb->status) { 296 if (urb->actual_length < entry->queue->desc_size || urb->status) {
296 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 297 set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
297 usb_submit_urb(urb, GFP_ATOMIC); 298 usb_submit_urb(urb, GFP_ATOMIC);
298 return; 299 return;
299 } 300 }
@@ -361,7 +362,7 @@ void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev,
361 entry->skb->data, entry->skb->len, 362 entry->skb->data, entry->skb->len,
362 rt2x00usb_interrupt_rxdone, entry); 363 rt2x00usb_interrupt_rxdone, entry);
363 364
364 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 365 set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
365 usb_submit_urb(entry_priv->urb, GFP_ATOMIC); 366 usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
366} 367}
367EXPORT_SYMBOL_GPL(rt2x00usb_init_rxentry); 368EXPORT_SYMBOL_GPL(rt2x00usb_init_rxentry);