From owner-svn-src-head@FreeBSD.ORG Wed Sep 28 03:03:23 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 AC4F11065673; Wed, 28 Sep 2011 03:03: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 81DB08FC19; Wed, 28 Sep 2011 03:03: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 p8S33NZr052388; Wed, 28 Sep 2011 03:03:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S33NHS052385; Wed, 28 Sep 2011 03:03:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109280303.p8S33NHS052385@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Sep 2011 03:03: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: r225819 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 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: Wed, 28 Sep 2011 03:03:23 -0000 Author: adrian Date: Wed Sep 28 03:03:23 2011 New Revision: 225819 URL: http://svn.freebsd.org/changeset/base/225819 Log: The AR5212 setup path (also used by the AR5416 code) configures a local variable with a beacon interval of 100 TU. This never gets modified if the beacon interval configuration changes. This may have been correct in earlier times, but with the advent of staggered beacons (which default to 1 / ATH_BCBUF beacon interval, so 25 TU here) this value is incorrect. It is used to configure the default CABQ readytime. So here, the cabq was being configured to be much greater than the target beacon timer (TBTT.) The driver should be configuring a cabq readytime value rather then leaving it to the HAL to choose sensible defaults. This should be done in the future - I'm simply trying to ensure sensible defaults are chosen. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Wed Sep 28 02:54:42 2011 (r225818) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Wed Sep 28 03:03:23 2011 (r225819) @@ -44,6 +44,7 @@ ar5212GetNextTBTT(struct ath_hal *ah) void ar5212SetBeaconTimers(struct ath_hal *ah, const HAL_BEACON_TIMERS *bt) { + struct ath_hal_5212 *ahp = AH5212(ah); OS_REG_WRITE(ah, AR_TIMER0, bt->bt_nexttbtt); OS_REG_WRITE(ah, AR_TIMER1, bt->bt_nextdba); @@ -65,6 +66,7 @@ ar5212SetBeaconTimers(struct ath_hal *ah OS_REG_WRITE(ah, AR_BEACON, AR_BEACON_RESET_TSF); } OS_REG_WRITE(ah, AR_BEACON, bt->bt_intval); + ahp->ah_beaconInterval = (bt->bt_intval & HAL_BEACON_PERIOD); } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Wed Sep 28 02:54:42 2011 (r225818) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Wed Sep 28 03:03:23 2011 (r225819) @@ -46,6 +46,7 @@ void ar5416SetBeaconTimers(struct ath_hal *ah, const HAL_BEACON_TIMERS *bt) { uint32_t bperiod; + struct ath_hal_5212 *ahp = AH5212(ah); OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bt->bt_nexttbtt)); OS_REG_WRITE(ah, AR_NEXT_DBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba)); @@ -53,6 +54,7 @@ ar5416SetBeaconTimers(struct ath_hal *ah OS_REG_WRITE(ah, AR_NEXT_NDP, TU_TO_USEC(bt->bt_nextatim)); bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD); + ahp->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD; OS_REG_WRITE(ah, AR5416_BEACON_PERIOD, bperiod); OS_REG_WRITE(ah, AR_DBA_PERIOD, bperiod); OS_REG_WRITE(ah, AR_SWBA_PERIOD, bperiod);