35#define N(a) (sizeof(a)/sizeof(a[0]))
41#define AR9280(ah) ((struct ar9280State *) AH5212(ah)->ah_rfHal)
44 const struct ieee80211_channel *, int16_t *maxPow,int16_t *minPow);
77 uint16_t bMode, fracMode, aModeRefSel = 0;
78 uint32_t freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0;
80 uint32_t refDivA = 24;
100 channelSel = (freq * 0x10000)/15;
124 if (IEEE80211_IS_CHAN_QUARTER(chan) ||
125 IEEE80211_IS_CHAN_HALF(chan))
127 else if ((freq % 20) == 0) {
129 }
else if ((freq % 10) == 0) {
132 if (aModeRefSel)
break;
173 channelSel = (freq * 0x8000)/15;
184 ch = (((f - 4800) * 10) / 25) + 1;
186 ch2 = ((ch * 25) / 5) + 9600;
187 channelSel = (ch2 * 0x4000) / 15;
201 ndiv = (freq * (refDivA >> aModeRefSel))/60;
202 channelSel = ndiv & 0x1ff;
203 channelFrac = (ndiv & 0xfffffe00) * 2;
204 channelSel = (channelSel << 17) | channelFrac;
208 reg32 = reg32 | (bMode << 29) | (fracMode << 28) |
209 (aModeRefSel << 26) | (channelSel);
235 uint16_t modesIndex, uint16_t *rfXpdGain)
248 const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
258 int16_t minGain,minPwr,minPcdac,retVal;
276 retVal = minPwr - (minPcdac*2);
283 const struct ieee80211_channel *chan,
284 int16_t *maxPow, int16_t *minPow)
288 int numChannels=0,i,last;
289 int totalD, totalF,totalMin;
294 if (IS_CHAN_A(chan)) {
295 powerArray = ahp->ah_modePowerArray5112;
298 }
else if (IS_CHAN_G(chan) || IS_CHAN_108G(chan)) {
300 powerArray = ahp->ah_modePowerArray5112;
303 }
else if (IS_CHAN_B(chan)) {
304 powerArray = ahp->ah_modePowerArray5112;
313 if ((numChannels < 1) ||
320 (i<numChannels) && (chan->channel > data[i].
channelValue);
327 totalMin = ar9280GetMinPower(ah,&data[i]) - ar9280GetMinPower(ah, &data[last]);
328 *minPow = (int8_t) ((totalMin*(chan->channel-data[last].
channelValue) + ar9280GetMinPower(ah, &data[last])*totalD)/totalD);
333 *minPow = ar9280GetMinPower(ah, &data[i]);
339 *maxPow = *minPow = 0;
361 nf = 0 - ((nf ^ 0x1ff) + 1);
363 "NF calibrated [ctl] [chain 0] is %d\n", nf);
368 nf = 0 - ((nf ^ 0x1ff) + 1);
370 "NF calibrated [ctl] [chain 1] is %d\n", nf);
375 nf = 0 - ((nf ^ 0x1ff) + 1);
377 "NF calibrated [ext] [chain 0] is %d\n", nf);
382 nf = 0 - ((nf ^ 0x1ff) + 1);
384 "NF calibrated [ext] [chain 1] is %d\n", nf);
428 "%s: cannot allocate private state\n", __func__);
int ath_hal_ini_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia, int col, int regWr)
#define NUM_XPD_PER_CHANNEL
#define ath_hal_eepromGet(_ah, _param, _val)
void * ath_hal_malloc(size_t)
#define HALDEBUG(_ah, __m,...)
#define OS_A_REG_RMW_FIELD(_a, _r, _f, _v)
void ath_hal_free(void *p)
#define OS_REG_WRITE(_ah, _reg, _val)
#define OS_MARK(_ah, _id, _v)
#define OS_REG_READ(_ah, _reg)
#define AR_PHY_CCK_TX_CTRL_JAPAN
#define AR_PHY_CCK_TX_CTRL
void ar5416GetChannelCenters(struct ath_hal *, const struct ieee80211_channel *chan, CHAN_CENTERS *centers)
#define AR9280_PHY_CH1_EXT_MINCCA_PWR
#define AR9280_PHY_CH1_MINCCA_PWR
#define AR_PHY_CH1_EXT_CCA
#define AR_PHY_SYNTH_CONTROL
#define AR9280_PHY_EXT_MINCCA_PWR
#define AR9280_PHY_MINCCA_PWR
#define AR_AN_SYNTH9_REFDIVA
#define AR_SREV_MERLIN(_ah)
static uint32_t * ar9280GetRfBank(struct ath_hal *ah, int bank)
static void ar9280WriteRegs(struct ath_hal *ah, u_int modesIndex, u_int freqIndex, int writes)
static HAL_BOOL ar9280SetRfRegs(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t modesIndex, uint16_t *rfXpdGain)
static void ar9280GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
static HAL_BOOL ar9280SetChannel(struct ath_hal *ah, const struct ieee80211_channel *chan)
AH_RF(RF9280, ar9280RfProbe, ar9280RfAttach)
static HAL_BOOL ar9280GetChannelMaxMinPower(struct ath_hal *, const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow)
static HAL_BOOL ar9280RfProbe(struct ath_hal *ah)
HAL_BOOL ar9280RfAttach(struct ath_hal *ah, HAL_STATUS *status)
static HAL_BOOL ar9280SetPowerTable(struct ath_hal *ah, int16_t *pPowerMin, int16_t *pPowerMax, const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
static void ar9280RfDetach(struct ath_hal *ah)
int16_t ar9280GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)
EXPN_DATA_PER_CHANNEL_5112 * pDataPerChannel
EXPN_DATA_PER_XPD_5112 pDataPerXPD[NUM_XPD_PER_CHANNEL]
int16_t pwr_t4[NUM_POINTS_XPD0]
uint16_t pcdac[NUM_POINTS_XPD0]
HAL_BOOL(* getChannelMaxMinPower)(struct ath_hal *ah, const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow)
HAL_BOOL(* setRfRegs)(struct ath_hal *, const struct ieee80211_channel *, uint16_t modesIndex, uint16_t *rfXpdGain)
HAL_BOOL(* setPowerTable)(struct ath_hal *ah, int16_t *minPower, int16_t *maxPower, const struct ieee80211_channel *, uint16_t *rfXpdGain)
HAL_BOOL(* setChannel)(struct ath_hal *, const struct ieee80211_channel *)
uint32_t *(* getRfBank)(struct ath_hal *ah, int bank)
void(* writeRegs)(struct ath_hal *, u_int modeIndex, u_int freqIndex, int regWrites)
int16_t(* getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL *)
void(* rfDetach)(struct ath_hal *ah)