]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
rt2x00: Cleanup write_tx_desc() arguments
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 6 Jan 2008 22:41:10 +0000 (23:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:09:26 +0000 (15:09 -0800)
Send the skb structure with write_tx_desc() and use
the skbdesc structure to read all information about
the frame. This saves several arguments in the function
definition and it is easier to send more information
later as well.

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/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index b042eb551cde032b0440e6a97cbbeb5752f376c9..ffc7e208f9b247af68715e6ef9ae3c9022e3a46a 100644 (file)
@@ -1012,19 +1012,19 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                   __le32 *txd,
+                                   struct sk_buff *skb,
                                    struct txdata_entry_desc *desc,
-                                   struct ieee80211_hdr *ieee80211hdr,
-                                   unsigned int length,
                                    struct ieee80211_tx_control *control)
 {
+       struct skb_desc *skbdesc = get_skb_desc(skb);
+       __le32 *txd = skbdesc->desc;
        u32 word;
 
        /*
         * Start writing the descriptor words.
         */
        rt2x00_desc_read(txd, 2, &word);
-       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, length);
+       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skbdesc->data_len);
        rt2x00_desc_write(txd, 2, word);
 
        rt2x00_desc_read(txd, 3, &word);
index c92163d2d9ab9eb4996d621b303072b33aaf8508..81a48e88f2a0e702a0c71e257c605146a89ee412 100644 (file)
@@ -1162,12 +1162,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                   __le32 *txd,
+                                   struct sk_buff *skb,
                                    struct txdata_entry_desc *desc,
-                                   struct ieee80211_hdr *ieee80211hdr,
-                                   unsigned int length,
                                    struct ieee80211_tx_control *control)
 {
+       struct skb_desc *skbdesc = get_skb_desc(skb);
+       __le32 *txd = skbdesc->desc;
        u32 word;
 
        /*
@@ -1208,7 +1208,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
                           !!(control->flags &
                              IEEE80211_TXCTL_LONG_RETRY_LIMIT));
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
index 3dca09d6e3197914ada43a4469ada6b9f4ef1564..86eefb45360657d68860c61f76924e7418825772 100644 (file)
@@ -1024,12 +1024,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                   __le32 *txd,
+                                   struct sk_buff *skb,
                                    struct txdata_entry_desc *desc,
-                                   struct ieee80211_hdr *ieee80211hdr,
-                                   unsigned int length,
                                    struct ieee80211_tx_control *control)
 {
+       struct skb_desc *skbdesc = get_skb_desc(skb);
+       __le32 *txd = skbdesc->desc;
        u32 word;
 
        /*
@@ -1062,7 +1062,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
                           !!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT));
        rt2x00_set_field32(&word, TXD_W0_IFS, desc->ifs);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
        rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
index be1fc0aebadcf5b06e23efbd06cf07194c2349c8..0cd847c5241e5efb2b5a9f1ba33d8f1c378a0912 100644 (file)
@@ -488,10 +488,8 @@ struct rt2x00lib_ops {
         * TX control handlers
         */
        void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
-                              __le32 *txd,
+                              struct sk_buff *skb,
                               struct txdata_entry_desc *desc,
-                              struct ieee80211_hdr *ieee80211hdr,
-                              unsigned int length,
                               struct ieee80211_tx_control *control);
        int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
                              struct data_ring *ring, struct sk_buff *skb,
index 911060df803778729efb95802d0ffdfd3aa89403..a95cf531f083210c5ce7d07419e22096fbe465b7 100644 (file)
@@ -601,7 +601,6 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        struct txdata_entry_desc desc;
        struct skb_desc *skbdesc = get_skb_desc(skb);
        struct ieee80211_hdr *ieee80211hdr = skbdesc->data;
-       __le32 *txd = skbdesc->desc;
        int tx_rate;
        int bitrate;
        int length;
@@ -729,8 +728,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                        desc.signal |= 0x08;
        }
 
-       rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, txd, &desc, ieee80211hdr,
-                                          skbdesc->data_len, control);
+       rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &desc, control);
 
        /*
         * Update ring entry.
index 5c78c4cf80ae6b982b29fe011b79e7f9b088c2ed..35e7607cf16418a86aeee819b4782ac125621985 100644 (file)
@@ -1533,12 +1533,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                 __le32 *txd,
-                                 struct txdata_entry_desc *desc,
-                                 struct ieee80211_hdr *ieee80211hdr,
-                                 unsigned int length,
-                                 struct ieee80211_tx_control *control)
+                                   struct sk_buff *skb,
+                                   struct txdata_entry_desc *desc,
+                                   struct ieee80211_tx_control *control)
 {
+       struct skb_desc *skbdesc = get_skb_desc(skb);
+       __le32 *txd = skbdesc->desc;
        u32 word;
 
        /*
@@ -1567,7 +1567,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_desc_write(txd, 5, word);
 
        rt2x00_desc_read(txd, 11, &word);
-       rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, length);
+       rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
        rt2x00_desc_write(txd, 11, word);
 
        rt2x00_desc_read(txd, 0, &word);
@@ -1586,7 +1586,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           !!(control->flags &
                              IEEE80211_TXCTL_LONG_RETRY_LIMIT));
        rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
        rt2x00_set_field32(&word, TXD_W0_BURST,
                           test_bit(ENTRY_TXD_BURST, &desc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
index f2d1810fb3fe675155dad7f2eda7a16a2e002992..29824701e7036f7f79fdf2874c9fa0079922d0fb 100644 (file)
@@ -1231,12 +1231,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                 __le32 *txd,
-                                 struct txdata_entry_desc *desc,
-                                 struct ieee80211_hdr *ieee80211hdr,
-                                 unsigned int length,
-                                 struct ieee80211_tx_control *control)
+                                   struct sk_buff *skb,
+                                   struct txdata_entry_desc *desc,
+                                   struct ieee80211_tx_control *control)
 {
+       struct skb_desc *skbdesc = get_skb_desc(skb);
+       __le32 *txd = skbdesc->desc;
        u32 word;
 
        /*
@@ -1281,7 +1281,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           !!(control->flags &
                              IEEE80211_TXCTL_LONG_RETRY_LIMIT));
        rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
        rt2x00_set_field32(&word, TXD_W0_BURST2,
                           test_bit(ENTRY_TXD_BURST, &desc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);