]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
rt2x00: Remove ieee80211_tx_control argument from write_tx_desc()
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 10 May 2008 11:42:31 +0000 (13:42 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 22 May 2008 01:47:31 +0000 (21:47 -0400)
Move the last remaining information details read from ieee80211_tx_control
in the drivers to the txentry_desc structure. After this we can
remove ieee80211_tx_control from the argument list for the callback function,
which makes it easier when the control information is moved into skb->cb

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

index 69b1dbd1adf0cc29818adce59f46e60ec45ce330..fb02d118075b1c75a0e3bba5e2462fb812dfd65a 100644 (file)
@@ -1001,8 +1001,7 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  */
 static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct sk_buff *skb,
-                                   struct txentry_desc *txdesc,
-                                   struct ieee80211_tx_control *control)
+                                   struct txentry_desc *txdesc)
 {
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
        __le32 *txd = skbdesc->desc;
@@ -1046,8 +1045,7 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
-                          !!(control->flags &
-                             IEEE80211_TXCTL_LONG_RETRY_LIMIT));
++                         test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
        rt2x00_desc_write(txd, 0, word);
 }
 
index aa195dab15541b3e7f11cfd3b4bf338e3ed0fc1f..1724ce90f8b158f1f2db152b0276e8d654a3817c 100644 (file)
@@ -1155,8 +1155,7 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  */
 static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct sk_buff *skb,
-                                   struct txentry_desc *txdesc,
-                                   struct ieee80211_tx_control *control)
+                                   struct txentry_desc *txdesc)
 {
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
        __le32 *txd = skbdesc->desc;
@@ -1198,9 +1197,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_CIPHER_OWNER, 1);
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
-                          !!(control->flags &
-                             IEEE80211_TXCTL_LONG_RETRY_LIMIT));
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
+                          test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
index 88bafdf8f0fa1cbf6e060c9a0ad2e55da8c7cf6f..7df06ece1b45331df40266569ccaf89032e57772 100644 (file)
@@ -1033,8 +1033,7 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
  */
 static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct sk_buff *skb,
-                                   struct txentry_desc *txdesc,
-                                   struct ieee80211_tx_control *control)
+                                   struct txentry_desc *txdesc)
 {
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
        __le32 *txd = skbdesc->desc;
@@ -1058,7 +1057,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_desc_write(txd, 2, word);
 
        rt2x00_desc_read(txd, 0, &word);
-       rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, control->retry_limit);
+       rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit);
        rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
                           test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_ACK,
@@ -1068,7 +1067,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_OFDM,
                           test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
-                          !!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT));
+                          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_CIPHER, CIPHER_NONE);
index 79bd9c9f896312185b52db85be7a85d8ec22fcf8..65614841f748ebbdab733409b661a3f65e2ee12d 100644 (file)
@@ -540,8 +540,7 @@ struct rt2x00lib_ops {
         */
        void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
                               struct sk_buff *skb,
-                              struct txentry_desc *txdesc,
-                              struct ieee80211_tx_control *control);
+                              struct txentry_desc *txdesc);
        int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
                              struct data_queue *queue, struct sk_buff *skb,
                              struct ieee80211_tx_control *control);
index 69da22cf085c12bc3fb3b41d349f04b8bbb4186a..e1368f7098589398c5779df9769846ca5ca7b2ea 100644 (file)
@@ -664,7 +664,12 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                        tx_rate = control->rts_cts_rate->hw_value;
        }
 
-       rate = rt2x00_get_rate(tx_rate);
+       /*
+        * Determine retry information.
+        */
+       txdesc.retry_limit = control->retry_limit;
+       if (control->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT)
+               __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc.flags);
 
        /*
         * Check if more fragments are pending
@@ -686,16 +691,20 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
         * Set ifs to IFS_SIFS when the this is not the first fragment,
         * or this fragment came after RTS/CTS.
         */
-       if ((seq_ctrl & IEEE80211_SCTL_FRAG) > 0 ||
-           test_bit(ENTRY_TXD_RTS_FRAME, &txdesc.flags))
+       if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc.flags)) {
                txdesc.ifs = IFS_SIFS;
-       else
+       } else if (control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) {
+               __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc.flags);
                txdesc.ifs = IFS_BACKOFF;
+       } else {
+               txdesc.ifs = IFS_SIFS;
+       }
 
        /*
         * PLCP setup
         * Length calculation depends on OFDM/CCK rate.
         */
+       rate = rt2x00_get_rate(tx_rate);
        txdesc.signal = rate->plcp;
        txdesc.service = 0x04;
 
@@ -733,7 +742,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                        txdesc.signal |= 0x08;
        }
 
-       rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &txdesc, control);
+       rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &txdesc);
 
        /*
         * Update queue entry.
index f361f784965edfa0754aa936ca7ba7c30e559a71..3f7cfa9b7da5a0cc6da300c39bd18d7608c95e3a 100644 (file)
@@ -204,18 +204,22 @@ struct txdone_entry_desc {
  *
  * @ENTRY_TXD_RTS_FRAME: This frame is a RTS frame.
  * @ENTRY_TXD_OFDM_RATE: This frame is send out with an OFDM rate.
+ * @ENTRY_TXD_FIRST_FRAGMENT: This is the first frame.
  * @ENTRY_TXD_MORE_FRAG: This frame is followed by another fragment.
  * @ENTRY_TXD_REQ_TIMESTAMP: Require timestamp to be inserted.
  * @ENTRY_TXD_BURST: This frame belongs to the same burst event.
  * @ENTRY_TXD_ACK: An ACK is required for this frame.
+ * @ENTRY_TXD_RETRY_MODE: When set, the long retry count is used.
  */
 enum txentry_desc_flags {
        ENTRY_TXD_RTS_FRAME,
        ENTRY_TXD_OFDM_RATE,
+       ENTRY_TXD_FIRST_FRAGMENT,
        ENTRY_TXD_MORE_FRAG,
        ENTRY_TXD_REQ_TIMESTAMP,
        ENTRY_TXD_BURST,
        ENTRY_TXD_ACK,
+       ENTRY_TXD_RETRY_MODE,
 };
 
 /**
@@ -229,6 +233,7 @@ enum txentry_desc_flags {
  * @length_low: PLCP length low word.
  * @signal: PLCP signal.
  * @service: PLCP service.
+ * @retry_limit: Max number of retries.
  * @aifs: AIFS value.
  * @ifs: IFS value.
  * @cw_min: cwmin value.
@@ -244,10 +249,11 @@ struct txentry_desc {
        u16 signal;
        u16 service;
 
-       int aifs;
-       int ifs;
-       int cw_min;
-       int cw_max;
+       short retry_limit;
+       short aifs;
+       short ifs;
+       short cw_min;
+       short cw_max;
 };
 
 /**
index 15191d6581b18466746af16e8b51ae66c9e37356..5d690ee1befaf6e2efb8dc8e2b9ead52ec848d7b 100644 (file)
@@ -1526,8 +1526,7 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  */
 static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct sk_buff *skb,
-                                   struct txentry_desc *txdesc,
-                                   struct ieee80211_tx_control *control)
+                                   struct txentry_desc *txdesc)
 {
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
        __le32 *txd = skbdesc->desc;
@@ -1577,8 +1576,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
-                          !!(control->flags &
-                             IEEE80211_TXCTL_LONG_RETRY_LIMIT));
+                          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_BURST,
index 51c5575ed02fe73989e82fa9b1706c4ee00668f3..d98002cfe091b750895e381a9453218701d57242 100644 (file)
@@ -1255,8 +1255,7 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
  */
 static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct sk_buff *skb,
-                                   struct txentry_desc *txdesc,
-                                   struct ieee80211_tx_control *control)
+                                   struct txentry_desc *txdesc)
 {
        struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
        __le32 *txd = skbdesc->desc;
@@ -1301,8 +1300,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           test_bit(ENTRY_TXD_OFDM_RATE, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
-                          !!(control->flags &
-                             IEEE80211_TXCTL_LONG_RETRY_LIMIT));
+                          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_BURST2,