rt2x00: Extend PLCP descriptor definition for rt2400pci
authorIvo van Doorn <ivdoorn@gmail.com>
Tue, 27 Nov 2007 20:47:56 +0000 (21:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:05:05 +0000 (15:05 -0800)
Extend word field definitions for the PLCP words
in the TX descriptor to contain the BBP fields as well.
This will remove rt2400pci_write_tx_desc() from the
checkstack script.

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/rt2400pci.h

index 6d3cdaf5903e0aead087a47919b71b298e90f9e8..c9a234fc3cd1f0c4017f0126def7f8f2f2963544 100644 (file)
@@ -1019,30 +1019,6 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                                    struct ieee80211_tx_control *control)
 {
        u32 word;
-       u32 signal = 0;
-       u32 service = 0;
-       u32 length_high = 0;
-       u32 length_low = 0;
-
-       /*
-        * The PLCP values should be treated as if they
-        * were BBP values.
-        */
-       rt2x00_set_field32(&signal, BBPCSR_VALUE, desc->signal);
-       rt2x00_set_field32(&signal, BBPCSR_REGNUM, 5);
-       rt2x00_set_field32(&signal, BBPCSR_BUSY, 1);
-
-       rt2x00_set_field32(&service, BBPCSR_VALUE, desc->service);
-       rt2x00_set_field32(&service, BBPCSR_REGNUM, 6);
-       rt2x00_set_field32(&service, BBPCSR_BUSY, 1);
-
-       rt2x00_set_field32(&length_high, BBPCSR_VALUE, desc->length_high);
-       rt2x00_set_field32(&length_high, BBPCSR_REGNUM, 7);
-       rt2x00_set_field32(&length_high, BBPCSR_BUSY, 1);
-
-       rt2x00_set_field32(&length_low, BBPCSR_VALUE, desc->length_low);
-       rt2x00_set_field32(&length_low, BBPCSR_REGNUM, 8);
-       rt2x00_set_field32(&length_low, BBPCSR_BUSY, 1);
 
        /*
         * Start writing the descriptor words.
@@ -1052,13 +1028,21 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_desc_write(txd, 2, word);
 
        rt2x00_desc_read(txd, 3, &word);
-       rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, signal);
-       rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE, service);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL, desc->signal);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_REGNUM, 5);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SIGNAL_BUSY, 1);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE, desc->service);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE_REGNUM, 6);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_SERVICE_BUSY, 1);
        rt2x00_desc_write(txd, 3, word);
 
        rt2x00_desc_read(txd, 4, &word);
-       rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_LOW, length_low);
-       rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_HIGH, length_high);
+       rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_LOW, desc->length_low);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW_REGNUM, 8);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_LOW_BUSY, 1);
+       rt2x00_set_field32(&word, TXD_W4_PLCP_LENGTH_HIGH, desc->length_high);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_HIGH_REGNUM, 7);
+       rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_HIGH_BUSY, 1);
        rt2x00_desc_write(txd, 4, word);
 
        rt2x00_desc_read(txd, 0, &word);
index f5dbde7b2015e72fcf461d5b29f74a87f63f6c2c..369aac6d033628c5e4ee39894b82e72f438dd469 100644 (file)
 
 /*
  * Word3 & 4: PLCP information
- */
-#define TXD_W3_PLCP_SIGNAL             FIELD32(0x0000ffff)
-#define TXD_W3_PLCP_SERVICE            FIELD32(0xffff0000)
-#define TXD_W4_PLCP_LENGTH_LOW         FIELD32(0x0000ffff)
-#define TXD_W4_PLCP_LENGTH_HIGH                FIELD32(0xffff0000)
+ * The PLCP values should be treated as if they were BBP values.
+ */
+#define TXD_W3_PLCP_SIGNAL             FIELD32(0x000000ff)
+#define TXD_W3_PLCP_SIGNAL_REGNUM      FIELD32(0x00007f00)
+#define TXD_W3_PLCP_SIGNAL_BUSY                FIELD32(0x00008000)
+#define TXD_W3_PLCP_SERVICE            FIELD32(0x00ff0000)
+#define TXD_W3_PLCP_SERVICE_REGNUM     FIELD32(0x7f000000)
+#define TXD_W3_PLCP_SERVICE_BUSY       FIELD32(0x80000000)
+
+#define TXD_W4_PLCP_LENGTH_LOW         FIELD32(0x000000ff)
+#define TXD_W3_PLCP_LENGTH_LOW_REGNUM  FIELD32(0x00007f00)
+#define TXD_W3_PLCP_LENGTH_LOW_BUSY    FIELD32(0x00008000)
+#define TXD_W4_PLCP_LENGTH_HIGH                FIELD32(0x00ff0000)
+#define TXD_W3_PLCP_LENGTH_HIGH_REGNUM FIELD32(0x7f000000)
+#define TXD_W3_PLCP_LENGTH_HIGH_BUSY   FIELD32(0x80000000)
 
 /*
  * Word5