]> err.no Git - linux-2.6/commitdiff
rt2x00: Fix skbdesc->data_len initialization
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 10 Feb 2008 21:51:21 +0000 (22:51 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 29 Feb 2008 20:37:20 +0000 (15:37 -0500)
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: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00pci.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt73usb.c

index ab6e3f7f0f6158c7a75d7c4e15e3c2e81cc3b72d..f9d6f539a80fbf04bcfb22267abddc16434f1a2c 100644 (file)
@@ -1149,7 +1149,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
         * Set descriptor pointer.
         */
        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_len = entry->queue->desc_size;
 
index b8c6a8c9d6d2f3b06dc02f1b9b60198d21727748..8f88ca23c23a0840c427e34d294571d730bfbe45 100644 (file)
@@ -63,7 +63,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
        skbdesc->data = skb->data;
-       skbdesc->data_len = queue->data_size;
+       skbdesc->data_len = skb->len;
        skbdesc->desc = priv_tx->desc;
        skbdesc->desc_len = queue->desc_size;
        skbdesc->entry = entry;
@@ -131,7 +131,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
                skbdesc = get_skb_frame_desc(entry->skb);
                memset(skbdesc, 0, sizeof(*skbdesc));
                skbdesc->data = entry->skb->data;
-               skbdesc->data_len = queue->data_size;
+               skbdesc->data_len = entry->skb->len;
                skbdesc->desc = priv_rx->desc;
                skbdesc->desc_len = queue->desc_size;
                skbdesc->entry = entry;
index 4219057d85cb710ac7b0554ce481f92f887f7072..450043b6177302071cdff5ef538b4ab1a9c1b9d6 100644 (file)
@@ -254,7 +254,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
        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_len = queue->desc_size;
        skbdesc->entry = entry;
index d2096d2dd993412a60f95760147e849727d2bc82..5f3f74c2346381ed68936292cfe2f5cff03f4951 100644 (file)
@@ -1399,7 +1399,7 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
         * Set descriptor and data pointer.
         */
        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_len = entry->queue->desc_size;