From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 02:16:23 2012 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 63BDF1065705; Sun, 19 Aug 2012 02:16:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E88C8FC12; Sun, 19 Aug 2012 02:16:23 +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 q7J2GNVq012943; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2GNq8012941; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190216.q7J2GNq8012941@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:16:23 +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: r239380 - head/sys/dev/ath 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: Sun, 19 Aug 2012 02:16:23 -0000 Author: adrian Date: Sun Aug 19 02:16:22 2012 New Revision: 239380 URL: http://svn.freebsd.org/changeset/base/239380 Log: When assembling the descriptor list, make sure that the "first" descriptor is marked correctly. The existing logic assumed that the first descriptor is i == 0, which doesn't hold for EDMA TX. In this instance, the first time filltxdesc() is called can be up to i == 3. So for a two-buffer descriptor: * firstSeg is set to 0; * lastSeg is set to 1; * the ath_hal_filltxdesc() code will treat it as the last segment in a descriptor chain and blank some of the descriptor fields, causing the TX to stop. When firstSeg is set to 1 (regardless of lastSeg), it overrides the lastSeg setting. Thus, ath_hal_filltxdesc() won't blank out these fields. Tested: AR9380, STA mode. With this, association is successful. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Aug 18 23:28:34 2012 (r239379) +++ head/sys/dev/ath/if_ath_tx.c Sun Aug 19 02:16:22 2012 (r239380) @@ -306,6 +306,7 @@ ath_tx_chaindesclist(struct ath_softc *s HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; + int isFirstDesc = 1; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -369,10 +370,11 @@ ath_tx_chaindesclist(struct ath_softc *s , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ - , i == 0 /* first segment */ + , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , ds0 /* first descriptor */ ); + isFirstDesc = 0; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %d: %08x %08x %08x %08x %08x %08x\n", __func__, i, ds->ds_link, ds->ds_data,