Lines Matching +full:data +full:- +full:channel
1 /*-
2 * SPDX-License-Identifier: ISC
4 * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
39 #define AR9287(ah) ((struct ar9287State *) AH5212(ah)->ah_rfHal)
49 (void) ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_bb_rfgain, in ar9287WriteRegs()
54 * Take the MHz channel value and set the Channel value
60 * For 2GHz channel,
61 * Channel Frequency = (3/4) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
64 * For 5GHz channel,
65 * Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^10)
69 * Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
80 OS_MARK(ah, AH_MARK_SETCHANNEL, chan->ic_freq); in ar9287SetChannel()
100 &AH9287(ah)->ah_ini_cckFirJapan2484, 1, in ar9287SetChannel()
104 &AH9287(ah)->ah_ini_cckFirNormal, 1, in ar9287SetChannel()
111 /* Enable channel spreading for channel 14 */ in ar9287SetChannel()
153 AH_PRIVATE(ah)->ah_curchan = chan; in ar9287SetChannel()
182 * Interpolate read transmit power values for this channel
195 ar9287GetMinPower(struct ath_hal *ah, EXPN_DATA_PER_CHANNEL_5112 *data)
201 minGain = data->pDataPerXPD[0].xpd_gain;
203 if (data->pDataPerXPD[i].xpd_gain < minGain) {
205 minGain = data->pDataPerXPD[i].xpd_gain;
208 minPwr = data->pDataPerXPD[minIndex].pwr_t4[0];
209 minPcdac = data->pDataPerXPD[minIndex].pcdac[0];
211 if (data->pDataPerXPD[minIndex].pwr_t4[i] < minPwr) {
212 minPwr = data->pDataPerXPD[minIndex].pwr_t4[i];
213 minPcdac = data->pDataPerXPD[minIndex].pcdac[i];
216 retVal = minPwr - (minPcdac*2);
230 EXPN_DATA_PER_CHANNEL_5112 *data=AH_NULL; in ar9287GetChannelMaxMinPower()
235 powerArray = ahp->ah_modePowerArray5112; in ar9287GetChannelMaxMinPower()
236 data = powerArray[headerInfo11A].pDataPerChannel; in ar9287GetChannelMaxMinPower()
239 /* XXX - is this correct? Should we also use the same power for turbo G? */ in ar9287GetChannelMaxMinPower()
240 powerArray = ahp->ah_modePowerArray5112; in ar9287GetChannelMaxMinPower()
241 data = powerArray[headerInfo11G].pDataPerChannel; in ar9287GetChannelMaxMinPower()
244 powerArray = ahp->ah_modePowerArray5112; in ar9287GetChannelMaxMinPower()
245 data = powerArray[headerInfo11B].pDataPerChannel; in ar9287GetChannelMaxMinPower()
250 /* Make sure the channel is in the range of the TP values in ar9287GetChannelMaxMinPower()
254 (chan->channel < data[0].channelValue) || in ar9287GetChannelMaxMinPower()
255 (chan->channel > data[numChannels-1].channelValue)) in ar9287GetChannelMaxMinPower()
260 (i<numChannels) && (chan->channel > data[i].channelValue); in ar9287GetChannelMaxMinPower()
262 totalD = data[i].channelValue - data[last].channelValue; in ar9287GetChannelMaxMinPower()
264 totalF = data[i].maxPower_t4 - data[last].maxPower_t4; in ar9287GetChannelMaxMinPower()
265 …*maxPow = (int8_t) ((totalF*(chan->channel-data[last].channelValue) + data[last].maxPower_t4*total… in ar9287GetChannelMaxMinPower()
267 totalMin = ar9287GetMinPower(ah,&data[i]) - ar9287GetMinPower(ah, &data[last]); in ar9287GetChannelMaxMinPower()
268 …*minPow = (int8_t) ((totalMin*(chan->channel-data[last].channelValue) + ar9287GetMinPower(ah, &dat… in ar9287GetChannelMaxMinPower()
271 if (chan->channel == data[i].channelValue) { in ar9287GetChannelMaxMinPower()
272 *maxPow = data[i].maxPower_t4; in ar9287GetChannelMaxMinPower()
273 *minPow = ar9287GetMinPower(ah, &data[i]); in ar9287GetChannelMaxMinPower()
301 nf = 0 - ((nf ^ 0x1ff) + 1); in ar9287GetNoiseFloor()
308 nf = 0 - ((nf ^ 0x1ff) + 1); in ar9287GetNoiseFloor()
315 nf = 0 - ((nf ^ 0x1ff) + 1); in ar9287GetNoiseFloor()
322 nf = 0 - ((nf ^ 0x1ff) + 1); in ar9287GetNoiseFloor()
327 /* Chain 2 - invalid */ in ar9287GetNoiseFloor()
351 HALASSERT(ahp->ah_rfHal != AH_NULL); in ar9287RfDetach()
352 ath_hal_free(ahp->ah_rfHal); in ar9287RfDetach()
353 ahp->ah_rfHal = AH_NULL; in ar9287RfDetach()
364 HALASSERT(ahp->ah_rfHal == AH_NULL); in ar9287RfAttach()
372 priv->base.rfDetach = ar9287RfDetach; in ar9287RfAttach()
373 priv->base.writeRegs = ar9287WriteRegs; in ar9287RfAttach()
374 priv->base.getRfBank = ar9287GetRfBank; in ar9287RfAttach()
375 priv->base.setChannel = ar9287SetChannel; in ar9287RfAttach()
376 priv->base.setRfRegs = ar9287SetRfRegs; in ar9287RfAttach()
377 priv->base.setPowerTable = ar9287SetPowerTable; in ar9287RfAttach()
378 priv->base.getChannelMaxMinPower = ar9287GetChannelMaxMinPower; in ar9287RfAttach()
379 priv->base.getNfAdjust = ar9287GetNfAdjust; in ar9287RfAttach()
381 ahp->ah_pcdacTable = priv->pcdacTable; in ar9287RfAttach()
382 ahp->ah_pcdacTableSize = sizeof(priv->pcdacTable); in ar9287RfAttach()
383 ahp->ah_rfHal = &priv->base; in ar9287RfAttach()
388 AH_PRIVATE(ah)->ah_getNfAdjust = priv->base.getNfAdjust; in ar9287RfAttach()
389 AH_PRIVATE(ah)->ah_getNoiseFloor = ar9287GetNoiseFloor; in ar9287RfAttach()