sys/dev/netif/ath/hal/ath_hal/ar5416/ar5416_reset.c
static uint16_t
ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz)
{
    uint16_t twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
    int      i;

    /* Get the edge power */
    for (i = 0; (i < AR5416_NUM_BAND_EDGES) && (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED) ; i++) {
        /*
         * If there's an exact channel match or an inband flag set
         * on the lower channel use the given rdEdgePower
         */
        if (freq == fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) {
            twiceMaxEdgePower = MS(pRdEdgesPower[i].tPowerFlag, CAL_CTL_EDGES_POWER);
            break;
        } else if ((i > 0) && (freq < fbin2freq(pRdEdgesPower[i].bChannel, is2GHz))) {
            if (fbin2freq(pRdEdgesPower[i - 1].bChannel, is2GHz) < freq && (pRdEdgesPower[i - 1].tPowerFlag & CAL_CTL_EDGES_FLAG) != 0) {
                twiceMaxEdgePower = MS(pRdEdgesPower[i - 1].tPowerFlag, CAL_CTL_EDGES_POWER);
            }
            /* Leave loop - no more affecting edges possible in this monotonic increasing list */
            break;
        }
    }
    HALASSERT(twiceMaxEdgePower > 0);
    return twiceMaxEdgePower;
}
/*
 * ar5416GetMaxEdgePower
 *
 * Find the maximum conformance test limit for the given channel and CTL info
 */
ar5416GetMaxEdgePower
Find the maximum conformance test limit for the given channel and CTL info
ar5416GetMaxEdgePower Find the maximum conformance test limit for the given channel and CTL info
static uint16_t
ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz)
{
    uint16_t twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
    int      i;
    for (i = 0; (i < AR5416_NUM_BAND_EDGES) && (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED) ; i++) {
        if (freq == fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) {
            twiceMaxEdgePower = MS(pRdEdgesPower[i].tPowerFlag, CAL_CTL_EDGES_POWER);
            break;
        } else if ((i > 0) && (freq < fbin2freq(pRdEdgesPower[i].bChannel, is2GHz))) {
            if (fbin2freq(pRdEdgesPower[i - 1].bChannel, is2GHz) < freq && (pRdEdgesPower[i - 1].tPowerFlag & CAL_CTL_EDGES_FLAG) != 0) {
                twiceMaxEdgePower = MS(pRdEdgesPower[i - 1].tPowerFlag, CAL_CTL_EDGES_POWER);
            }
            break;
        }
    }
    HALASSERT(twiceMaxEdgePower > 0);
    return twiceMaxEdgePower;
}
static uint16_t ar5416GetMaxEdgePower ( uint16_t freq , CAL_CTL_EDGES * pRdEdgesPower , HAL_BOOL is2GHz ) { uint16_t twiceMaxEdgePower = AR5416_MAX_RATE_POWER ; int i ; for ( i = 0 ; ( i < AR5416_NUM_BAND_EDGES ) && ( pRdEdgesPower [ i ] . bChannel != AR5416_BCHAN_UNUSED ) ; i ++ ) { if ( freq == fbin2freq ( pRdEdgesPower [ i ] . bChannel , is2GHz ) ) { twiceMaxEdgePower = MS ( pRdEdgesPower [ i ] . tPowerFlag , CAL_CTL_EDGES_POWER ) ; break ; } else if ( ( i > 0 ) && ( freq < fbin2freq ( pRdEdgesPower [ i ] . bChannel , is2GHz ) ) ) { if ( fbin2freq ( pRdEdgesPower [ i - 1 ] . bChannel , is2GHz ) < freq && ( pRdEdgesPower [ i - 1 ] . tPowerFlag & CAL_CTL_EDGES_FLAG ) != 0 ) { twiceMaxEdgePower = MS ( pRdEdgesPower [ i - 1 ] . tPowerFlag , CAL_CTL_EDGES_POWER ) ; } break ; } } HALASSERT ( twiceMaxEdgePower > 0 ) ; return twiceMaxEdgePower ; }
ar5416GetMaxEdgePower
 Find the maximum conformance test limit for the given channel and CTL info
ar5416GetMaxEdgePower Find the maximum conformance test limit for the given channel and CTL info
/* Get the edge power */ /*
         * If there's an exact channel match or an inband flag set
         * on the lower channel use the given rdEdgePower
         */ /* Leave loop - no more affecting edges possible in this monotonic increasing list */