sys/dev/netif/ath/hal/ath_hal/ar5416/ar5416_cal.c
HAL_BOOL
ar5416ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *chan)
{
	struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
	HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
	HAL_CAL_LIST *currCal = cal->cal_curr;

	if (!AR_SREV_SOWL_10_OR_LATER(ah))
		return AH_FALSE;
	if (currCal == AH_NULL)
		return AH_FALSE;
	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;
	}
	/*
	 * Expected that this calibration has run before, post-reset.
	 * Current state should be done
	 */
	if (currCal->calState != CAL_DONE) {
		HALDEBUG(ah, HAL_DEBUG_ANY,
		    "%s: Calibration state incorrect, %d\n",
		    __func__, currCal->calState);
		return AH_FALSE;
	}

	/* Verify Cal is supported on this channel */
	if (!ar5416IsCalSupp(ah, chan, currCal->calData->calType))
		return AH_FALSE;

	HALDEBUG(ah, HAL_DEBUG_PERCAL,
	    "%s: Resetting Cal %d state for channel %u/0x%x\n",
	    __func__, currCal->calData->calType, chan->ic_freq,
	    chan->ic_flags);

	/* Disable cal validity in channel */
	ichan->calValid &= ~currCal->calData->calType;
	currCal->calState = CAL_WAITING;

	return AH_TRUE;
}
/*
 * Entry point for upper layers to restart current cal.
 * Reset the calibration valid bit in channel.
 */
Entry point for upper layers to restart current cal.
Reset the calibration valid bit in channel.
Entry point for upper layers to restart current cal . Reset the calibration valid bit in channel .
HAL_BOOL
ar5416ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *chan)
{
	struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
	HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
	HAL_CAL_LIST *currCal = cal->cal_curr;
	if (!AR_SREV_SOWL_10_OR_LATER(ah))
		return AH_FALSE;
	if (currCal == AH_NULL)
		return AH_FALSE;
	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;
	}
	if (currCal->calState != CAL_DONE) {
		HALDEBUG(ah, HAL_DEBUG_ANY,
		    "%s: Calibration state incorrect, %d\n",
		    __func__, currCal->calState);
		return AH_FALSE;
	}
	if (!ar5416IsCalSupp(ah, chan, currCal->calData->calType))
		return AH_FALSE;
	HALDEBUG(ah, HAL_DEBUG_PERCAL,
	    "%s: Resetting Cal %d state for channel %u/0x%x\n",
	    __func__, currCal->calData->calType, chan->ic_freq,
	    chan->ic_flags);
	ichan->calValid &= ~currCal->calData->calType;
	currCal->calState = CAL_WAITING;
	return AH_TRUE;
}
HAL_BOOL ar5416ResetCalValid ( struct ath_hal * ah , const struct ieee80211_channel * chan ) { struct ar5416PerCal * cal = & AH5416 ( ah ) -> ah_cal ; HAL_CHANNEL_INTERNAL * ichan = ath_hal_checkchannel ( ah , chan ) ; HAL_CAL_LIST * currCal = cal -> cal_curr ; if ( ! AR_SREV_SOWL_10_OR_LATER ( ah ) ) return AH_FALSE ; if ( currCal == AH_NULL ) return AH_FALSE ; if ( ichan == AH_NULL ) { HALDEBUG ( ah , HAL_DEBUG_ANY , " \n " , __func__ , chan -> ic_freq , chan -> ic_flags ) ; return AH_FALSE ; } if ( currCal -> calState != CAL_DONE ) { HALDEBUG ( ah , HAL_DEBUG_ANY , " \n " , __func__ , currCal -> calState ) ; return AH_FALSE ; } if ( ! ar5416IsCalSupp ( ah , chan , currCal -> calData -> calType ) ) return AH_FALSE ; HALDEBUG ( ah , HAL_DEBUG_PERCAL , " \n " , __func__ , currCal -> calData -> calType , chan -> ic_freq , chan -> ic_flags ) ; ichan -> calValid &= ~ currCal -> calData -> calType ; currCal -> calState = CAL_WAITING ; return AH_TRUE ; }
Entry point for upper layers to restart current cal.
Entry point for upper layers to restart current cal .
/*
	 * Expected that this calibration has run before, post-reset.
	 * Current state should be done
	 */ /* Verify Cal is supported on this channel */ /* Disable cal validity in channel */