From owner-svn-src-all@FreeBSD.ORG Wed Jun 27 05:23:34 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 24553106564A; Wed, 27 Jun 2012 05:23:34 +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 EA0F68FC08; Wed, 27 Jun 2012 05:23:33 +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 q5R5NX0d083705; Wed, 27 Jun 2012 05:23:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5R5NXMO083703; Wed, 27 Jun 2012 05:23:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206270523.q5R5NXMO083703@svn.freebsd.org> From: Adrian Chadd Date: Wed, 27 Jun 2012 05:23:33 +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: r237626 - head/sys/dev/ath/ath_hal/ar5416 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: Wed, 27 Jun 2012 05:23:34 -0000 Author: adrian Date: Wed Jun 27 05:23:33 2012 New Revision: 237626 URL: http://svn.freebsd.org/changeset/base/237626 Log: Fix a subtle corner case surrounding the handling of OFDM restart along with AMPDU aggregate delimiters. If there's an OFDM restart during an aggregate, the hardware ACKs the previous frame, but communicates the RXed frame to the hardware as having had CRC delimiter error + OFDM_RESTART phy error. The frame however didn't have a CRC error and since the hardware ACKed the aggregate to the sender, it thinks the frame was received. Since I have no idea how often this occurs in the real world, add a debug statement so trigger whenever this occurs. I'd appreciate an email if someone finds this particular situation is triggered. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed Jun 27 04:39:30 2012 (r237625) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed Jun 27 05:23:33 2012 (r237626) @@ -240,11 +240,25 @@ ar5416ProcRxDesc(struct ath_hal *ah, str if (ads->ds_rxstatus8 & AR_PHYErr) { u_int phyerr; - rs->rs_status |= HAL_RXERR_PHY; + /* + * Packets with OFDM_RESTART on post delimiter are CRC OK and + * usable and MAC ACKs them. + * To avoid packet from being lost, we remove the PHY Err flag + * so that driver layer does not drop them. + */ phyerr = MS(ads->ds_rxstatus8, AR_PHYErrCode); - rs->rs_phyerr = phyerr; - } + if ((phyerr == HAL_PHYERR_OFDM_RESTART) && + (ads->ds_rxstatus8 & AR_PostDelimCRCErr)) { + ath_hal_printf(ah, + "%s: OFDM_RESTART on post-delim CRC error\n", + __func__); + rs->rs_phyerr = 0; + } else { + rs->rs_status |= HAL_RXERR_PHY; + rs->rs_phyerr = phyerr; + } + } if (ads->ds_rxstatus8 & AR_CRCErr) rs->rs_status |= HAL_RXERR_CRC; else if (ads->ds_rxstatus8 & AR_DecryptCRCErr)