rt2x00: Generate sw sequence numbers only for devices that need it
authorHelmut Schaa <helmut.schaa@googlemail.com>
Thu, 3 Mar 2011 18:42:01 +0000 (19:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Mar 2011 19:06:47 +0000 (14:06 -0500)
Newer devices like rt2800* own a hardware sequence counter and thus
don't need to use a software sequence counter at all. Add a new driver
flag to shortcut the software sequence number generation on devices that
don't need it.

rt61pci, rt73usb and rt2800* seem to make use of a hw sequence counter
while rt2400pci and rt2500* need to do it in software.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
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/rt2x00queue.c

index 2725f3c4442eca8af535ff49123a3bb96eab7a71..d38acf4b65e12ecbec9009baae3a5bb47b2a35ab 100644 (file)
@@ -1641,6 +1641,7 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
         */
        __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
        __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
+       __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index 3ef1fb4185c0945a2da2b70656fe723ddf501a94..b00e4d483c58891de751b7796ed7d657ef1cdc77 100644 (file)
@@ -1959,6 +1959,7 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev)
         */
        __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
        __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
+       __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index 01f385d5846c6641eda7376e41ff911ebf69f691..b71df29436e75d24fc0a4e521ff523b0716f035e 100644 (file)
@@ -1795,6 +1795,7 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
                __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags);
        }
        __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags);
+       __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index 2f5d8de5ef14de59e98f91e7c58c81a58874a96a..9067c917c659ca5b34eb5dcf86fe3ca0cc93432c 100644 (file)
@@ -662,6 +662,7 @@ enum rt2x00_flags {
        DRIVER_REQUIRE_L2PAD,
        DRIVER_REQUIRE_TXSTATUS_FIFO,
        DRIVER_REQUIRE_TASKLET_CONTEXT,
+       DRIVER_REQUIRE_SW_SEQNO,
 
        /*
         * Driver features
index b32ca31de7e8f8755538765b70d8e73d5cb977c4..eebb564ee4da4fefe2e083858aedcebf7ae5bf73 100644 (file)
@@ -224,10 +224,14 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
        if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
                return;
 
+       __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
+
+       if (!test_bit(DRIVER_REQUIRE_SW_SEQNO, &entry->queue->rt2x00dev->flags))
+               return;
+
        /*
-        * Hardware should insert sequence counter.
-        * FIXME: We insert a software sequence counter first for
-        * hardware that doesn't support hardware sequence counting.
+        * The hardware is not able to insert a sequence number. Assign a
+        * software generated one here.
         *
         * This is wrong because beacons are not getting sequence
         * numbers assigned properly.
@@ -245,7 +249,6 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
 
        spin_unlock_irqrestore(&intf->seqlock, irqflags);
 
-       __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
 }
 
 static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,