35#define N(a) (sizeof(a)/sizeof(a[0]))
41#define AR9287(ah) ((struct ar9287State *) 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;
97 channelSel = (freq * 0x10000)/15;
102 &
AH9287(ah)->ah_ini_cckFirJapan2484, 1,
106 &
AH9287(ah)->ah_ini_cckFirNormal, 1,
124 if ((freq % 20) == 0) {
126 }
else if ((freq % 10) == 0) {
136 channelSel = (freq * 0x8000)/15;
143 ndiv = (freq * (refDivA >> aModeRefSel))/60;
144 channelSel = ndiv & 0x1ff;
145 channelFrac = (ndiv & 0xfffffe00) * 2;
146 channelSel = (channelSel << 17) | channelFrac;
150 reg32 = reg32 | (bMode << 29) | (fracMode << 28) |
151 (aModeRefSel << 26) | (channelSel);
177 uint16_t modesIndex, uint16_t *rfXpdGain)
190 const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
200 int16_t minGain,minPwr,minPcdac,retVal;
218 retVal = minPwr - (minPcdac*2);
225 const struct ieee80211_channel *chan,
226 int16_t *maxPow, int16_t *minPow)
230 int numChannels=0,i,last;
231 int totalD, totalF,totalMin;
236 if (IS_CHAN_A(chan)) {
237 powerArray = ahp->ah_modePowerArray5112;
240 }
else if (IS_CHAN_G(chan) || IS_CHAN_108G(chan)) {
242 powerArray = ahp->ah_modePowerArray5112;
245 }
else if (IS_CHAN_B(chan)) {
246 powerArray = ahp->ah_modePowerArray5112;
255 if ((numChannels < 1) ||
262 (i<numChannels) && (chan->channel > data[i].
channelValue);
269 totalMin = ar9287GetMinPower(ah,&data[i]) - ar9287GetMinPower(ah, &data[last]);
270 *minPow = (int8_t) ((totalMin*(chan->channel-data[last].
channelValue) + ar9287GetMinPower(ah, &data[last])*totalD)/totalD);
275 *minPow = ar9287GetMinPower(ah, &data[i]);
281 *maxPow = *minPow = 0;
303 nf = 0 - ((nf ^ 0x1ff) + 1);
305 "NF calibrated [ctl] [chain 0] is %d\n", nf);
310 nf = 0 - ((nf ^ 0x1ff) + 1);
312 "NF calibrated [ctl] [chain 1] is %d\n", nf);
317 nf = 0 - ((nf ^ 0x1ff) + 1);
319 "NF calibrated [ext] [chain 0] is %d\n", nf);
324 nf = 0 - ((nf ^ 0x1ff) + 1);
326 "NF calibrated [ext] [chain 1] is %d\n", nf);
370 "%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
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_KIWI(_ah)
#define AR_SREV_KIWI_11_OR_LATER(_ah)
static HAL_BOOL ar9287GetChannelMaxMinPower(struct ath_hal *, const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow)
static HAL_BOOL ar9287SetPowerTable(struct ath_hal *ah, int16_t *pPowerMin, int16_t *pPowerMax, const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
static void ar9287RfDetach(struct ath_hal *ah)
HAL_BOOL ar9287RfAttach(struct ath_hal *ah, HAL_STATUS *status)
static uint32_t * ar9287GetRfBank(struct ath_hal *ah, int bank)
static void ar9287WriteRegs(struct ath_hal *ah, u_int modesIndex, u_int freqIndex, int writes)
int16_t ar9287GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)
static HAL_BOOL ar9287SetRfRegs(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t modesIndex, uint16_t *rfXpdGain)
static HAL_BOOL ar9287RfProbe(struct ath_hal *ah)
AH_RF(RF9287, ar9287RfProbe, ar9287RfAttach)
static void ar9287GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
static HAL_BOOL ar9287SetChannel(struct ath_hal *ah, const struct ieee80211_channel *chan)
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)