From owner-svn-src-head@FreeBSD.ORG Fri May 6 22:26:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B59B7106566C; Fri, 6 May 2011 22:26:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A48F78FC13; Fri, 6 May 2011 22:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46MQvKR069084; Fri, 6 May 2011 22:26:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46MQvJT069082; Fri, 6 May 2011 22:26:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105062226.p46MQvJT069082@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 6 May 2011 22:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221558 - head/sys/dev/xl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 22:26:57 -0000 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); }