Lines Matching full:i
55 u16 i; in ath9k_hw_get_lower_upper_index() local
66 for (i = 0; i < listSize - 1; i++) { in ath9k_hw_get_lower_upper_index()
67 if (pList[i] == target) { in ath9k_hw_get_lower_upper_index()
68 *indexL = *indexR = i; in ath9k_hw_get_lower_upper_index()
71 if (target < pList[i + 1]) { in ath9k_hw_get_lower_upper_index()
72 *indexL = i; in ath9k_hw_get_lower_upper_index()
73 *indexR = (u16) (i + 1); in ath9k_hw_get_lower_upper_index()
83 int i = 0, j, addr; in ath9k_hw_usb_gen_fill_eeprom() local
88 addrdata[i] = AR5416_EEPROM_OFFSET + in ath9k_hw_usb_gen_fill_eeprom()
90 i++; in ath9k_hw_usb_gen_fill_eeprom()
91 if (i == 8) { in ath9k_hw_usb_gen_fill_eeprom()
92 REG_READ_MULTI(ah, addrdata, data, i); in ath9k_hw_usb_gen_fill_eeprom()
94 for (j = 0; j < i; j++) { in ath9k_hw_usb_gen_fill_eeprom()
98 i = 0; in ath9k_hw_usb_gen_fill_eeprom()
102 if (i != 0) { in ath9k_hw_usb_gen_fill_eeprom()
103 REG_READ_MULTI(ah, addrdata, data, i); in ath9k_hw_usb_gen_fill_eeprom()
105 for (j = 0; j < i; j++) { in ath9k_hw_usb_gen_fill_eeprom()
172 int i; in ath9k_hw_nvram_swap_data() local
204 for (i = 0; i < size; i++) in ath9k_hw_nvram_swap_data()
205 eepdata[i] = swab16(eepdata[i]); in ath9k_hw_nvram_swap_data()
222 u32 i, sum = 0; in ath9k_hw_nvram_validate_checksum() local
226 for (i = 0; i < size; i++) in ath9k_hw_nvram_validate_checksum()
227 sum ^= eepdata[i]; in ath9k_hw_nvram_validate_checksum()
256 u16 i, k; in ath9k_hw_fill_vpd_table() local
260 for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) { in ath9k_hw_fill_vpd_table()
274 pRetVpdList[i] = (u8) k; in ath9k_hw_fill_vpd_table()
288 int i; in ath9k_hw_get_legacy_target_powers() local
299 for (i = 0; (i < numChannels) && in ath9k_hw_get_legacy_target_powers()
300 (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) { in ath9k_hw_get_legacy_target_powers()
301 if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel, in ath9k_hw_get_legacy_target_powers()
303 matchIndex = i; in ath9k_hw_get_legacy_target_powers()
305 } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, in ath9k_hw_get_legacy_target_powers()
306 IS_CHAN_2GHZ(chan)) && i > 0 && in ath9k_hw_get_legacy_target_powers()
307 freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, in ath9k_hw_get_legacy_target_powers()
309 lowIndex = i - 1; in ath9k_hw_get_legacy_target_powers()
314 matchIndex = i - 1; in ath9k_hw_get_legacy_target_powers()
325 for (i = 0; i < numRates; i++) { in ath9k_hw_get_legacy_target_powers()
326 pNewPower->tPow2x[i] = in ath9k_hw_get_legacy_target_powers()
328 powInfo[lowIndex].tPow2x[i], in ath9k_hw_get_legacy_target_powers()
329 powInfo[lowIndex + 1].tPow2x[i]); in ath9k_hw_get_legacy_target_powers()
343 int i; in ath9k_hw_get_target_powers() local
353 for (i = 0; (i < numChannels) && in ath9k_hw_get_target_powers()
354 (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) { in ath9k_hw_get_target_powers()
355 if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel, in ath9k_hw_get_target_powers()
357 matchIndex = i; in ath9k_hw_get_target_powers()
360 if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, in ath9k_hw_get_target_powers()
361 IS_CHAN_2GHZ(chan)) && i > 0 && in ath9k_hw_get_target_powers()
362 freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, in ath9k_hw_get_target_powers()
364 lowIndex = i - 1; in ath9k_hw_get_target_powers()
369 matchIndex = i - 1; in ath9k_hw_get_target_powers()
380 for (i = 0; i < numRates; i++) { in ath9k_hw_get_target_powers()
381 pNewPower->tPow2x[i] = (u8)ath9k_hw_interpolate(freq, in ath9k_hw_get_target_powers()
383 powInfo[lowIndex].tPow2x[i], in ath9k_hw_get_target_powers()
384 powInfo[lowIndex + 1].tPow2x[i]); in ath9k_hw_get_target_powers()
393 int i; in ath9k_hw_get_max_edge_power() local
395 for (i = 0; (i < num_band_edges) && in ath9k_hw_get_max_edge_power()
396 (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { in ath9k_hw_get_max_edge_power()
397 if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { in ath9k_hw_get_max_edge_power()
398 twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl); in ath9k_hw_get_max_edge_power()
400 } else if ((i > 0) && in ath9k_hw_get_max_edge_power()
401 (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, in ath9k_hw_get_max_edge_power()
403 if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, in ath9k_hw_get_max_edge_power()
405 CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) { in ath9k_hw_get_max_edge_power()
407 CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl); in ath9k_hw_get_max_edge_power()
472 int i, j, k; in ath9k_hw_get_gain_boundaries_pdadcs() local
517 for (i = 0; i < numXpdGains; i++) { in ath9k_hw_get_gain_boundaries_pdadcs()
518 minPwrT4[i] = data_9287[idxL].pwrPdg[i][0]; in ath9k_hw_get_gain_boundaries_pdadcs()
519 maxPwrT4[i] = data_9287[idxL].pwrPdg[i][intercepts - 1]; in ath9k_hw_get_gain_boundaries_pdadcs()
520 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], in ath9k_hw_get_gain_boundaries_pdadcs()
521 data_9287[idxL].pwrPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
522 data_9287[idxL].vpdPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
524 vpdTableI[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
527 for (i = 0; i < numXpdGains; i++) { in ath9k_hw_get_gain_boundaries_pdadcs()
528 minPwrT4[i] = data_4k[idxL].pwrPdg[i][0]; in ath9k_hw_get_gain_boundaries_pdadcs()
529 maxPwrT4[i] = data_4k[idxL].pwrPdg[i][intercepts - 1]; in ath9k_hw_get_gain_boundaries_pdadcs()
530 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], in ath9k_hw_get_gain_boundaries_pdadcs()
531 data_4k[idxL].pwrPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
532 data_4k[idxL].vpdPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
534 vpdTableI[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
537 for (i = 0; i < numXpdGains; i++) { in ath9k_hw_get_gain_boundaries_pdadcs()
538 minPwrT4[i] = data_def[idxL].pwrPdg[i][0]; in ath9k_hw_get_gain_boundaries_pdadcs()
539 maxPwrT4[i] = data_def[idxL].pwrPdg[i][intercepts - 1]; in ath9k_hw_get_gain_boundaries_pdadcs()
540 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], in ath9k_hw_get_gain_boundaries_pdadcs()
541 data_def[idxL].pwrPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
542 data_def[idxL].vpdPdg[i], in ath9k_hw_get_gain_boundaries_pdadcs()
544 vpdTableI[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
548 for (i = 0; i < numXpdGains; i++) { in ath9k_hw_get_gain_boundaries_pdadcs()
550 pVpdL = data_9287[idxL].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
551 pPwrL = data_9287[idxL].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
552 pVpdR = data_9287[idxR].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
553 pPwrR = data_9287[idxR].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
555 pVpdL = data_4k[idxL].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
556 pPwrL = data_4k[idxL].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
557 pVpdR = data_4k[idxR].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
558 pPwrR = data_4k[idxR].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
560 pVpdL = data_def[idxL].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
561 pPwrL = data_def[idxL].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
562 pVpdR = data_def[idxR].vpdPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
563 pPwrR = data_def[idxR].pwrPdg[i]; in ath9k_hw_get_gain_boundaries_pdadcs()
566 minPwrT4[i] = max(pPwrL[0], pPwrR[0]); in ath9k_hw_get_gain_boundaries_pdadcs()
568 maxPwrT4[i] = in ath9k_hw_get_gain_boundaries_pdadcs()
573 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], in ath9k_hw_get_gain_boundaries_pdadcs()
576 vpdTableL[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
577 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], in ath9k_hw_get_gain_boundaries_pdadcs()
580 vpdTableR[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
582 for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) { in ath9k_hw_get_gain_boundaries_pdadcs()
583 vpdTableI[i][j] = in ath9k_hw_get_gain_boundaries_pdadcs()
590 vpdTableL[i][j], vpdTableR[i][j])); in ath9k_hw_get_gain_boundaries_pdadcs()
597 for (i = 0; i < numXpdGains; i++) { in ath9k_hw_get_gain_boundaries_pdadcs()
598 if (i == (numXpdGains - 1)) in ath9k_hw_get_gain_boundaries_pdadcs()
599 pPdGainBoundaries[i] = in ath9k_hw_get_gain_boundaries_pdadcs()
600 (u16)(maxPwrT4[i] / 2); in ath9k_hw_get_gain_boundaries_pdadcs()
602 pPdGainBoundaries[i] = in ath9k_hw_get_gain_boundaries_pdadcs()
603 (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4); in ath9k_hw_get_gain_boundaries_pdadcs()
605 pPdGainBoundaries[i] = in ath9k_hw_get_gain_boundaries_pdadcs()
606 min((u16)MAX_RATE_POWER, pPdGainBoundaries[i]); in ath9k_hw_get_gain_boundaries_pdadcs()
610 if (i == 0) { in ath9k_hw_get_gain_boundaries_pdadcs()
612 ss = (int16_t)(0 - (minPwrT4[i] / 2)); in ath9k_hw_get_gain_boundaries_pdadcs()
616 ss = (int16_t)((pPdGainBoundaries[i - 1] - in ath9k_hw_get_gain_boundaries_pdadcs()
617 (minPwrT4[i] / 2)) - in ath9k_hw_get_gain_boundaries_pdadcs()
620 vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]); in ath9k_hw_get_gain_boundaries_pdadcs()
624 tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep); in ath9k_hw_get_gain_boundaries_pdadcs()
629 sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1); in ath9k_hw_get_gain_boundaries_pdadcs()
630 tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap - in ath9k_hw_get_gain_boundaries_pdadcs()
631 (minPwrT4[i] / 2)); in ath9k_hw_get_gain_boundaries_pdadcs()
636 pPDADCValues[k++] = vpdTableI[i][ss++]; in ath9k_hw_get_gain_boundaries_pdadcs()
639 vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] - in ath9k_hw_get_gain_boundaries_pdadcs()
640 vpdTableI[i][sizeCurrVpdTable - 2]); in ath9k_hw_get_gain_boundaries_pdadcs()
646 tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + in ath9k_hw_get_gain_boundaries_pdadcs()
658 pdgain_boundary_default = pPdGainBoundaries[i - 1]; in ath9k_hw_get_gain_boundaries_pdadcs()
660 while (i < AR5416_PD_GAINS_IN_MASK) { in ath9k_hw_get_gain_boundaries_pdadcs()
661 pPdGainBoundaries[i] = pdgain_boundary_default; in ath9k_hw_get_gain_boundaries_pdadcs()
662 i++; in ath9k_hw_get_gain_boundaries_pdadcs()