rt2x00: Register frame length in TX entry descriptor instead of L2PAD.
authorGertjan van Wingerde <gwingerde@gmail.com>
Mon, 3 May 2010 20:43:05 +0000 (22:43 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 May 2010 17:24:23 +0000 (13:24 -0400)
And use it consistently in the chipset drivers.
Preparation for further clean ups.

Signed-off-by: Gertjan van Wingerde <gwingerde@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/rt2800pci.c
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2x00queue.c
drivers/net/wireless/rt2x00/rt2x00queue.h
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 08a4789fc2d82e3f91447f048e14df48d8fcfc6f..6f898913492af6dc37691b5fa0be5b53ba4265da 100644 (file)
@@ -1017,8 +1017,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, skb->len);
-       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skb->len);
+       rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length);
+       rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, txdesc->length);
        rt2x00_desc_write(txd, 2, word);
 
        rt2x00_desc_read(txd, 3, &word);
index d084d70e5fe2617423a098175878f147adfb0ce0..d9b630455e7d6a6bd776643841a9118ac521a41a 100644 (file)
@@ -1208,7 +1208,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
                           test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
-       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
        rt2x00_desc_write(txd, 0, word);
 }
index c1eec17fe186d1c2451c5fab73a66cb83e705388..c6e6e7b0ea53351d47df635a5407c54af70aeea7 100644 (file)
@@ -1071,7 +1071,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);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
        rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher);
        rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
        rt2x00_desc_write(txd, 0, word);
index 89281d78f04db00f650c75396c63cb81f91ba511..f08b6a37bf2d143556ab1a7ec2467100bb736049 100644 (file)
@@ -663,7 +663,7 @@ static int rt2800pci_write_tx_data(struct queue_entry* entry,
                           test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
                           txdesc->key_idx : 0xff);
        rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
-                          skb->len - txdesc->l2pad);
+                          txdesc->length);
        rt2x00_set_field32(&word, TXWI_W1_PACKETID,
                           skbdesc->entry->queue->qid + 1);
        rt2x00_desc_write(txwi, 1, word);
index 2b79d6e58f400cf0e62a510039ec0d8a4ec8d875..67f8234f24d0612b560e30b03d68caaf745a77e8 100644 (file)
@@ -437,7 +437,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
                           txdesc->key_idx : 0xff);
        rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
-                          skb->len - txdesc->l2pad);
+                          txdesc->length);
        rt2x00_set_field32(&word, TXWI_W1_PACKETID,
                           skbdesc->entry->queue->qid + 1);
        rt2x00_desc_write(txwi, 1, word);
index a68cf90f6c4ebaa04344478a9af13a3d85f1846d..59d9459acfaf59d8f7e6c53f8b8cc8b1e4096fa7 100644 (file)
@@ -333,12 +333,10 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
        txdesc->aifs = entry->queue->aifs;
 
        /*
-        * Header and alignment information.
+        * Header and frame information.
         */
+       txdesc->length = entry->skb->len;
        txdesc->header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
-       if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags) &&
-           (entry->skb->len > txdesc->header_length))
-               txdesc->l2pad = L2PAD_SIZE(txdesc->header_length);
 
        /*
         * Check whether this frame is to be acked.
index f519aba4ff0ff58c86580295b0579637cc9d5f1c..94a48c174d6790e8000c5d4406efb3ffd9b0ea4e 100644 (file)
@@ -285,8 +285,8 @@ enum txentry_desc_flags {
  *
  * @flags: Descriptor flags (See &enum queue_entry_flags).
  * @queue: Queue identification (See &enum data_queue_qid).
+ * @length: Length of the entire frame.
  * @header_length: Length of 802.11 header.
- * @l2pad: Amount of padding to align 802.11 payload to 4-byte boundrary.
  * @length_high: PLCP length high word.
  * @length_low: PLCP length low word.
  * @signal: PLCP signal.
@@ -311,8 +311,8 @@ struct txentry_desc {
 
        enum data_queue_qid queue;
 
+       u16 length;
        u16 header_length;
-       u16 l2pad;
 
        u16 length_high;
        u16 length_low;
index ac69dbe5719b2953b48b2730d772c3a94a74e136..8099ecaf8694468eab67dcd497c202b99faa92d8 100644 (file)
@@ -1808,7 +1808,8 @@ 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, skb->len);
+               rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
+                                  txdesc->length);
                rt2x00_desc_write(txd, 11, word);
        }
 
@@ -1831,7 +1832,7 @@ static void rt61pci_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);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
        rt2x00_set_field32(&word, TXD_W0_BURST,
                           test_bit(ENTRY_TXD_BURST, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);
index 7ebe14b64fe8a50fd905622119ed36492e1e252a..1399c18bc667560f3a72e3496d410f84b70709f4 100644 (file)
@@ -1494,7 +1494,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);
+       rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
        rt2x00_set_field32(&word, TXD_W0_BURST2,
                           test_bit(ENTRY_TXD_BURST, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);