Lines Matching +full:106 +full:- +full:db

1 /*-
2 * SPDX-License-Identifier: ISC
4 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5 * Copyright (c) 2002-2008 Atheros Communications, Inc.
46 #define AR5111(ah) ((struct ar5111State *) AH5212(ah)->ah_rfHal)
95 { 1, 0x46, 96 }, /* 2312 -19 */ in ar5111SetChannel()
96 { 1, 0x46, 97 }, /* 2317 -18 */ in ar5111SetChannel()
97 { 1, 0x46, 98 }, /* 2322 -17 */ in ar5111SetChannel()
98 { 1, 0x46, 99 }, /* 2327 -16 */ in ar5111SetChannel()
99 { 1, 0x46, 100 }, /* 2332 -15 */ in ar5111SetChannel()
100 { 1, 0x46, 101 }, /* 2337 -14 */ in ar5111SetChannel()
101 { 1, 0x46, 102 }, /* 2342 -13 */ in ar5111SetChannel()
102 { 1, 0x46, 103 }, /* 2347 -12 */ in ar5111SetChannel()
103 { 1, 0x46, 104 }, /* 2352 -11 */ in ar5111SetChannel()
104 { 1, 0x46, 105 }, /* 2357 -10 */ in ar5111SetChannel()
105 { 1, 0x46, 106 }, /* 2362 -9 */ in ar5111SetChannel()
106 { 1, 0x46, 107 }, /* 2367 -8 */ in ar5111SetChannel()
107 { 1, 0x46, 108 }, /* 2372 -7 */ in ar5111SetChannel()
108 /* index -6 to 0 are pad to make this a nolookup table */ in ar5111SetChannel()
109 { 1, 0x46, 116 }, /* -6 */ in ar5111SetChannel()
110 { 1, 0x46, 116 }, /* -5 */ in ar5111SetChannel()
111 { 1, 0x46, 116 }, /* -4 */ in ar5111SetChannel()
112 { 1, 0x46, 116 }, /* -3 */ in ar5111SetChannel()
113 { 1, 0x46, 116 }, /* -2 */ in ar5111SetChannel()
114 { 1, 0x46, 116 }, /* -1 */ in ar5111SetChannel()
146 chanIEEE = chan->ic_ieee; in ar5111SetChannel()
152 data2111 = ((ath_hal_reverseBits(ci->channelSelect, 8) & 0xff) in ar5111SetChannel()
154 | (ci->refClkSel << 4); in ar5111SetChannel()
155 chan5111 = ci->channel5111; in ar5111SetChannel()
172 reg32 = ath_hal_reverseBits(chan5111 - 24, 8) & 0xff; in ar5111SetChannel()
175 reg32 = ath_hal_reverseBits(((chan5111 - 24)/2), 8) & 0xff; in ar5111SetChannel()
184 AH_PRIVATE(ah)->ah_curchan = chan; in ar5111SetChannel()
199 case 0: return priv->Bank0Data; in ar5111GetRfBank()
200 case 1: return priv->Bank1Data; in ar5111GetRfBank()
201 case 2: return priv->Bank2Data; in ar5111GetRfBank()
202 case 3: return priv->Bank3Data; in ar5111GetRfBank()
203 case 6: return priv->Bank6Data; in ar5111GetRfBank()
204 case 7: return priv->Bank7Data; in ar5111GetRfBank()
223 const HAL_EEPROM *ee = AH_PRIVATE(ah)->ah_eeprom; in ar5111SetRfRegs()
230 __func__, chan->ic_freq, chan->ic_flags, modesIndex); in ar5111SetRfRegs()
233 switch (chan->ic_flags & IEEE80211_CHAN_ALLFULL) { in ar5111SetRfRegs()
236 tempOB = ee->ee_ob1; in ar5111SetRfRegs()
237 tempDB = ee->ee_db1; in ar5111SetRfRegs()
239 tempOB = ee->ee_ob2; in ar5111SetRfRegs()
240 tempDB = ee->ee_db2; in ar5111SetRfRegs()
242 tempOB = ee->ee_ob3; in ar5111SetRfRegs()
243 tempDB = ee->ee_db3; in ar5111SetRfRegs()
245 tempOB = ee->ee_ob4; in ar5111SetRfRegs()
246 tempDB = ee->ee_db4; in ar5111SetRfRegs()
253 rfXpdGainFixed = ee->ee_xgain[headerInfo11A]; in ar5111SetRfRegs()
254 rfPloSel = ee->ee_xpd[headerInfo11A]; in ar5111SetRfRegs()
255 rfPwdXpd = !ee->ee_xpd[headerInfo11A]; in ar5111SetRfRegs()
256 gainI = ee->ee_gainI[headerInfo11A]; in ar5111SetRfRegs()
259 tempOB = ee->ee_obFor24; in ar5111SetRfRegs()
260 tempDB = ee->ee_dbFor24; in ar5111SetRfRegs()
261 ob2GHz = ee->ee_ob2GHz[0]; in ar5111SetRfRegs()
262 db2GHz = ee->ee_db2GHz[0]; in ar5111SetRfRegs()
264 rfXpdGainFixed = ee->ee_xgain[headerInfo11B]; in ar5111SetRfRegs()
265 rfPloSel = ee->ee_xpd[headerInfo11B]; in ar5111SetRfRegs()
266 rfPwdXpd = !ee->ee_xpd[headerInfo11B]; in ar5111SetRfRegs()
267 gainI = ee->ee_gainI[headerInfo11B]; in ar5111SetRfRegs()
271 tempOB = ee->ee_obFor24g; in ar5111SetRfRegs()
272 tempDB = ee->ee_dbFor24g; in ar5111SetRfRegs()
273 ob2GHz = ee->ee_ob2GHz[1]; in ar5111SetRfRegs()
274 db2GHz = ee->ee_db2GHz[1]; in ar5111SetRfRegs()
276 rfXpdGainFixed = ee->ee_xgain[headerInfo11G]; in ar5111SetRfRegs()
277 rfPloSel = ee->ee_xpd[headerInfo11G]; in ar5111SetRfRegs()
278 rfPwdXpd = !ee->ee_xpd[headerInfo11G]; in ar5111SetRfRegs()
279 gainI = ee->ee_gainI[headerInfo11G]; in ar5111SetRfRegs()
283 __func__, chan->ic_flags); in ar5111SetRfRegs()
312 ar5212ModifyRfBuffer(rfReg, ee->ee_cornerCal.pd84, 1, 51, 3); in ar5111SetRfRegs()
313 ar5212ModifyRfBuffer(rfReg, ee->ee_cornerCal.pd90, 1, 45, 3); in ar5111SetRfRegs()
317 /* Set 5212 OB & DB */ in ar5111SetRfRegs()
342 ahp->ah_rfgainState = HAL_RFGAIN_INACTIVE; in ar5111SetRfRegs()
366 lRatio = (target - srcLeft) * EEP_SCALE / (srcRight - srcLeft); in interpolate()
374 rv = (lRatio * targetRight + (EEP_SCALE - lRatio) * in interpolate()
396 const HAL_EEPROM *ee = AH_PRIVATE(ah)->ah_eeprom; in ar5111SetPowerTable()
413 switch (chan->ic_flags & IEEE80211_CHAN_ALLTURBOFULL) { in ar5111SetPowerTable()
416 eepromPcdacs.numChannels = ee->ee_numChannels11a; in ar5111SetPowerTable()
417 eepromPcdacs.pChannelList = ee->ee_channels11a; in ar5111SetPowerTable()
418 eepromPcdacs.pDataPerChannel = ee->ee_dataPerChannel11a; in ar5111SetPowerTable()
421 eepromPcdacs.numChannels = ee->ee_numChannels2_4; in ar5111SetPowerTable()
422 eepromPcdacs.pChannelList = ee->ee_channels11b; in ar5111SetPowerTable()
423 eepromPcdacs.pDataPerChannel = ee->ee_dataPerChannel11b; in ar5111SetPowerTable()
427 eepromPcdacs.numChannels = ee->ee_numChannels2_4; in ar5111SetPowerTable()
428 eepromPcdacs.pChannelList = ee->ee_channels11g; in ar5111SetPowerTable()
429 eepromPcdacs.pDataPerChannel = ee->ee_dataPerChannel11g; in ar5111SetPowerTable()
433 __func__, chan->ic_flags); in ar5111SetPowerTable()
458 maxScaledPwr = pScaledUpDbm[pcdacStruct.numPcdacValues - 1]; in ar5111SetPowerTable()
469 * working from the top, hence i = 63 - j. in ar5111SetPowerTable()
471 i = (uint16_t)(pcdacStruct.numPcdacValues - 1 - j); in ar5111SetPowerTable()
474 if (pScaledUpDbm[i-1] > pScaledUpDbm[i]) { in ar5111SetPowerTable()
480 pScaledUpDbm[i - 1] = pScaledUpDbm[i]; in ar5111SetPowerTable()
492 ((minScaledPwr - PWR_MIN + PWR_STEP / 2) / PWR_STEP) + PWR_MIN); in ar5111SetPowerTable()
496 for (i = 0; i < (2 * (pwr - PWR_MIN) / EEP_SCALE + 1); i++) { in ar5111SetPowerTable()
498 ahp->ah_pcdacTable[pcdacTableIndex++] = pcdacMin; in ar5111SetPowerTable()
502 while (pwr < pScaledUpDbm[pcdacStruct.numPcdacValues - 1] && in ar5111SetPowerTable()
506 while (pwr < pScaledUpDbm[pcdacStruct.numPcdacValues - 1] && in ar5111SetPowerTable()
507 (pwr - pScaledUpDbm[i])*(pwr - pScaledUpDbm[i+1]) > 0) in ar5111SetPowerTable()
516 ahp->ah_pcdacTable[pcdacTableIndex] = scaledPcdac / 2; in ar5111SetPowerTable()
517 if (ahp->ah_pcdacTable[pcdacTableIndex] > pcdacMax) in ar5111SetPowerTable()
518 ahp->ah_pcdacTable[pcdacTableIndex] = pcdacMax; in ar5111SetPowerTable()
524 ahp->ah_pcdacTable[pcdacTableIndex] = in ar5111SetPowerTable()
525 ahp->ah_pcdacTable[pcdacTableIndex - 1]; in ar5111SetPowerTable()
530 ahp->ah_txPowerIndexOffset = 0; in ar5111SetPowerTable()
555 pSrcStruct->pChannelList, pSrcStruct->numChannels, in ar5212GetScaledPower()
581 const DATA_PER_CHANNEL *pChannelData = pSrcStruct->pDataPerChannel; in ar5212FindValueInList()
584 for (i = 0; i < pSrcStruct->numChannels; i++ ) { in ar5212FindValueInList()
585 if (pChannelData->channelValue == channel) { in ar5212FindValueInList()
586 const uint16_t* pPcdac = pChannelData->PcdacValues; in ar5212FindValueInList()
589 for (j = 0; j < pChannelData->numPcdacValues; j++ ) { in ar5212FindValueInList()
591 *powerValue = pChannelData->PwrValues[j]; in ar5212FindValueInList()
611 const DATA_PER_CHANNEL *pChannelData = pSrcStruct->pDataPerChannel; in ar5212GetLowerUpperPcdacs()
615 for (i = 0; i < pSrcStruct->numChannels; i++) { in ar5212GetLowerUpperPcdacs()
616 if (pChannelData->channelValue == channel) in ar5212GetLowerUpperPcdacs()
620 ar5212GetLowerUpperValues(pcdac, pChannelData->PcdacValues, in ar5212GetLowerUpperPcdacs()
621 pChannelData->numPcdacValues, in ar5212GetLowerUpperPcdacs()
630 /* XXX - Get 5111 power limits! */ in ar5111GetChannelMaxMinPower()
645 { 5790, 6 }, /* NB: ordered high -> low */ in ar5111GetNfAdjust()
659 for (i = 0; c->channel <= adjust5111[i].freqLow; i++) in ar5111GetNfAdjust()
672 HALASSERT(ahp->ah_rfHal != AH_NULL); in ar5111RfDetach()
673 ath_hal_free(ahp->ah_rfHal); in ar5111RfDetach()
674 ahp->ah_rfHal = AH_NULL; in ar5111RfDetach()
687 HALASSERT(ah->ah_magic == AR5212_MAGIC); in ar5111RfAttach()
689 HALASSERT(ahp->ah_rfHal == AH_NULL); in ar5111RfAttach()
697 priv->base.rfDetach = ar5111RfDetach; in ar5111RfAttach()
698 priv->base.writeRegs = ar5111WriteRegs; in ar5111RfAttach()
699 priv->base.getRfBank = ar5111GetRfBank; in ar5111RfAttach()
700 priv->base.setChannel = ar5111SetChannel; in ar5111RfAttach()
701 priv->base.setRfRegs = ar5111SetRfRegs; in ar5111RfAttach()
702 priv->base.setPowerTable = ar5111SetPowerTable; in ar5111RfAttach()
703 priv->base.getChannelMaxMinPower = ar5111GetChannelMaxMinPower; in ar5111RfAttach()
704 priv->base.getNfAdjust = ar5111GetNfAdjust; in ar5111RfAttach()
706 ahp->ah_pcdacTable = priv->pcdacTable; in ar5111RfAttach()
707 ahp->ah_pcdacTableSize = sizeof(priv->pcdacTable); in ar5111RfAttach()
708 ahp->ah_rfHal = &priv->base; in ar5111RfAttach()