Commit 647d0ca9 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Fix skbdesc->data_len initialization

skbdesc->data_len was not initialized correctly
in rt2x00pci, rt2x00usb, rt2500usb and rt73usb.

The value was set to queue->data_size which
means that the incorrect frame size was pased
to the upper layers.

Correctly base the value on either the skb->len,
or the rx frame size passed to the driver by the
device.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 417f412f
...@@ -1149,7 +1149,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, ...@@ -1149,7 +1149,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
* Set descriptor pointer. * Set descriptor pointer.
*/ */
skbdesc->data = entry->skb->data; skbdesc->data = entry->skb->data;
skbdesc->data_len = entry->queue->data_size; skbdesc->data_len = rxdesc->size;
skbdesc->desc = entry->skb->data + rxdesc->size; skbdesc->desc = entry->skb->data + rxdesc->size;
skbdesc->desc_len = entry->queue->desc_size; skbdesc->desc_len = entry->queue->desc_size;
......
...@@ -63,7 +63,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev, ...@@ -63,7 +63,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
skbdesc = get_skb_frame_desc(skb); skbdesc = get_skb_frame_desc(skb);
memset(skbdesc, 0, sizeof(*skbdesc)); memset(skbdesc, 0, sizeof(*skbdesc));
skbdesc->data = skb->data; skbdesc->data = skb->data;
skbdesc->data_len = queue->data_size; skbdesc->data_len = skb->len;
skbdesc->desc = priv_tx->desc; skbdesc->desc = priv_tx->desc;
skbdesc->desc_len = queue->desc_size; skbdesc->desc_len = queue->desc_size;
skbdesc->entry = entry; skbdesc->entry = entry;
...@@ -131,7 +131,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) ...@@ -131,7 +131,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
skbdesc = get_skb_frame_desc(entry->skb); skbdesc = get_skb_frame_desc(entry->skb);
memset(skbdesc, 0, sizeof(*skbdesc)); memset(skbdesc, 0, sizeof(*skbdesc));
skbdesc->data = entry->skb->data; skbdesc->data = entry->skb->data;
skbdesc->data_len = queue->data_size; skbdesc->data_len = entry->skb->len;
skbdesc->desc = priv_rx->desc; skbdesc->desc = priv_rx->desc;
skbdesc->desc_len = queue->desc_size; skbdesc->desc_len = queue->desc_size;
skbdesc->entry = entry; skbdesc->entry = entry;
......
...@@ -254,7 +254,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, ...@@ -254,7 +254,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
skbdesc = get_skb_frame_desc(skb); skbdesc = get_skb_frame_desc(skb);
memset(skbdesc, 0, sizeof(*skbdesc)); memset(skbdesc, 0, sizeof(*skbdesc));
skbdesc->data = skb->data + queue->desc_size; skbdesc->data = skb->data + queue->desc_size;
skbdesc->data_len = queue->data_size; skbdesc->data_len = skb->len - queue->desc_size;
skbdesc->desc = skb->data; skbdesc->desc = skb->data;
skbdesc->desc_len = queue->desc_size; skbdesc->desc_len = queue->desc_size;
skbdesc->entry = entry; skbdesc->entry = entry;
......
...@@ -1399,7 +1399,7 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, ...@@ -1399,7 +1399,7 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
* Set descriptor and data pointer. * Set descriptor and data pointer.
*/ */
skbdesc->data = entry->skb->data + entry->queue->desc_size; skbdesc->data = entry->skb->data + entry->queue->desc_size;
skbdesc->data_len = entry->queue->data_size; skbdesc->data_len = rxdesc->size;
skbdesc->desc = entry->skb->data; skbdesc->desc = entry->skb->data;
skbdesc->desc_len = entry->queue->desc_size; skbdesc->desc_len = entry->queue->desc_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment