u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit, u8 antenna_reduction) { u16 reduction = antenna_reduction; /* * Reduce scaled Power by number of chains active * to get the per chain tx power level. */ switch (ar5416_get_ntxchains(ah->txchainmask)) { case 1: break; case 2: reduction += POWER_CORRECTION_FOR_TWO_CHAIN; break; case 3: reduction += POWER_CORRECTION_FOR_THREE_CHAIN; break; } if (power_limit > reduction) power_limit -= reduction; else power_limit = 0; return power_limit; }
void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); switch (ar5416_get_ntxchains(ah->txchainmask)) { case 1: break; case 2: regulatory->max_power_level += POWER_CORRECTION_FOR_TWO_CHAIN; break; case 3: regulatory->max_power_level += POWER_CORRECTION_FOR_THREE_CHAIN; break; default: ath_dbg(common, EEPROM, "Invalid chainmask configuration\n"); break; } }
void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); switch (ar5416_get_ntxchains(ah->txchainmask)) { case 1: break; case 2: regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN; break; case 3: regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; break; default: ath_print(common, ATH_DBG_EEPROM, "Invalid chainmask configuration\n"); break; } }