Don't turn on TX_BUSY (rt2560/rt2661) or TX_CIPHER_BUSY (rt2560) before TX
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 18 Nov 2006 09:26:43 +0000 (09:26 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 18 Nov 2006 09:26:43 +0000 (09:26 +0000)
descriptor is fully setup.

sys/dev/netif/ral/rt2560.c
sys/dev/netif/ral/rt2661.c

index 56e38f5..7b1c902 100644 (file)
@@ -15,7 +15,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $FreeBSD: src/sys/dev/ral/rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $
- * $DragonFly: src/sys/dev/netif/ral/rt2560.c,v 1.5 2006/11/16 13:16:46 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/ral/rt2560.c,v 1.6 2006/11/18 09:26:43 sephe Exp $
  */
 
 /*
@@ -1012,7 +1012,8 @@ rt2560_encryption_intr(struct rt2560_softc *sc)
                        desc->eiv = bswap32(desc->eiv);
 
                /* mark the frame ready for transmission */
-               desc->flags |= htole32(RT2560_TX_BUSY | RT2560_TX_VALID);
+               desc->flags |= htole32(RT2560_TX_VALID);
+               desc->flags |= htole32(RT2560_TX_BUSY);
 
                DPRINTFN(15, ("encryption done idx=%u\n",
                    sc->txq.next_encrypt));
@@ -1591,8 +1592,8 @@ rt2560_setup_tx_desc(struct rt2560_softc *sc, struct rt2560_tx_desc *desc,
 
        desc->flags = htole32(flags);
        desc->flags |= htole32(len << 16);
-       desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY) :
-           htole32(RT2560_TX_BUSY | RT2560_TX_VALID);
+       if (!encrypt)
+               desc->flags |= htole32(RT2560_TX_VALID);
 
        desc->physaddr = htole32(physaddr);
        desc->wme = htole16(
@@ -1624,6 +1625,9 @@ rt2560_setup_tx_desc(struct rt2560_softc *sc, struct rt2560_tx_desc *desc,
                if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
                        desc->plcp_signal |= 0x08;
        }
+
+       desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY)
+                              : htole32(RT2560_TX_BUSY);
 }
 
 static int
index a50765e..f03d253 100644 (file)
@@ -15,7 +15,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $FreeBSD: src/sys/dev/ral/rt2661.c,v 1.4 2006/03/21 21:15:43 damien Exp $
- * $DragonFly: src/sys/dev/netif/ral/rt2661.c,v 1.5 2006/11/18 04:13:39 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/ral/rt2661.c,v 1.6 2006/11/18 09:26:43 sephe Exp $
  */
 
 /*
@@ -1478,7 +1478,7 @@ rt2661_setup_tx_desc(struct rt2661_softc *sc, struct rt2661_tx_desc *desc,
 
        desc->flags = htole32(flags);
        desc->flags |= htole32(len << 16);
-       desc->flags |= htole32(RT2661_TX_BUSY | RT2661_TX_VALID);
+       desc->flags |= htole32(RT2661_TX_VALID);
 
        desc->xflags = htole16(xflags);
        desc->xflags |= htole16(nsegs << 13);
@@ -1526,6 +1526,8 @@ rt2661_setup_tx_desc(struct rt2661_softc *sc, struct rt2661_tx_desc *desc,
                desc->addr[i] = htole32(segs[i].ds_addr);
                desc->len [i] = htole16(segs[i].ds_len);
        }
+
+       desc->flags |= htole32(RT2661_TX_BUSY);
 }
 
 static int