38#include "ar5211/boss.ini"
50#define CI_2GHZ_INDEX_CORRECTION 19
102#define POWER_UP_TIME 2000
104#define DELAY_PLL_SETTLE 300
105#define DELAY_BASE_ACTIVATE 100
111 const struct ieee80211_channel *);
113 uint8_t runTime, int16_t startingNF);
115 struct ieee80211_channel *chan);
117 const struct ieee80211_channel *chan);
119 const struct ieee80211_channel *chan);
123 const struct ieee80211_channel *);
126 uint16_t numChannels,
const struct ieee80211_channel *chan);
132 uint16_t srcLeft, uint16_t srcRight,
133 uint16_t targetLeft, uint16_t targetRight,
HAL_BOOL scaleUp);
135 const uint16_t *pList, uint16_t listSize,
136 uint16_t *pLowerValue, uint16_t *pUpperValue);
139 uint16_t *pLowerPcdac, uint16_t *pUpperPcdac);
158 struct ieee80211_channel *chan,
HAL_BOOL bChannelChange,
162uint32_t softLedCfg, softLedState;
163#define N(a) (sizeof (a) /sizeof (a[0]))
164#define FAIL(_code) do { ecode = _code; goto bad; } while (0)
167 uint32_t i, ledstate;
171 uint32_t data, synthDelay;
173 uint16_t modesIndex = 0, freqIndex = 0;
175 uint32_t saveTsfLow = 0, saveTsfHigh = 0;
176 uint32_t saveDefAntenna;
179 "%s: opmode %u channel %u/0x%x %s channel\n",
180 __func__, opmode, chan->ic_freq, chan->ic_flags,
181 bChannelChange ?
"change" :
"same");
198 "%s: invalid operating mode %u\n", __func__, opmode);
205 if (bChannelChange) {
231 if (!IEEE80211_IS_CHAN_DFS(chan))
232 chan->ic_state &= ~IEEE80211_CHANSTATE_CWINT;
239 if (saveDefAntenna == 0)
258 if (IEEE80211_IS_CHAN_5GHZ(chan)) {
260 if (IEEE80211_IS_CHAN_TURBO(chan))
262 else if (IEEE80211_IS_CHAN_A(chan))
266 "%s: invalid channel %u/0x%x\n",
267 __func__, chan->ic_freq, chan->ic_flags);
272 if (IEEE80211_IS_CHAN_B(chan))
274 else if (IEEE80211_IS_CHAN_PUREG(chan))
278 "%s: invalid channel %u/0x%x\n",
279 __func__, chan->ic_freq, chan->ic_flags);
293 if (IEEE80211_IS_CHAN_2GHZ(chan) &&
296 uint32_t ob2GHz, db2GHz;
298 if (IEEE80211_IS_CHAN_CCK(chan)) {
307 ar5211Mode2_4[25][freqIndex] =
308 (ar5211Mode2_4[25][freqIndex] & ~0xC0) |
309 ((ob2GHz << 6) & 0xC0);
310 ar5211Mode2_4[26][freqIndex] =
311 (ar5211Mode2_4[26][freqIndex] & ~0x0F) |
312 (((ob2GHz >> 2) & 0x1) |
313 ((db2GHz << 1) & 0x0E));
315 for (i = 0; i <
N(ar5211Mode2_4); i++)
317 ar5211Mode2_4[i][freqIndex]);
324 for (i = 0; i <
N(ar5211Modes); i++)
325 OS_REG_WRITE(ah, ar5211Modes[i][0], ar5211Modes[i][modesIndex]);
328 for (i = 0; i <
N(ar5211BB_RfGain); i++)
329 OS_REG_WRITE(ah, ar5211BB_RfGain[i][0], ar5211BB_RfGain[i][freqIndex]);
332 for (i = 0; i <
N(ar5211Common); i++) {
333 uint32_t reg = ar5211Common[i][0];
335 if (!(bChannelChange && (0x8000 <= reg && reg < 0x9000)))
365 if (bChannelChange) {
414 "%s: error init'ing transmit power\n", __func__);
441 IEEE80211_IS_CHAN_2GHZ(chan))
451 if (IEEE80211_IS_CHAN_CCK(chan)) {
452 synthDelay = (4 * data) / 22;
454 synthDelay = data / 10;
471 if (!IEEE80211_IS_CHAN_CCK(chan))
472 chan->ic_state |= IEEE80211_CHANSTATE_CWINT;
474 "%s: noise floor calibration failed\n", __func__);
606 if (IEEE80211_IS_CHAN_B(chan)) {
648 int32_t qCoff, qCoffDenom;
651 int32_t iCoff, iCoffDenom;
652 uint32_t powerMeasQ, powerMeasI;
657 "%s: invalid channel %u/0x%x; no mapping\n",
658 __func__, chan->ic_freq, chan->ic_flags);
676 iCoffDenom = (powerMeasI / 2 + powerMeasQ / 2) / 128;
677 qCoffDenom = powerMeasQ / 64;
680 if (iCoffDenom != 0 && qCoffDenom != 0) {
681 iCoff = (-iqCorrMeas) / iCoffDenom;
683 iCoff = iCoff & 0x3f;
685 qCoff = ((int32_t)powerMeasI / qCoffDenom) - 64;
687 qCoff = qCoff & 0x1f;
714 chan->ic_state |= IEEE80211_CHANSTATE_CWINT;
725 if (!IEEE80211_IS_CHAN_CCK(chan))
726 chan->ic_state |= IEEE80211_CHANSTATE_CWINT;
755 uint32_t mask = resetMask ? resetMask : ~0;
789 uint32_t refClk, reg32, data2111;
790 int16_t chan5111, chanIEEE;
792 chanIEEE = chan->ic_ieee;
793 if (IEEE80211_IS_CHAN_2GHZ(chan)) {
807 if (chan5111 >= 145 || (chan5111 & 0x1)) {
815 reg32 = (reg32 << 2) | (refClk << 1) | (1 << 10) | 0x1;
831 nf = 0 - ((nf ^ 0x1ff) + 1);
851 ((runTime << 9) & 0xE00) | (startingNF & 0x1FF));
862 searchTime = (runTime * 512) * 7;
872 for (i = 0; i < 60; i++) {
879 "NF with runTime %d failed to end on channel %d\n",
880 runTime,
AH_PRIVATE(ah)->ah_curchan->ic_freq);
882 " PHY NF Reg state: 0x%x\n",
885 " PHY Active Reg state: 0x%x\n",
900 case IEEE80211_CHAN_A:
903 case IEEE80211_CHAN_B:
906 case IEEE80211_CHAN_PUREG:
911 __func__, chan->ic_flags);
926 int16_t nf, nfThresh;
932 "%s: NF did not complete in calibration window\n", __func__);
937 "%s: noise floor failed; detected %u, threshold %u\n",
938 __func__, nf, nfThresh);
944 chan->ic_state |= IEEE80211_CHANSTATE_CWINT;
947 return (nf <= nfThresh);
962#define N(a) (sizeof (a) / sizeof (a[0]))
966 static const uint8_t runtime[3] = { 0, 2, 7 };
968 int16_t nf, nfThresh;
977 for (i = 0; i <
N(runtime); i++) {
981 "%s: run failed with %u > threshold %u "
982 "(runtime %u)\n", __func__,
983 nf, nfThresh, runtime[i]);
988 return (i <=
N(runtime));
1005 static const struct {
1022 for (i = 0; c->
channel <= adjust5111[i].freqLow; i++)
1025 return adjust5111[i].adjust / 3;
1037#define N(a) (sizeof (a) / sizeof (a[0]))
1041 uint16_t rfXpdGain, rfPloSel, rfPwdXpd;
1042 uint16_t tempOB, tempDB;
1046 freqIndex = IEEE80211_IS_CHAN_2GHZ(chan) ? 2 : 1;
1054 case IEEE80211_CHAN_A:
1055 if (freq > 4000 && freq < 5260) {
1058 }
else if (freq >= 5260 && freq < 5500) {
1061 }
else if (freq >= 5500 && freq < 5725) {
1064 }
else if (freq >= 5725) {
1069 tempOB = tempDB = 0;
1073 rfPloSel = ee->
ee_xpd[0];
1074 rfPwdXpd = !ee->
ee_xpd[0];
1076 ar5211Rf6n7[5][freqIndex] =
1077 (ar5211Rf6n7[5][freqIndex] & ~0x10000000) |
1079 ar5211Rf6n7[6][freqIndex] =
1080 (ar5211Rf6n7[6][freqIndex] & ~0x04000000) |
1082 ar5211Rf6n7[21][freqIndex] =
1083 (ar5211Rf6n7[21][freqIndex] & ~0x08) |
1086 case IEEE80211_CHAN_B:
1090 rfPloSel = ee->
ee_xpd[1];
1091 rfPwdXpd = !ee->
ee_xpd[1];
1093 case IEEE80211_CHAN_PUREG:
1097 rfPloSel = ee->
ee_xpd[2];
1098 rfPwdXpd = !ee->
ee_xpd[2];
1102 __func__, chan->ic_flags);
1110 ar5211Rf6n7[11][freqIndex] = (ar5211Rf6n7[11][freqIndex] & ~0xC0) |
1112 ar5211Rf6n7[12][freqIndex] = (ar5211Rf6n7[12][freqIndex] & ~0x07) |
1116 ar5211Rf6n7[12][freqIndex] = (ar5211Rf6n7[12][freqIndex] & ~0x80) |
1118 ar5211Rf6n7[13][freqIndex] = (ar5211Rf6n7[13][freqIndex] & ~0x03) |
1122 ar5211Rf6n7[13][freqIndex] = (ar5211Rf6n7[13][freqIndex] & ~0x1C) |
1126 ar5211Rf6n7[17][freqIndex] = (ar5211Rf6n7[17][freqIndex] & ~0x08) |
1127 ((rfPloSel << 3) & 0x08);
1130 for (i = 0; i <
N(ar5211Rf6n7); i++)
1131 OS_REG_WRITE(ah, ar5211Rf6n7[i][0], ar5211Rf6n7[i][freqIndex]);
1142 const struct ieee80211_channel *chan)
1144#define ANT_SWITCH_TABLE1 0x9960
1145#define ANT_SWITCH_TABLE2 0x9964
1148 uint32_t antSwitchA, antSwitchB;
1152 case IEEE80211_CHAN_A: ix = 0;
break;
1153 case IEEE80211_CHAN_B: ix = 1;
break;
1154 case IEEE80211_CHAN_PUREG: ix = 2;
break;
1157 __func__, chan->ic_flags);
1178 antSwitchB = antSwitchA;
1181 antSwitchA = antSwitchB;
1187 __func__, settings);
1196#undef ANT_SWITCH_TABLE1
1197#undef ANT_SWITCH_TABLE2
1209 int arrayMode, falseDectectBackoff;
1212 case IEEE80211_CHAN_A:
1217 case IEEE80211_CHAN_B:
1220 case IEEE80211_CHAN_PUREG:
1225 __func__, chan->ic_flags);
1267#define NO_FALSE_DETECT_BACKOFF 2
1268#define CB22_FALSE_DETECT_BACKOFF 6
1276 if (
AH_PRIVATE(ah)->ah_subvendorid == 0x1022 &&
1277 IEEE80211_IS_CHAN_OFDM(chan))
1281 uint32_t remainder = freq % 32;
1283 if (remainder && (remainder < 10 || remainder > 22))
1288 | ((falseDectectBackoff << 1) & 0xF7));
1291#undef NO_FALSE_DETECT_BACKOFF
1292#undef CB22_FALSE_DETECT_BACKOFF
1322 u_int nchan, cfgCtl;
1327 case IEEE80211_CHAN_A:
1331 nchan = ee->ee_numTargetPwr_11a;
1332 pi = ee->ee_trgtPwr_11a;
1334 case IEEE80211_CHAN_PUREG:
1338 nchan = ee->ee_numTargetPwr_11g;
1339 pi = ee->ee_trgtPwr_11g;
1341 case IEEE80211_CHAN_B:
1345 nchan = ee->ee_numTargetPwr_11b;
1346 pi = ee->ee_trgtPwr_11b;
1350 __func__, chan->ic_flags);
1383 uint16_t *pPcdacValues;
1384 int16_t *pScaledUpDbm;
1385 int16_t minScaledPwr;
1386 int16_t maxScaledPwr;
1388 uint16_t pcdacMin = 0;
1389 uint16_t pcdacMax = 63;
1390 uint16_t pcdacTableIndex;
1391 uint16_t scaledPcdac;
1402 pPcdacValues[j] = i;
1413 minScaledPwr = pScaledUpDbm[0];
1418 if (minScaledPwr >= pScaledUpDbm[j]) {
1419 minScaledPwr = pScaledUpDbm[j];
1430 if (pScaledUpDbm[i-1] > pScaledUpDbm[i]) {
1436 pScaledUpDbm[i - 1] = pScaledUpDbm[i];
1441 if (maxScaledPwr < pScaledUpDbm[j]) {
1442 maxScaledPwr = pScaledUpDbm[j];
1450 pcdacTableIndex = 0;
1452 pcdacTable[pcdacTableIndex++] = pcdacMin;
1459 (pwr - pScaledUpDbm[i])*(pwr - pScaledUpDbm[i+1]) > 0)
1463 pScaledUpDbm[i], pScaledUpDbm[i+1],
1464 (uint16_t)(pPcdacValues[i] * 2),
1465 (uint16_t)(pPcdacValues[i+1] * 2), 0) + 1);
1467 pcdacTable[pcdacTableIndex] = scaledPcdac / 2;
1468 if (pcdacTable[pcdacTableIndex] > pcdacMax)
1469 pcdacTable[pcdacTableIndex] = pcdacMax;
1475 pcdacTable[pcdacTableIndex] = pcdacTable[pcdacTableIndex - 1];
1481 for (i = 0; i < 32; i++) {
1482 temp32 = 0xffff & ((pcdacTable[2 * i + 1] << 8) | 0xff);
1483 temp32 = (temp32 << 16) | (0xffff & ((pcdacTable[2 * i] << 8) | 0xff));
1497 const struct ieee80211_channel *chan)
1503 static const uint16_t tpcScaleReductionTable[5] =
1506 uint16_t *pRatesPower;
1507 uint16_t lowerChannel, lowerIndex=0, lowerPower=0;
1508 uint16_t upperChannel, upperIndex=0, upperPower=0;
1509 uint16_t twiceMaxEdgePower=63;
1510 uint16_t twicePower = 0;
1511 uint16_t i, numEdges;
1513 uint16_t twiceMaxRDPower;
1514 int16_t scaledPower = 0;
1515 uint16_t mask = 0x3f;
1517 int8_t twiceAntennaGain, twiceAntennaReduction = 0;
1519 pRatesPower = ratesArray;
1520 twiceMaxRDPower = chan->ic_maxregpower * 2;
1522 if (IEEE80211_IS_CHAN_5GHZ(chan)) {
1530 if (pRdEdgesPower) {
1533 if (pRdEdgesPower[i].rdEdge == 0)
1535 tempChannelList[i] = pRdEdgesPower[i].
rdEdge;
1540 numEdges, &lowerChannel, &upperChannel);
1542 for (i = 0; i < numEdges; i++)
1543 if (lowerChannel == tempChannelList[i])
1547 if ((lowerChannel == upperChannel &&
1548 lowerChannel == freq) ||
1549 pRdEdgesPower[i].flag) {
1556 for (i = 0; i < numChannels; i++)
1557 tempChannelList[i] = pPowerInfo[i].testChannel;
1560 numChannels, &lowerChannel, &upperChannel);
1563 for (i = 0; i < numChannels; i++) {
1564 if (lowerChannel == tempChannelList[i])
1566 if (upperChannel == tempChannelList[i]) {
1573 if (IEEE80211_IS_CHAN_OFDM(chan)) {
1578 }
else if (i == 5) {
1579 lowerPower = pPowerInfo[lowerIndex].
twicePwr36;
1580 upperPower = pPowerInfo[upperIndex].
twicePwr36;
1581 }
else if (i == 6) {
1582 lowerPower = pPowerInfo[lowerIndex].
twicePwr48;
1583 upperPower = pPowerInfo[upperIndex].
twicePwr48;
1584 }
else if (i == 7) {
1585 lowerPower = pPowerInfo[lowerIndex].
twicePwr54;
1586 upperPower = pPowerInfo[upperIndex].
twicePwr54;
1597 lowerPower = pPowerInfo[lowerIndex].
twicePwr36;
1598 upperPower = pPowerInfo[upperIndex].
twicePwr36;
1602 lowerPower = pPowerInfo[lowerIndex].
twicePwr48;
1603 upperPower = pPowerInfo[upperIndex].
twicePwr48;
1607 lowerPower = pPowerInfo[lowerIndex].
twicePwr54;
1608 upperPower = pPowerInfo[upperIndex].
twicePwr54;
1614 lowerChannel, upperChannel, lowerPower, upperPower, 0);
1617 twicePower =
AH_MIN(twicePower, twiceMaxEdgePower);
1625 if (IEEE80211_IS_CHAN_TURBO(chan) &&
1627#ifdef AH_ENABLE_AP_SUPPORT
1635 pRatesPower[i] =
AH_MIN(twicePower, twiceMaxRDPower - twiceAntennaReduction);
1640 scaledPower = pRatesPower[0] -
1641 (tpcScaleReductionTable[
AH_PRIVATE(ah)->ah_tpScale] * 2);
1642 if (scaledPower < 1)
1646 pRatesPower[i] =
AH_MIN(pRatesPower[i], scaledPower);
1654 "%s: final output power setting %d MHz:\n",
1655 __func__, chan->ic_freq);
1657 "6 Mb %d dBm, MaxRD: %d dBm, MaxEdge %d dBm\n",
1658 scaledPower / 2, twiceMaxRDPower / 2, twiceMaxEdgePower / 2);
1660 tpcScaleReductionTable[
AH_PRIVATE(ah)->ah_tpScale] * 2,
1661 twiceAntennaReduction / 2);
1662 if (IEEE80211_IS_CHAN_TURBO(chan) &&
1667 " %2d | %2d | %2d | %2d | %2d | %2d | %2d | %2d dBm\n",
1668 pRatesPower[0] / 2, pRatesPower[1] / 2, pRatesPower[2] / 2,
1669 pRatesPower[3] / 2, pRatesPower[4] / 2, pRatesPower[5] / 2,
1670 pRatesPower[6] / 2, pRatesPower[7] / 2);
1675 ((paPreDEnable & 1)<< 30) | ((pRatesPower[3] & mask) << 24) |
1676 ((paPreDEnable & 1)<< 22) | ((pRatesPower[2] & mask) << 16) |
1677 ((paPreDEnable & 1)<< 14) | ((pRatesPower[1] & mask) << 8) |
1678 ((paPreDEnable & 1)<< 6 ) | (pRatesPower[0] & mask));
1680 ((paPreDEnable & 1)<< 30) | ((pRatesPower[7] & mask) << 24) |
1681 ((paPreDEnable & 1)<< 22) | ((pRatesPower[6] & mask) << 16) |
1682 ((paPreDEnable & 1)<< 14) | ((pRatesPower[5] & mask) << 8) |
1683 ((paPreDEnable & 1)<< 6 ) | (pRatesPower[4] & mask));
1688 AH_PRIVATE(ah)->ah_maxPowerLevel = pRatesPower[0];
1698 uint16_t powerValue;
1699 uint16_t lFreq, rFreq;
1700 uint16_t llPcdac, ulPcdac;
1701 uint16_t lrPcdac, urPcdac;
1702 uint16_t lPwr, uPwr;
1703 uint16_t lScaledPwr, rScaledPwr;
1712 &llPcdac, &ulPcdac);
1714 &lrPcdac, &urPcdac);
1720 llPcdac, ulPcdac, lPwr, uPwr, 0);
1725 lrPcdac, urPcdac, lPwr, uPwr, 0);
1728 lScaledPwr, rScaledPwr, 0);
1739 const uint16_t *pPcdac;
1747 if (*pPcdac == pcdacValue) {
1748 *powerValue = pChannelData->
PwrValues[j];
1764 uint16_t srcLeft, uint16_t srcRight,
1765 uint16_t targetLeft, uint16_t targetRight,
1773 if ((targetLeft * targetRight) == 0)
1778 if (srcRight != srcLeft) {
1783 lRatio = (target - srcLeft) *
EEP_SCALE / (srcRight - srcLeft);
1786 rv = targetLeft * (scaleUp ?
EEP_SCALE : 1);
1789 rv = targetRight * (scaleUp ?
EEP_SCALE : 1);
1791 rv = (lRatio * targetRight + (
EEP_SCALE - lRatio) *
1792 targetLeft) / scaleValue;
1815 const uint16_t *pList, uint16_t listSize,
1816 uint16_t *pLowerValue, uint16_t *pUpperValue)
1818 const uint16_t listEndValue = *(pList + listSize - 1);
1827 *pLowerValue = *pList;
1828 *pUpperValue = *pList;
1837 *pLowerValue = listEndValue;
1838 *pUpperValue = listEndValue;
1843 for (i = 0; i < listSize; i++) {
1849 *pLowerValue = pList[i];
1850 *pUpperValue = pList[i];
1859 *pLowerValue = pList[i];
1860 *pUpperValue = pList[i + 1];
1873 uint16_t *pLowerPcdac, uint16_t *pUpperPcdac)
1889#define DYN_ADJ_UP_MARGIN 15
1890#define DYN_ADJ_LO_MARGIN 20
1895 { { {4, 1, 1, 1}, 6,
"FG8"},
1896 { {4, 0, 1, 1}, 4,
"FG7"},
1897 { {3, 1, 1, 1}, 3,
"FG6"},
1898 { {4, 0, 0, 1}, 1,
"FG5"},
1899 { {4, 1, 1, 0}, 0,
"FG4"},
1900 { {4, 0, 1, 0}, -2,
"FG3"},
1901 { {3, 1, 1, 0}, -3,
"FG2"},
1902 { {4, 0, 0, 0}, -4,
"FG1"},
1903 { {2, 1, 1, 0}, -6,
"FG0"}
1927 const struct ieee80211_channel *chan =
AH_PRIVATE(ah)->ah_curchan;
1929 uint32_t L1, L2, L3, L4;
1931 if (IEEE80211_IS_CHAN_CCK(chan)) {
1952 return !((g >= L1 && g<= L2) || (g >= L3 && g <= L4));
2034 "%s: Max gain limit.\n", __func__);
2038 "%s: Adding gain: currG=%d [%s] --> ",
2053 "%s: Min gain limit.\n", __func__);
2057 "%s: Deducting gain: currG=%d [%s] --> ",
uint32_t ath_hal_reverseBits(uint32_t val, uint32_t n)
HAL_BOOL ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val)
#define HAL_NUM_TX_QUEUES
@ HAL_RFGAIN_READ_REQUESTED
u_int ath_hal_getantennareduction(struct ath_hal *ah, const struct ieee80211_channel *chan, u_int twiceGain)
u_int ath_hal_getctl(struct ath_hal *, const struct ieee80211_channel *)
static OS_INLINE HAL_CHANNEL_INTERNAL * ath_hal_checkchannel(struct ath_hal *ah, const struct ieee80211_channel *c)
#define HAL_DIAG_11N_SERVICES
static __inline__ int isBigEndian(void)
static OS_INLINE uint16_t ath_hal_gethwchannel(struct ath_hal *ah, const struct ieee80211_channel *c)
#define IEEE80211_CHAN_ALLFULL
#define OS_REG_RMW_FIELD(_a, _r, _f, _v)
#define HALDEBUG(_ah, __m,...)
#define CHANNEL_NFCREQUIRED
#define OS_MEMZERO(_a, _n)
#define OS_REG_WRITE(_ah, _reg, _val)
#define OS_MARK(_ah, _id, _v)
#define OS_REG_READ(_ah, _reg)
#define INIT_CONFIG_STATUS
#define AR_BEACON_RESET_TSF
#define AR_STA_ID1_DESC_ANTENNA
#define AR_STA_ID1_DEFAULT_ANTENNA
HAL_BOOL ar5211ResetTxQueue(struct ath_hal *ah, u_int q)
HAL_BOOL ar5211SetSifsTime(struct ath_hal *, u_int)
#define INIT_IQCAL_LOG_COUNT_MAX
#define INIT_INTERRUPT_MASK
HAL_BOOL ar5211SetAckTimeout(struct ath_hal *, u_int)
HAL_BOOL ar5211SetCTSTimeout(struct ath_hal *, u_int)
void ar5211EnableRfKill(struct ath_hal *)
HAL_BOOL ar5211SetSlotTime(struct ath_hal *, u_int)
HAL_BOOL ar5211SetPowerMode(struct ath_hal *, uint32_t powerRequest, int setChip)
static void ar5211GetLowerUpperValues(uint16_t value, const uint16_t *pList, uint16_t listSize, uint16_t *pLowerValue, uint16_t *pUpperValue)
void ar5211SetPCUConfig(struct ath_hal *ah)
static HAL_BOOL ar5211SetResetReg(struct ath_hal *ah, uint32_t resetMask)
#define DELAY_BASE_ACTIVATE
static HAL_BOOL ar5211FindValueInList(uint16_t channel, uint16_t pcdacValue, const PCDACS_EEPROM *pSrcStruct, uint16_t *powerValue)
#define DYN_ADJ_UP_MARGIN
int16_t ar5211GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)
static void ar5211RequestRfgain(struct ath_hal *)
static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *)
HAL_BOOL ar5211ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *chan)
HAL_BOOL ar5211SetTxPowerLimit(struct ath_hal *ah, uint32_t limit)
static int32_t ar5211AdjustGain(struct ath_hal *, GAIN_VALUES *)
void ar5211InitializeGainValues(struct ath_hal *ah)
HAL_BOOL ar5211PerCalibrationN(struct ath_hal *ah, struct ieee80211_channel *chan, u_int chainMask, HAL_BOOL longCal, HAL_BOOL *isCalDone)
static HAL_BOOL getNoiseFloorThresh(struct ath_hal *ah, const struct ieee80211_channel *chan, int16_t *nft)
#define CB22_FALSE_DETECT_BACKOFF
#define DYN_ADJ_LO_MARGIN
HAL_BOOL ar5211Reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_BOOL bChannelChange, HAL_RESET_TYPE resetType, HAL_STATUS *status)
#define ANT_SWITCH_TABLE2
#define ANT_SWITCH_TABLE1
static void ar5211SetPowerTable(struct ath_hal *, PCDACS_EEPROM *pSrcStruct, uint16_t channel)
static HAL_BOOL ar5211InvalidGainReadback(struct ath_hal *, GAIN_VALUES *)
static void ar5211SetOperatingMode(struct ath_hal *, int opmode)
static HAL_BOOL ar5211SetBoardValues(struct ath_hal *, const struct ieee80211_channel *chan)
HAL_BOOL ar5211CalNoiseFloor(struct ath_hal *ah, const struct ieee80211_channel *chan)
HAL_BOOL ar5211ChipReset(struct ath_hal *ah, const struct ieee80211_channel *chan)
static void ar5211GetLowerUpperPcdacs(uint16_t pcdac, uint16_t channel, const PCDACS_EEPROM *pSrcStruct, uint16_t *pLowerPcdac, uint16_t *pUpperPcdac)
HAL_RFGAIN ar5211GetRfgain(struct ath_hal *ah)
HAL_BOOL ar5211SetAntennaSwitchInternal(struct ath_hal *ah, HAL_ANT_SETTING settings, const struct ieee80211_channel *chan)
static HAL_BOOL ar5211IsGainAdjustNeeded(struct ath_hal *, const GAIN_VALUES *)
static int16_t ar5211RunNoiseFloor(struct ath_hal *, uint8_t runTime, int16_t startingNF)
HAL_BOOL ar5211PhyDisable(struct ath_hal *ah)
#define NO_FALSE_DETECT_BACKOFF
static const GAIN_OPTIMIZATION_LADDER gainLadder
static void ar5211SetRateTable(struct ath_hal *, RD_EDGES_POWER *pRdEdgesPower, TRGT_POWER_INFO *pPowerInfo, uint16_t numChannels, const struct ieee80211_channel *chan)
HAL_BOOL ar5211PerCalibration(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_BOOL *isIQdone)
static HAL_BOOL ar5211SetChannel(struct ath_hal *, const struct ieee80211_channel *)
static int16_t ar5211GetNoiseFloor(struct ath_hal *ah)
static HAL_BOOL ar5211IsNfGood(struct ath_hal *, struct ieee80211_channel *chan)
static HAL_BOOL ar5211SetRf6and7(struct ath_hal *, const struct ieee80211_channel *chan)
static uint16_t ar5211GetScaledPower(uint16_t channel, uint16_t pcdacValue, const PCDACS_EEPROM *pSrcStruct)
static const CHAN_INFO_2GHZ chan2GHzData[]
static HAL_BOOL ar5211SetTransmitPower(struct ath_hal *, const struct ieee80211_channel *)
HAL_BOOL ar5211Disable(struct ath_hal *ah)
#define CI_2GHZ_INDEX_CORRECTION
static uint16_t ar5211GetInterpolatedValue(uint16_t target, uint16_t srcLeft, uint16_t srcRight, uint16_t targetLeft, uint16_t targetRight, HAL_BOOL scaleUp)
#define AR_PHY_POWER_TX_RATE2
#define AR_PHY_IQCAL_RES_IQ_CORR_MEAS
#define AR_PHY_AGC_CONTROL_CAL
#define AR_PHY_FRAME_CTL_TX_CLIP
#define AR_PHY_TIMING_CTRL4_DO_IQCAL
#define AR5211_PHY_MODE_CCK
#define AR_PHY_AGC_CONTROL_NF
#define AR_PHY_FRAME_CTL_ERR_SERV
#define AR_PHY_FC_TURBO_SHORT
#define AR_PHY_PLL_CTL_40
#define AR_PHY_POWER_TX_RATE1
#define AR5211_PHY_MODE_OFDM
#define AR_PHY_FC_TURBO_MODE
#define AR5211_PHY_MODE_RF2GHZ
#define AR_PHY_IQCAL_RES_PWR_MEAS_I
#define AR_PHY_PAPD_PROBE_POWERTX
#define AR_PHY_POWER_TX_RATE_MAX
#define AR_PHY_PAPD_PROBE_GAINF_S
#define AR_PHY_TIMING_CTRL4
#define AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF_S
#define AR_PHY_PAPD_PROBE
#define AR_PHY_PAPD_PROBE_NEXT_TX
#define AR_PHY_TIMING_CTRL4_IQCORR_ENABLE
#define AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX_S
#define AR_PHY_RX_DELAY_M
#define AR_PHY_PLL_CTL_44
#define AR5211_PHY_MODE_RF5GHZ
#define AR_PHY_AGC_CONTROL
#define AR_PHY_IQCAL_RES_PWR_MEAS_Q
#define AR5311_USEC_TX_LAT_M
#define AR_CFG_CLK_GATE_DIS
#define AR5311_DIAG_SW_USE_ECO
#define AR_STA_ID1_RTS_USE_DEF
#define AR_PCICFG_LEDSLOW
#define AR_PCICFG_LEDMODE
#define AR_IMR_S0_QCU_TXDESC
#define AR_STA_ID1_STA_AP
#define AR_IMR_S0_QCU_TXOK
#define AR5311_USEC_RX_LAT_S
#define AR_PCICFG_LEDBLINK
#define AR_SREV_VERSION_OAHU
#define AR_SREV_OAHU_PROD
#define AR_IMR_S1_QCU_TXERR
#define AR_IMR_S0_QCU_TXDESC_S
#define AR5311_USEC_RX_LAT_M
#define AR_IMR_S2_QCU_TXURN
#define AR_STA_ID1_BASE_RATE_11B
#define AR_D_GBL_IFS_EIFS
GAIN_OPTIMIZATION_STEP optStep[10]
uint32_t numStepsInLadder
const GAIN_OPTIMIZATION_STEP * currStep
uint16_t ee_channels11a[NUM_11A_EEPROM_CHANNELS]
RD_EDGES_POWER ee_rdEdgesPower[NUM_EDGES *NUM_CTLS_MAX]
int8_t ee_pgaDesiredSize[3]
DATA_PER_CHANNEL ee_dataPerChannel11a[NUM_11A_EEPROM_CHANNELS]
uint16_t ee_antennaControl[11][3]
CORNER_CAL_INFO ee_cornerCal
uint16_t ee_txFrameToXPAOn[3]
int8_t ee_antennaGainMax[2]
uint16_t ee_switchSettling[3]
uint16_t ee_channels11b[NUM_2_4_EEPROM_CHANNELS]
int16_t ee_noiseFloorThresh[3]
uint16_t ee_turbo2WMaxPower5
DATA_PER_CHANNEL ee_dataPerChannel11b[NUM_2_4_EEPROM_CHANNELS]
uint16_t ee_numChannels11a
uint16_t ee_numChannels2_4
uint16_t ee_txEndToXLNAOn[3]
int8_t ee_adcDesiredSize[3]
DATA_PER_CHANNEL ee_dataPerChannel11g[NUM_2_4_EEPROM_CHANNELS]
uint16_t ee_txEndToXPAOff[3]
uint16_t ee_falseDetectBackoff[3]
uint16_t ee_channels11g[NUM_2_4_EEPROM_CHANNELS]
uint16_t ee_ctl[NUM_CTLS_MAX]
uint16_t twice_rdEdgePower
GAIN_VALUES ah_gainValues
uint8_t ah_bssid[IEEE80211_ADDR_LEN]
HAL_BOOL ah_bIQCalibration
uint8_t ah_macaddr[IEEE80211_ADDR_LEN]
HAL_ANT_SETTING ah_diversityControl
uint32_t ah_tx6PowerInHalfDbm
uint32_t ah_calibrationTime
uint32_t ah_staId1Defaults
int16_t PwrValues[NUM_PCDAC_VALUES]
uint16_t PcdacValues[NUM_PCDAC_VALUES]
const uint16_t * pChannelList
const DATA_PER_CHANNEL * pDataPerChannel