aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 86cd9a5eee2..559131fc6d5 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1123,13 +1123,10 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
/*
* Copy descriptor to the available headroom inside the skbuffer.
- * Remove the original copy by trimming the skbuffer.
*/
skb_push(entry->skb, offset);
memcpy(entry->skb->data, rxd, entry->queue->desc_size);
rxd = (__le32 *)entry->skb->data;
- skb_pull(entry->skb, offset);
- skb_trim(entry->skb, rxdesc->size);
/*
* The descriptor is now aligned to 4 bytes and thus it is
@@ -1155,11 +1152,17 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
/*
+ * Adjust the skb memory window to the frame boundaries.
+ */
+ skb_pull(entry->skb, offset);
+ skb_trim(entry->skb, rxdesc->size);
+
+ /*
* Set descriptor and data pointer.
*/
skbdesc->data = entry->skb->data;
skbdesc->data_len = rxdesc->size;
- skbdesc->desc = entry->skb->data - offset;
+ skbdesc->desc = rxd;
skbdesc->desc_len = entry->queue->desc_size;
}
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index a48c82f0921..468039f1bff 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1376,13 +1376,10 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
/*
* Copy descriptor to the available headroom inside the skbuffer.
- * Remove the original copy by pulling the skbuffer.
*/
skb_push(entry->skb, offset);
memcpy(entry->skb->data, rxd, entry->queue->desc_size);
rxd = (__le32 *)entry->skb->data;
- skb_pull(entry->skb, offset + entry->queue->desc_size);
- skb_trim(entry->skb, rxdesc->size);
/*
* The descriptor is now aligned to 4 bytes and thus it is
@@ -1405,11 +1402,17 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
/*
+ * Adjust the skb memory window to the frame boundaries.
+ */
+ skb_pull(entry->skb, offset + entry->queue->desc_size);
+ skb_trim(entry->skb, rxdesc->size);
+
+ /*
* Set descriptor and data pointer.
*/
skbdesc->data = entry->skb->data;
skbdesc->data_len = rxdesc->size;
- skbdesc->desc = entry->skb->data - offset;
+ skbdesc->desc = rxd;
skbdesc->desc_len = entry->queue->desc_size;
}