rt2x00: Fix beaconing on rt2800.
authorGertjan van Wingerde <gwingerde@gmail.com>
Sat, 8 May 2010 21:40:26 +0000 (23:40 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 10 May 2010 18:56:49 +0000 (14:56 -0400)
According to the Ralink vendor driver for rt2800 we don't need a full
TXD for a beacon but just a TXWI in front of the actual beacon.
Fix the rt2800pci and rt2800usb beaconing code accordingly.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800pci.c
drivers/net/wireless/rt2x00/rt2800usb.c

index 80c67681cf9fd6b30852a7f9b4442ebceaa9bc0d..7d4778d66e77b2040104617fddc7fc8d9da28993 100644 (file)
@@ -682,7 +682,6 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
                                   struct txentry_desc *txdesc)
 {
        struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
-       struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
        unsigned int beacon_base;
        u32 reg;
 
@@ -695,15 +694,17 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
        rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 
        /*
-        * Write entire beacon with descriptor to register.
+        * Add the TXWI for the beacon to the skb.
+        */
+       rt2800_write_txwi(entry->skb, txdesc);
+       skb_push(entry->skb, TXWI_DESC_SIZE);
+
+       /*
+        * Write entire beacon with TXWI to register.
         */
        beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
-       rt2800_register_multiwrite(rt2x00dev,
-                                     beacon_base,
-                                     skbdesc->desc, skbdesc->desc_len);
-       rt2800_register_multiwrite(rt2x00dev,
-                                     beacon_base + skbdesc->desc_len,
-                                     entry->skb->data, entry->skb->len);
+       rt2800_register_multiwrite(rt2x00dev, beacon_base,
+                                  entry->skb->data, entry->skb->len);
 
        /*
         * Enable beaconing again.
index d992a9352ed7decb32e91a029c09a893a7f0f88d..00e7906dc208fc50c639741bad264761bf6fb786 100644 (file)
@@ -431,17 +431,9 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
                                   struct txentry_desc *txdesc)
 {
        struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
-       struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
        unsigned int beacon_base;
        u32 reg;
 
-       /*
-        * Add the descriptor in front of the skb.
-        */
-       skb_push(entry->skb, entry->queue->desc_size);
-       memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len);
-       skbdesc->desc = entry->skb->data;
-
        /*
         * Disable beaconing while we are reloading the beacon data,
         * otherwise we might be sending out invalid data.
@@ -450,6 +442,12 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
        rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 0);
        rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 
+       /*
+        * Add the TXWI for the beacon to the skb.
+        */
+       rt2800_write_txwi(entry->skb, txdesc);
+       skb_push(entry->skb, TXWI_DESC_SIZE);
+
        /*
         * Write entire beacon with descriptor to register.
         */