From owner-svn-src-user@FreeBSD.ORG Thu Nov 3 02:38:32 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB6E106564A; Thu, 3 Nov 2011 02:38:32 +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 7662B8FC16; Thu, 3 Nov 2011 02:38:32 +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 pA32cW9Q049008; Thu, 3 Nov 2011 02:38:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA32cWCP049004; Thu, 3 Nov 2011 02:38:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111030238.pA32cWCP049004@svn.freebsd.org> From: Adrian Chadd Date: Thu, 3 Nov 2011 02:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227045 - in user/adrian/if_ath_tx/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 02:38:32 -0000 Author: adrian Date: Thu Nov 3 02:38:32 2011 New Revision: 227045 URL: http://svn.freebsd.org/changeset/base/227045 Log: Add in a (temporary!) hack to allow the CCA to be forced. I'm seeing some very bizarre merlin behaviour where it thinks the air is > 95% busy, and thus never thinks the air is ready for TX. Comparing the RX clear / RX frame counters to Sowl (AR9160) show that they're decoding the same number of frames, but Merlin seems to calibrate the NF much, much lower than Sowl - and then thinks it can't TX for most of it. When I force the CCA to be the same as what Sowl sees (ie, ~ -85dB) then suddenly it thinks it can TX. I'll chase up _why_ this happens with the Atheros baseband/radio team. Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Wed Nov 2 23:40:21 2011 (r227044) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Thu Nov 3 02:38:32 2011 (r227045) @@ -780,6 +780,7 @@ typedef struct int ah_dma_beacon_response_time;/* in TU's */ int ah_sw_beacon_response_time; /* in TU's */ int ah_additional_swba_backoff; /* in TU's */ + int ah_cca; } HAL_OPS_CONFIG; /* Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed Nov 2 23:40:21 2011 (r227044) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Nov 3 02:38:32 2011 (r227045) @@ -627,6 +627,10 @@ ar5416LoadNF(struct ath_hal *ah, const s else nf_val = default_nf; + /* Override */ + if (ah->ah_config.ah_cca != 0) + nf_val = ah->ah_config.ah_cca; + val = OS_REG_READ(ah, ar5416_cca_regs[i]); val &= 0xFFFFFE00; val |= (((uint32_t) nf_val << 1) & 0x1ff); Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c Wed Nov 2 23:40:21 2011 (r227044) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c Thu Nov 3 02:38:32 2011 (r227045) @@ -893,4 +893,9 @@ ath_sysctl_hal_attach(struct ath_softc * SYSCTL_ADD_INT(ctx, child, OID_AUTO, "swba_backoff", CTLFLAG_RW, &sc->sc_ah->ah_config.ah_additional_swba_backoff, 0, "Atheros HAL additional SWBA backoff time"); + + sc->sc_ah->ah_config.ah_cca = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "cca", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_cca, 0, "CCA override"); + }