Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Sep 2011 03:03:23 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225819 - in head/sys/dev/ath/ath_hal: ar5212 ar5416
Message-ID:  <201109280303.p8S33NHS052385@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109280303.p8S33NHS052385>