svn commit: r221558 - head/sys/dev/xl

Pyun YongHyeon yongari at FreeBSD.org
Fri May 6 22:26:57 UTC 2011


Author: yongari
Date: Fri May  6 22:26:57 2011
New Revision: 221558
URL: http://svn.freebsd.org/changeset/base/221558

Log:
  Set status word once instead of twice. For 3C90xB/3C90xC, frame
  length of status word is ignored. While here move bus_dmamap_sync()
  up where DMA map is loaded.

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==============================================================================
--- head/sys/dev/xl/if_xl.c	Fri May  6 22:16:43 2011	(r221557)
+++ head/sys/dev/xl/if_xl.c	Fri May  6 22:26:57 2011	(r221558)
@@ -2507,6 +2507,7 @@ xl_encap(struct xl_softc *sc, struct xl_
 		*m_head = NULL;
 		return (EIO);
 	}
+	bus_dmamap_sync(sc->xl_mtag, c->xl_map, BUS_DMASYNC_PREWRITE);
 
 	total_len = 0;
 	for (i = 0; i < nseg; i++) {
@@ -2519,8 +2520,6 @@ xl_encap(struct xl_softc *sc, struct xl_
 		total_len += sc->xl_cdata.xl_tx_segs[i].ds_len;
 	}
 	c->xl_ptr->xl_frag[nseg - 1].xl_len |= htole32(XL_LAST_FRAG);
-	c->xl_ptr->xl_status = htole32(total_len);
-	c->xl_ptr->xl_next = 0;
 
 	if (sc->xl_type == XL_TYPE_905B) {
 		status = XL_TXSTAT_RND_DEFEAT;
@@ -2535,11 +2534,12 @@ xl_encap(struct xl_softc *sc, struct xl_
 				status |= XL_TXSTAT_UDPCKSUM;
 		}
 #endif
-		c->xl_ptr->xl_status = htole32(status);
-	}
+	} else
+		status = total_len;
+	c->xl_ptr->xl_status = htole32(status);
+	c->xl_ptr->xl_next = 0;
 
 	c->xl_mbuf = *m_head;
-	bus_dmamap_sync(sc->xl_mtag, c->xl_map, BUS_DMASYNC_PREWRITE);
 	return (0);
 }
 


More information about the svn-src-head mailing list