diff options
author | yongari <yongari@FreeBSD.org> | 2011-05-06 22:26:57 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-05-06 22:26:57 +0000 |
commit | d5f31a325b1e05306848b941346f144f410e2097 (patch) | |
tree | 55c3612a95d566ad81467059554ceef15b47499a /sys/dev/xl | |
parent | ee61ee413910a3167588a134d6f531b98bedd733 (diff) | |
download | FreeBSD-src-d5f31a325b1e05306848b941346f144f410e2097.zip FreeBSD-src-d5f31a325b1e05306848b941346f144f410e2097.tar.gz |
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.
Diffstat (limited to 'sys/dev/xl')
-rw-r--r-- | sys/dev/xl/if_xl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index 004b511..35f0a63 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -2507,6 +2507,7 @@ xl_encap(struct xl_softc *sc, struct xl_chain *c, struct mbuf **m_head) *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_chain *c, struct mbuf **m_head) 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_chain *c, struct mbuf **m_head) 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); } |