]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
rt2x00: Cleanup struct skb_frame_desc.
authorGertjan van Wingerde <gwingerde@wingerd.gvw.nl>
Fri, 6 Jun 2008 20:54:08 +0000 (22:54 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Sat, 14 Jun 2008 16:17:56 +0000 (12:17 -0400)
The data and data_len fields aren't really necessary in struct
skb_frame_desc, as they can be deduced from the skb itself.

Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00debug.c
drivers/net/wireless/rt2x00/rt2x00pci.c
drivers/net/wireless/rt2x00/rt2x00queue.h
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index b5b0ded83e0fec3afc1808751e0058590703f54e..bb3d83560d02ae2e1ae6d4dfffa11c14dd185266 100644 (file)
@@ -1016,8 +1016,8 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_desc_write(entry_priv->desc, 1, word);
 
        rt2x00_desc_read(txd, 2, &word);
-       rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, skbdesc->data_len);
-       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skbdesc->data_len);
+       rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, skb->len);
+       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skb->len);
        rt2x00_desc_write(txd, 2, word);
 
        rt2x00_desc_read(txd, 3, &word);
@@ -1507,8 +1507,6 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
         */
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = skb->data;
-       skbdesc->data_len = skb->len;
        skbdesc->desc = entry_priv->desc;
        skbdesc->desc_len = intf->beacon->queue->desc_size;
        skbdesc->entry = intf->beacon;
index 74b54c948b8df7f7a8ad2e0d58628b2ae10d1246..3c956b91c4e3b8f75ee08c1725889e9cc7aeac08 100644 (file)
@@ -1823,8 +1823,6 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
         */
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = skb->data;
-       skbdesc->data_len = skb->len;
        skbdesc->desc = entry_priv->desc;
        skbdesc->desc_len = intf->beacon->queue->desc_size;
        skbdesc->entry = intf->beacon;
index 076221413db7014fa2bfc4e7ce2b582f12ae956d..1bfb68a920a81ee9af8655638770538202edf35a 100644 (file)
@@ -1088,7 +1088,8 @@ 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, skbdesc->data_len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT,
+                          skb->len - skbdesc->desc_len);
        rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
@@ -1196,8 +1197,6 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
         * Adjust the skb memory window to the frame boundaries.
         */
        skb_trim(entry->skb, rxdesc->size);
-       skbdesc->data = entry->skb->data;
-       skbdesc->data_len = rxdesc->size;
 }
 
 /*
@@ -1711,8 +1710,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
         */
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = skb->data + intf->beacon->queue->desc_size;
-       skbdesc->data_len = skb->len - intf->beacon->queue->desc_size;
        skbdesc->desc = skb->data;
        skbdesc->desc_len = intf->beacon->queue->desc_size;
        skbdesc->entry = intf->beacon;
index bd92cb8e68e059131ef70674b46188d84fea917f..300cf061035ffcd70303b6a5a7730267dabeb058 100644 (file)
@@ -133,7 +133,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
                return;
        }
 
-       skbcopy = alloc_skb(sizeof(*dump_hdr) + desc->desc_len + desc->data_len,
+       skbcopy = alloc_skb(sizeof(*dump_hdr) + desc->desc_len + skb->len,
                            GFP_ATOMIC);
        if (!skbcopy) {
                DEBUG(rt2x00dev, "Failed to copy skb for dump.\n");
@@ -144,7 +144,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
        dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION);
        dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr));
        dump_hdr->desc_length = cpu_to_le32(desc->desc_len);
-       dump_hdr->data_length = cpu_to_le32(desc->data_len);
+       dump_hdr->data_length = cpu_to_le32(skb->len);
        dump_hdr->chip_rt = cpu_to_le16(rt2x00dev->chip.rt);
        dump_hdr->chip_rf = cpu_to_le16(rt2x00dev->chip.rf);
        dump_hdr->chip_rev = cpu_to_le32(rt2x00dev->chip.rev);
@@ -155,7 +155,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
        dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);
 
        memcpy(skb_put(skbcopy, desc->desc_len), desc->desc, desc->desc_len);
-       memcpy(skb_put(skbcopy, desc->data_len), desc->data, desc->data_len);
+       memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len);
 
        skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy);
        wake_up_interruptible(&intf->frame_dump_waitqueue);
index 9745277c81ce10b1fca9b2ee4f27d0110e4f42cd..a9819aad5e7dd24c2cad58e6e9d97f43a843b9c0 100644 (file)
@@ -61,8 +61,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry)
         */
        skbdesc = get_skb_frame_desc(entry->skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = entry->skb->data;
-       skbdesc->data_len = entry->skb->len;
        skbdesc->desc = entry_priv->desc;
        skbdesc->desc_len = entry->queue->desc_size;
        skbdesc->entry = entry;
@@ -126,8 +124,6 @@ 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 = entry->skb->len;
                skbdesc->desc = entry_priv->desc;
                skbdesc->desc_len = queue->desc_size;
                skbdesc->entry = entry;
index 623fc27dc7bbfcabda725b6f44fb080384303265..fcf52520b016724070e32021776938a3a2f25168 100644 (file)
@@ -105,11 +105,8 @@ enum data_queue_qid {
 struct skb_frame_desc {
        unsigned int flags;
 
-       unsigned short data_len;
-       unsigned short desc_len;
-
-       void *data;
        void *desc;
+       unsigned int desc_len;
 
        struct queue_entry *entry;
 };
index 8cf6e3f253e91357600d4ea9ab32bd37745259a6..797023cad947df6caea8bc270288fa0c4870dcef 100644 (file)
@@ -192,8 +192,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry)
         */
        skbdesc = get_skb_frame_desc(entry->skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = entry->skb->data + entry->queue->desc_size;
-       skbdesc->data_len = entry->skb->len - entry->queue->desc_size;
        skbdesc->desc = entry->skb->data;
        skbdesc->desc_len = entry->queue->desc_size;
        skbdesc->entry = entry;
@@ -352,7 +350,6 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
        }
 
        /* Update data pointers, trim buffer to correct size */
-       skbdesc->data = entry->skb->data;
        skb_trim(entry->skb, rxdesc.size);
 
        /*
index 746f87c8e704fdb75dad51ed151bae79ce422cb6..5b7267ece1b9f94302eb5ea5933c16d5326ec941 100644 (file)
@@ -1562,7 +1562,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 
        if (skbdesc->desc_len > TXINFO_SIZE) {
                rt2x00_desc_read(txd, 11, &word);
-               rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
+               rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skb->len);
                rt2x00_desc_write(txd, 11, word);
        }
 
@@ -1581,7 +1581,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
                           test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
        rt2x00_set_field32(&word, TXD_W0_BURST,
                           test_bit(ENTRY_TXD_BURST, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
@@ -2375,8 +2375,6 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
         */
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = skb->data;
-       skbdesc->data_len = skb->len;
        skbdesc->desc = entry_priv->desc;
        skbdesc->desc_len = intf->beacon->queue->desc_size;
        skbdesc->entry = intf->beacon;
@@ -2401,7 +2399,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
                                      skbdesc->desc, skbdesc->desc_len);
        rt2x00pci_register_multiwrite(rt2x00dev,
                                      beacon_base + skbdesc->desc_len,
-                                     skbdesc->data, skbdesc->data_len);
+                                     skb->data, skb->len);
        rt61pci_kick_tx_queue(rt2x00dev, QID_BEACON);
 
        return 0;
index ae50f6332dfae0f6df59e5cbec6b08a2cd1c0f22..800a1e278d1ea5945c87535a6780d09525ec9118 100644 (file)
@@ -1320,7 +1320,8 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
                           test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT,
+                          skb->len - skbdesc->desc_len);
        rt2x00_set_field32(&word, TXD_W0_BURST2,
                           test_bit(ENTRY_TXD_BURST, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
@@ -1466,8 +1467,6 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
         */
        skb_pull(entry->skb, entry->queue->desc_size);
        skb_trim(entry->skb, rxdesc->size);
-       skbdesc->data = entry->skb->data;
-       skbdesc->data_len = rxdesc->size;
 }
 
 /*
@@ -1980,8 +1979,6 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
         */
        skbdesc = get_skb_frame_desc(skb);
        memset(skbdesc, 0, sizeof(*skbdesc));
-       skbdesc->data = skb->data + intf->beacon->queue->desc_size;
-       skbdesc->data_len = skb->len - intf->beacon->queue->desc_size;
        skbdesc->desc = skb->data;
        skbdesc->desc_len = intf->beacon->queue->desc_size;
        skbdesc->entry = intf->beacon;