Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2011 22:26:57 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221558 - head/sys/dev/xl
Message-ID:  <201105062226.p46MQvJT069082@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105062226.p46MQvJT069082>