svn commit: r188203 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54...

Sam Leffler sam at FreeBSD.org
Thu Feb 5 13:57:42 PST 2009


Author: sam
Date: Thu Feb  5 21:57:41 2009
New Revision: 188203
URL: http://svn.freebsd.org/changeset/base/188203

Log:
  merge r188191-r188195,r188197: minor fixes to ath

Modified:
  projects/vap7/sys/   (props changed)
  projects/vap7/sys/contrib/pf/   (props changed)
  projects/vap7/sys/dev/   (props changed)
  projects/vap7/sys/dev/ath/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5210/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5211/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5212/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212.h
  projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
  projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c
  projects/vap7/sys/dev/ath/ath_hal/ar5312/   (props changed)
  projects/vap7/sys/dev/ath/ath_hal/ar5416/   (props changed)
  projects/vap7/sys/dev/ath/if_ath.c
  projects/vap7/sys/dev/ath/if_athioctl.h
  projects/vap7/sys/dev/cxgb/   (props changed)
  projects/vap7/sys/dev/usb2/   (props changed)
  projects/vap7/sys/i386/conf/USB2   (props changed)
  projects/vap7/sys/modules/usb2/   (props changed)
  projects/vap7/sys/net80211/   (props changed)

Modified: projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212.h	Thu Feb  5 21:47:40 2009	(r188202)
+++ projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212.h	Thu Feb  5 21:57:41 2009	(r188203)
@@ -122,7 +122,6 @@ typedef struct {
 	uint32_t	targetGain;
 	uint32_t	loTrig;
 	uint32_t	hiTrig;
-	uint32_t	gainFCorrection;
 	uint32_t	active;
 	const GAIN_OPTIMIZATION_STEP *currStep;
 } GAIN_VALUES;

Modified: projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c	Thu Feb  5 21:47:40 2009	(r188202)
+++ projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c	Thu Feb  5 21:57:41 2009	(r188203)
@@ -990,11 +990,16 @@ ar5212PerCalibrationN(struct ath_hal *ah
 			if (powerMeasI && powerMeasQ)
 				break;
 			/* Do we really need this??? */
-			OS_REG_WRITE (ah,  AR_PHY_TIMING_CTRL4,
-				      OS_REG_READ(ah,  AR_PHY_TIMING_CTRL4) |
-				      AR_PHY_TIMING_CTRL4_DO_IQCAL);
+			OS_REG_SET_BIT(ah, AR_PHY_TIMING_CTRL4,
+			    AR_PHY_TIMING_CTRL4_DO_IQCAL);
 		} while (++i < IQ_CAL_TRIES);
 
+		HALDEBUG(ah, HAL_DEBUG_PERCAL,
+		    "%s: IQ cal finished: %d tries\n", __func__, i);
+		HALDEBUG(ah, HAL_DEBUG_PERCAL,
+		    "%s: powerMeasI %u powerMeasQ %u iqCorrMeas %d\n",
+		    __func__, powerMeasI, powerMeasQ, iqCorrMeas);
+
 		/*
 		 * Prescale these values to remove 64-bit operation
 		 * requirement at the loss of a little precision.
@@ -1021,19 +1026,7 @@ ar5212PerCalibrationN(struct ath_hal *ah
 			}
 
 			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "****************** MISGATED IQ CAL! *******************\n");
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "time       = %d, i = %d, \n", OS_GETUPTIME(ah), i);
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "powerMeasI = 0x%08x\n", powerMeasI);
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "powerMeasQ = 0x%08x\n", powerMeasQ);
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "iqCorrMeas = 0x%08x\n", iqCorrMeas);
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "iCoff      = %d\n", iCoff);
-			HALDEBUG(ah, HAL_DEBUG_PERCAL,
-			    "qCoff      = %d\n", qCoff);
+			    "%s: iCoff %d qCoff %d\n", __func__, iCoff, qCoff);
 
 			/* Write values and enable correction */
 			OS_REG_RMW_FIELD(ah, AR_PHY_TIMING_CTRL4,
@@ -1048,7 +1041,8 @@ ar5212PerCalibrationN(struct ath_hal *ah
 			ichan->iCoff = iCoff;
 			ichan->qCoff = qCoff;
 		}
-	} else if (!IEEE80211_IS_CHAN_B(chan) && ahp->ah_bIQCalibration == IQ_CAL_DONE &&
+	} else if (!IEEE80211_IS_CHAN_B(chan) &&
+	    ahp->ah_bIQCalibration == IQ_CAL_DONE &&
 	    (ichan->privFlags & CHANNEL_IQVALID) == 0) {
 		/*
 		 * Start IQ calibration if configured channel has changed.
@@ -1089,7 +1083,16 @@ ar5212PerCalibration(struct ath_hal *ah,
 HAL_BOOL
 ar5212ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *chan)
 {
-	/* XXX */
+	HAL_CHANNEL_INTERNAL *ichan;
+
+	ichan = ath_hal_checkchannel(ah, chan);
+	if (ichan == AH_NULL) {
+		HALDEBUG(ah, HAL_DEBUG_ANY,
+		    "%s: invalid channel %u/0x%x; no mapping\n",
+		    __func__, chan->ic_freq, chan->ic_flags);
+		return AH_FALSE;
+	}
+	ichan->privFlags &= ~CHANNEL_IQVALID;
 	return AH_TRUE;
 }
 

Modified: projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c	Thu Feb  5 21:47:40 2009	(r188202)
+++ projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c	Thu Feb  5 21:57:41 2009	(r188203)
@@ -239,34 +239,36 @@ ar5212AdjustGain(struct ath_hal *ah, GAI
 /*
  * Read rf register to determine if gainF needs correction
  */
-static void
+static uint32_t
 ar5212GetGainFCorrection(struct ath_hal *ah)
 {
 	struct ath_hal_5212 *ahp = AH5212(ah);
-	GAIN_VALUES *gv = &ahp->ah_gainValues;
+	uint32_t correction;
 
 	HALASSERT(IS_RADX112_REV2(ah));
 
-	gv->gainFCorrection = 0;
+	correction = 0;
 	if (ar5212GetRfField(ar5212GetRfBank(ah, 7), 1, 36, 0) == 1) {
+		const GAIN_VALUES *gv = &ahp->ah_gainValues;
 		uint32_t mixGain = gv->currStep->paramVal[0];
 		uint32_t gainStep =
 			ar5212GetRfField(ar5212GetRfBank(ah, 7), 4, 32, 0);
 		switch (mixGain) {
 		case 0 :
-			gv->gainFCorrection = 0;
+			correction = 0;
 			break;
 		case 1 :
-			gv->gainFCorrection = gainStep;
+			correction = gainStep;
 			break;
 		case 2 :
-			gv->gainFCorrection = 2 * gainStep - 5;
+			correction = 2 * gainStep - 5;
 			break;
 		case 3 :
-			gv->gainFCorrection = 2 * gainStep;
+			correction = 2 * gainStep;
 			break;
 		}
 	}
+	return correction;
 }
 
 /*
@@ -303,9 +305,9 @@ ar5212GetRfgain(struct ath_hal *ah)
 					gv->currGain += PHY_PROBE_CCK_CORRECTION;
 			}
 			if (IS_RADX112_REV2(ah)) {
-				ar5212GetGainFCorrection(ah);
-				if (gv->currGain >= gv->gainFCorrection)
-					gv->currGain -= gv->gainFCorrection;
+				uint32_t correct = ar5212GetGainFCorrection(ah);
+				if (gv->currGain >= correct)
+					gv->currGain -= correct;
 				else
 					gv->currGain = 0;
 			}

Modified: projects/vap7/sys/dev/ath/if_ath.c
==============================================================================
--- projects/vap7/sys/dev/ath/if_ath.c	Thu Feb  5 21:47:40 2009	(r188202)
+++ projects/vap7/sys/dev/ath/if_ath.c	Thu Feb  5 21:57:41 2009	(r188203)
@@ -4994,9 +4994,9 @@ ath_tx_start(struct ath_softc *sc, struc
 		sc->sc_stats.ast_tx_noack++;
 #ifdef ATH_SUPPORT_TDMA
 	if (sc->sc_tdma && (flags & HAL_TXDESC_NOACK) == 0) {
-		DPRINTF(sc, ATH_DEBUG_XMIT, "%s: ACK required w/ TDMA\n",
-		    __func__);
-		/* XXX statistic */
+		DPRINTF(sc, ATH_DEBUG_TDMA,
+		    "%s: discard frame, ACK required w/ TDMA\n", __func__);
+		sc->sc_stats.ast_tdma_ack++;
 		ath_freetx(m0);
 		return EIO;
 	}
@@ -7198,6 +7198,10 @@ ath_raw_xmit(struct ieee80211_node *ni, 
 	struct ath_buf *bf;
 
 	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) {
+		DPRINTF(sc, ATH_DEBUG_XMIT, "%s: discard frame, %s", __func__,
+		    (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ?
+			"!running" : "invalid");
+		sc->sc_stats.ast_tx_raw_fail++;
 		ieee80211_free_node(ni);
 		m_freem(m);
 		return ENETDOWN;
@@ -7207,6 +7211,7 @@ ath_raw_xmit(struct ieee80211_node *ni, 
 	 */
 	bf = ath_getbuf(sc);
 	if (bf == NULL) {
+		/* NB: ath_getbuf handles stat+msg */
 		ieee80211_free_node(ni);
 		m_freem(m);
 		return ENOBUFS;

Modified: projects/vap7/sys/dev/ath/if_athioctl.h
==============================================================================
--- projects/vap7/sys/dev/ath/if_athioctl.h	Thu Feb  5 21:47:40 2009	(r188202)
+++ projects/vap7/sys/dev/ath/if_athioctl.h	Thu Feb  5 21:57:41 2009	(r188203)
@@ -115,7 +115,9 @@ struct ath_stats {
 	u_int32_t	ast_tdma_tsf;	/* TDMA slot update set TSF */
 	u_int16_t	ast_tdma_tsfadjp;/* TDMA slot adjust+ (usec, smoothed)*/
 	u_int16_t	ast_tdma_tsfadjm;/* TDMA slot adjust- (usec, smoothed)*/
-	u_int32_t	ast_pad[17];
+	u_int32_t	ast_tdma_ack;	/* TDMA tx failed 'cuz ACK required */
+	u_int32_t	ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */
+	u_int32_t	ast_pad[15];
 };
 
 #define	SIOCGATHSTATS	_IOWR('i', 137, struct ifreq)


More information about the svn-src-projects mailing list