svn commit: r219771 - in head/sys/dev/ath/ath_hal: ar5212 ar5416

Adrian Chadd adrian at FreeBSD.org
Sat Mar 19 03:15:28 UTC 2011


Author: adrian
Date: Sat Mar 19 03:15:28 2011
New Revision: 219771
URL: http://svn.freebsd.org/changeset/base/219771

Log:
  Make sure that the AR_MISC_MODE value from the initvals are properly respected.
  
  This commit really is "fix the OFDM duration calculation to match reality when
  running in 802.11g mode."
  
  The AR5212 init vals set AR_MISC_MODE to 0x0 and all the bits that can be set are
  set through code.
  
  The AR5416 and later initvals set AR_MISC_MODE to various other values (with
  the AR5212 AR_MISC_MODE options cleared), which include AR_PCU_CCK_SIFS_MODE .
  This adds 6uS to SIFS on non-CCK frames when transmitting.
  
  This fixes the issue where _DATA_ 802.11g OFDM frames were being TX'ed with
  the ACK duration set to 38uS, not 44uS as on the AR5212 (and other devices.)
  
  The AR5212 TX pathway obeys the software-programmed duration field in the packet,
  but the 11n TX pathway overrides that with a hardware-calculated duration. This
  was getting it wrong because of the above AR_MISC_MODE setting. I've verified
  that 11g data OFDM frames are now being TXed with the correct ACK+SIFS duration
  programmed in.

Modified:
  head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -934,7 +934,7 @@ ar5212SetCapability(struct ath_hal *ah, 
 		else
 			ahp->ah_miscMode |= AR_MISC_MODE_MIC_NEW_LOC_ENABLE;
 		/* NB: write here so keys can be setup w/o a reset */
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 		return AH_TRUE;
 	case HAL_CAP_DIVERSITY:
 		if (ahp->ah_phyPowerOn) {

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -199,7 +199,7 @@ ar5212SetRxFilter(struct ath_hal *ah, ui
 			ahp->ah_miscMode |= AR_MISC_MODE_BSSID_MATCH_FORCE;
 		else
 			ahp->ah_miscMode &= ~AR_MISC_MODE_BSSID_MATCH_FORCE;
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 	}
 }
 

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -372,7 +372,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s
 	 * placed into hardware.
 	 */
 	if (ahp->ah_miscMode != 0)
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 
 	rfStatus = ar2133RfAttach(ah, &ecode);
 	if (!rfStatus) {

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 03:09:21 2011	(r219770)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Mar 19 03:15:28 2011	(r219771)
@@ -581,7 +581,7 @@ ar5416InitUserSettings(struct ath_hal *a
 
 	/* Restore user-specified settings */
 	if (ahp->ah_miscMode != 0)
-		OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode);
+		OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
 	if (ahp->ah_sifstime != (u_int) -1)
 		ar5212SetSifsTime(ah, ahp->ah_sifstime);
 	if (ahp->ah_slottime != (u_int) -1)


More information about the svn-src-head mailing list