32#define N(a) (sizeof(a)/sizeof(a[0]))
47#define AR2133(ah) ((struct ar2133State *) AH5212(ah)->ah_rfHal)
49#define ar5416ModifyRfBuffer ar5212ModifyRfBuffer
52 uint32_t numBits, uint32_t firstBit, uint32_t column);
94 uint32_t new_bias = 0;
98 if (synth_freq >= 3000)
101 if (synth_freq < 2412)
103 else if (synth_freq < 2422)
112 __func__, new_bias, synth_freq);
129 uint32_t channelSel = 0;
130 uint32_t bModeSynth = 0;
131 uint32_t aModeRefSel = 0;
144 if (((freq - 2192) % 5) == 0) {
145 channelSel = ((freq - 672) * 2 - 3040)/10;
147 }
else if (((freq - 2224) % 5) == 0) {
148 channelSel = ((freq - 704) * 2 - 3040) / 10;
152 "%s: invalid channel %u MHz\n", __func__, freq);
156 channelSel = (channelSel << 2) & 0xff;
188 }
else if (((freq % 5) == 2) && (freq <= 5435)) {
191 (uint32_t) (((freq - 4800) * 10) / 25 + 1), 8);
195 }
else if ((freq % 20) == 0 && freq >= 5120) {
201 }
else if ((freq % 10) == 0) {
207 }
else if ((freq % 5) == 0) {
212 "%s: invalid channel %u MHz\n",
221 reg32 = (channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) |
260 uint16_t modesIndex, uint16_t *rfXpdGain)
283 if (IEEE80211_IS_CHAN_2GHZ(chan)) {
331 const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
341 int16_t minGain,minPwr,minPcdac,retVal;
359 retVal = minPwr - (minPcdac*2);
366 const struct ieee80211_channel *chan,
367 int16_t *maxPow, int16_t *minPow)
371 int numChannels=0,i,last;
372 int totalD, totalF,totalMin;
377 if (IS_CHAN_A(chan)) {
378 powerArray = ahp->ah_modePowerArray5112;
381 }
else if (IS_CHAN_G(chan) || IS_CHAN_108G(chan)) {
383 powerArray = ahp->ah_modePowerArray5112;
386 }
else if (IS_CHAN_B(chan)) {
387 powerArray = ahp->ah_modePowerArray5112;
396 if ((numChannels < 1) ||
403 (i<numChannels) && (chan->channel > data[i].
channelValue);
410 totalMin = ar2133GetMinPower(ah,&data[i]) - ar2133GetMinPower(ah, &data[last]);
411 *minPow = (int8_t) ((totalMin*(chan->channel-data[last].
channelValue) + ar2133GetMinPower(ah, &data[last])*totalD)/totalD);
416 *minPow = ar2133GetMinPower(ah, &data[i]);
423 *maxPow = *minPow = 0;
448 nfarray[0] = nfarray[1] = nfarray[2] = 0;
449 nfarray[3] = nfarray[4] = nfarray[5] = 0;
455 nf = 0 - ((nf ^ 0x1ff) + 1);
457 "NF calibrated [ctl] [chain 2] is %d\n", nf);
462 nf = 0 - ((nf ^ 0x1ff) + 1);
464 "NF calibrated [ext] [chain 2] is %d\n", nf);
471 nf = 0 - ((nf ^ 0x1ff) + 1);
473 "NF calibrated [ctl] [chain 1] is %d\n", nf);
478 nf = 0 - ((nf ^ 0x1ff) + 1);
480 "NF calibrated [ext] [chain 1] is %d\n", nf);
486 nf = 0 - ((nf ^ 0x1ff) + 1);
488 "NF calibrated [ctl] [chain 0] is %d\n", nf);
493 nf = 0 - ((nf ^ 0x1ff) + 1);
495 "NF calibrated [ext] [chain 0] is %d\n", nf);
540 +
AH5416(ah)->ah_ini_bank0.rows *
sizeof(uint32_t)
541 +
AH5416(ah)->ah_ini_bank1.rows *
sizeof(uint32_t)
542 +
AH5416(ah)->ah_ini_bank2.rows *
sizeof(uint32_t)
543 +
AH5416(ah)->ah_ini_bank3.rows *
sizeof(uint32_t)
544 +
AH5416(ah)->ah_ini_bank6.rows *
sizeof(uint32_t)
545 +
AH5416(ah)->ah_ini_bank7.rows *
sizeof(uint32_t)
549 "%s: cannot allocate private state\n", __func__);
562 bankData = (uint32_t *) &priv[1];
uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n)
void ath_hal_ini_bank_setup(uint32_t data[], const HAL_INI_ARRAY *ia, int col)
int ath_hal_ini_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia, int col, int regWr)
int ath_hal_ini_bank_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia, const uint32_t data[], int regWr)
#define NUM_XPD_PER_CHANNEL
#define ath_hal_eepromGet(_ah, _param, _val)
void * ath_hal_malloc(size_t)
#define HALDEBUG(_ah, __m,...)
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)
static uint32_t * ar2133GetRfBank(struct ath_hal *ah, int bank)
static void ar2133GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
static HAL_BOOL ar2133SetRfRegs(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t modesIndex, uint16_t *rfXpdGain)
static void ar2133ForceBias(struct ath_hal *ah, uint16_t synth_freq)
static HAL_BOOL ar2133SetChannel(struct ath_hal *ah, const struct ieee80211_channel *chan)
static int16_t ar2133GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)
static HAL_BOOL ar2133GetChannelMaxMinPower(struct ath_hal *ah, const struct ieee80211_channel *chan, int16_t *maxPow, int16_t *minPow)
static void ar2133WriteRegs(struct ath_hal *ah, u_int modesIndex, u_int freqIndex, int writes)
HAL_BOOL ar2133RfAttach(struct ath_hal *ah, HAL_STATUS *status)
AH_RF(RF2133, ar2133Probe, ar2133RfAttach)
static void ar2133RfDetach(struct ath_hal *ah)
#define ar5416ModifyRfBuffer
static HAL_BOOL ar2133Probe(struct ath_hal *ah)
static HAL_BOOL ar2133SetPowerTable(struct ath_hal *ah, int16_t *pPowerMin, int16_t *pPowerMax, const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
#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 AR_PHY_CH1_EXT_MINCCA_PWR
#define AR_PHY_CH1_MINCCA_PWR
#define AR_PHY_CH1_EXT_CCA
#define AR_PHY_CH2_MINCCA_PWR
#define AR_PHY_CH2_EXT_CCA
#define AR_PHY_CH2_EXT_MINCCA_PWR
#define AR_PHY_MINCCA_PWR
#define AR_PHY_EXT_MINCCA_PWR
#define AR_SREV_SOWL_10_OR_LATER(_ah)
#define AR_SREV_SOWL(_ah)
#define AR_SREV_HOWL(_ah)
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)