svn commit: r227100 - in user/adrian/if_ath_tx/sys/dev/ath: . ath_hal ath_hal/ar5416

Adrian Chadd adrian at FreeBSD.org
Sat Nov 5 01:42:55 UTC 2011


Author: adrian
Date: Sat Nov  5 01:42:54 2011
New Revision: 227100
URL: http://svn.freebsd.org/changeset/base/227100

Log:
  Begin adding support to force a full chip reset when the reset HAL
  method is called, rather than a warm reset.
  
  Merlin (at least) seems to get very annoyed after a while when interference
  is present. It's possible that part of why the AR9220/AR9280 is getting angry
  is due to (more) incorrect software programming of things, but once things
  _get_ too angry, it stays that way through a warm reset.
  
  Some further testing and resaerch is needed to figure out what's going on.
  It's likely that the "correct" thing to do with this WAR is to extend the
  reset HAL method to take a "warm or full" flag and then set a "full"
  reset during a stuck beacon situation or when interference is detected.

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_reset.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	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h	Sat Nov  5 01:42:54 2011	(r227100)
@@ -780,7 +780,9 @@ 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;
+	int ah_cca;			/* override minCCApwr; for debugging only! */
+	int ah_force_full_reset;	/* force full chip reset rather then warm reset */
+
 } HAL_OPS_CONFIG;
 
 /*

Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Sat Nov  5 01:42:54 2011	(r227100)
@@ -146,7 +146,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 
 	/* For chips on which the RTC reset is done, save TSF before it gets cleared */
 	if (AR_SREV_HOWL(ah) ||
-	    (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)))
+	    (AR_SREV_MERLIN(ah) &&
+	     ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) ||
+	    (ah->ah_config.ah_force_full_reset))
 		tsf = ar5416GetTsf64(ah);
 
 	/* Mark PHY as inactive; marked active in ar5416InitBB() */
@@ -735,12 +737,15 @@ ar5416ChipReset(struct ath_hal *ah, cons
 {
 	OS_MARK(ah, AH_MARK_CHIPRESET, chan ? chan->ic_freq : 0);
 	/*
-	 * Warm reset is optimistic.
+	 * Warm reset is optimistic for open-loop TX power control.
 	 */
 	if (AR_SREV_MERLIN(ah) &&
 	    ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) {
 		if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
 			return AH_FALSE;
+	} else if (ah->ah_config.ah_force_full_reset) {
+		if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
+			return AH_FALSE;
 	} else {
 		if (!ar5416SetResetReg(ah, HAL_RESET_WARM))
 			return AH_FALSE;

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	Fri Nov  4 23:34:54 2011	(r227099)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c	Sat Nov  5 01:42:54 2011	(r227100)
@@ -898,4 +898,9 @@ ath_sysctl_hal_attach(struct ath_softc *
 	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "cca", CTLFLAG_RW,
 	    &sc->sc_ah->ah_config.ah_cca, 0, "CCA override");
 
+	sc->sc_ah->ah_config.ah_force_full_reset = 0;
+	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "force_full_reset", CTLFLAG_RW,
+	    &sc->sc_ah->ah_config.ah_force_full_reset, 0,
+	    "Force full chip reset rather than a warm reset");
+
 }


More information about the svn-src-user mailing list