rt2x00: skb->data pointer should not include TX descriptor
authorMattias Nissler <mattias.nissler@gmx.de>
Fri, 29 Aug 2008 19:07:20 +0000 (21:07 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 29 Aug 2008 20:24:12 +0000 (16:24 -0400)
Make sure the skb->data pointer points to the frame data, not the TX
descriptor. The frame dumping code relies on that.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
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/rt2x00usb.c
drivers/net/wireless/rt2x00/rt73usb.c

index c5f49e36559a205e71381a48c295bed9fc627931..0e008b606f70401101bb360d1e38c9a521217e4f 100644 (file)
@@ -1114,8 +1114,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
                           test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT,
-                          skb->len - skbdesc->desc_len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
        rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
index 2dd7c830c1257faf8afa95c933fa88a1ce3ca1e2..b73a7e0aeed4c54221435bbb3050326450dc093a 100644 (file)
@@ -167,11 +167,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
            !test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
                return;
 
-       /*
-        * Remove the descriptor data from the buffer.
-        */
-       skb_pull(entry->skb, entry->queue->desc_size);
-
        /*
         * Obtain the status about this packet.
         * Note that when the status is 0 it does not mean the
@@ -224,6 +219,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry)
                          entry->skb->data, length,
                          rt2x00usb_interrupt_txdone, entry);
 
+       /*
+        * Make sure the skb->data pointer points to the frame, not the
+        * descriptor.
+        */
+       skb_pull(entry->skb, entry->queue->desc_size);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);
index cf236ec533a9696cd50d99e5521a0884f4aa7bb5..e698ae0efbce0f5408685195f6a0c01be95cfe1d 100644 (file)
@@ -1556,8 +1556,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_KEY_TABLE,
                           test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT,
-                          skb->len - skbdesc->desc_len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
        rt2x00_set_field32(&word, TXD_W0_BURST2,
                           test_bit(ENTRY_TXD_BURST, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);