From owner-svn-src-all@FreeBSD.ORG Tue Nov 24 16:57:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455D7106568D; Tue, 24 Nov 2009 16:57:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEFC8FC1E; Tue, 24 Nov 2009 16:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAOGvZoZ024361; Tue, 24 Nov 2009 16:57:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAOGvZLG024358; Tue, 24 Nov 2009 16:57:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911241657.nAOGvZLG024358@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Nov 2009 16:57:35 +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: r199757 - head/sys/dev/an X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 16:57:36 -0000 Author: jhb Date: Tue Nov 24 16:57:35 2009 New Revision: 199757 URL: http://svn.freebsd.org/changeset/base/199757 Log: - For 350 chips, don't set various INTR bits in TX control word; turning INTR bits on seems to confuse hardware TX engine. - For 350 chips, set TX desc's buffer physical address before turning on the TX desc valid bit. Submitted by: Jeremy O'Brien obrien654j | gmail, sephe Obtained from: DragonFly BSD Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Nov 24 16:54:54 2009 (r199756) +++ head/sys/dev/an/if_an.c Tue Nov 24 16:57:35 2009 (r199757) @@ -2800,7 +2800,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ an_write_data(sc, id, 0x08, (caddr_t)&txcontrol, sizeof(txcontrol)); @@ -2863,7 +2863,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len, (caddr_t)&sc->an_txbuf); - txcontrol = AN_TXCTL_8023; + txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350); /* write the txcontrol only */ bcopy((caddr_t)&txcontrol, &buf[0x08], sizeof(txcontrol)); @@ -2885,7 +2885,7 @@ an_start_locked(struct ifnet *ifp) tx_frame_802_3.an_tx_802_3_payload_len; an_tx_desc.an_phys = sc->an_tx_buffer[idx].an_dma_paddr; - for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) { + for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) { CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET /* zero for now */ + (0 * sizeof(an_tx_desc)) Modified: head/sys/dev/an/if_anreg.h ============================================================================== --- head/sys/dev/an/if_anreg.h Tue Nov 24 16:54:54 2009 (r199756) +++ head/sys/dev/an/if_anreg.h Tue Nov 24 16:57:35 2009 (r199757) @@ -386,13 +386,18 @@ struct an_txframe_802_3 { #define AN_PAYLOADTYPE_ETHER 0x0000 #define AN_PAYLOADTYPE_LLC 0x0010 -#define AN_TXCTL_80211 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211| \ - AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE) - -#define AN_TXCTL_8023 \ - (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \ - AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE) +#define AN_TXCTL_80211 (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC) + +#define AN_TXCTL_8023 (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER) + +/* + * Additions to transmit control bits for MPI350 + */ +#define AN_TXCTL_HW(x) \ + ( x ? (AN_TXCTL_NORELEASE) \ + : \ + (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \ + ) #define AN_TXGAP_80211 0 #define AN_TXGAP_8023 0