diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c index 7fd64d1739e1..7187d576e267 100644 --- a/sys/dev/ath/ath_hal/ah.c +++ b/sys/dev/ath/ath_hal/ah.c @@ -1409,3 +1409,21 @@ ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data) (*data) = ah->ah_eepromdata[off]; return AH_TRUE; } + +/* + * Do a 2GHz specific MHz->IEEE based on the hardware + * frequency. + * + * This is the unmapped frequency which is programmed into the hardware. + */ +int +ath_hal_mhz2ieee_2ghz(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *ichan) +{ + + if (ichan->channel == 2484) + return 14; + if (ichan->channel < 2484) + return ((int) ichan->channel - 2407) / 5; + else + return 15 + ((ichan->channel - 2512) / 20); +} diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h index f92df9df0860..908f33ecedad 100644 --- a/sys/dev/ath/ath_hal/ah_internal.h +++ b/sys/dev/ath/ath_hal/ah_internal.h @@ -1021,5 +1021,9 @@ ath_hal_getantennaallowed(struct ath_hal *ah, return (chan->ic_maxantgain); } +/* + * Map the given 2GHz channel to an IEEE number. + */ +extern int ath_hal_mhz2ieee_2ghz(struct ath_hal *, HAL_CHANNEL_INTERNAL *); #endif /* _ATH_AH_INTERAL_H_ */