]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
rt2x00: Use skbdesc fields for descriptor initialization
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 9 Mar 2008 21:41:53 +0000 (22:41 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 13 Mar 2008 20:02:34 +0000 (16:02 -0400)
In rt2x00lib_write_tx_desc() the skb->data and skb->len fields
were incorrectly used. For USB drivers both of those values
contain invalid data (skb->data points to the device descriptor,
skb->len contains the frame _and_ descriptor length).

Instead of using the skbuffer fields we should use the skbdesc
fields which are correctly initialized and contain all the data
that we need.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00dev.c

index 141b9b8a1997428942f269d5370ea9b17c90dce1..455d0763503e70a95fb43b70aa47f621ae0972f1 100644 (file)
@@ -630,7 +630,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 {
        struct txentry_desc txdesc;
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
-       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skbdesc->data;
        const struct rt2x00_rate *rate;
        int tx_rate;
        int length;
@@ -710,7 +710,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        txdesc.signal = rate->plcp;
        txdesc.service = 0x04;
 
-       length = skb->len + FCS_LEN;
+       length = skbdesc->data_len + FCS_LEN;
        if (rate->flags & DEV_RATE_OFDM) {
                __set_bit(ENTRY_TXD_OFDM_RATE, &txdesc.flags);