Search Linux Wireless

Re: [PATCH 1/6] ath5k: Always write tx powertable on hw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>

On Fri, Dec 3, 2010 at 5:03 AM, Nick Kossifidis <mickflemm@xxxxxxxxx> wrote:
> Â* By skipping tx power table calibration we also skip setting
> Âtx power table on hw. Make sure we always write tx power table
> Âon hw since it gets cleared on reset.
>
> ÂSigned-off-by: Nick Kossifidis <mickflemm@xxxxxxxxx>
>
> ---
> Âdrivers/net/wireless/ath/ath5k/phy.c | Â 33 +++++++++++++++++++++------------
> Â1 files changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index df5cd0f..f84afb4 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,
>
> Â/* Write PDADC values on hw */
> Âstatic void
> -ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah,
> - Â Â Â Â Â Â Â Â Â Â Â u8 pdcurves, u8 *pdg_to_idx)
> +ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode)
> Â{
> + Â Â Â struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
> Â Â Â Âu8 *pdadc_out = ah->ah_txpower.txp_pd_table;
> + Â Â Â u8 *pdg_to_idx = ee->ee_pdc_to_idx[ee_mode];
> + Â Â Â u8 pdcurves = ee->ee_pd_gains[ee_mode];
> Â Â Â Âu32 reg;
> Â Â Â Âu8 i;
>
> @@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âee->ee_pd_gains[ee_mode]);
>
> Â Â Â Â Â Â Â Â/* Write settings on hw */
> - Â Â Â Â Â Â Â ath5k_setup_pwr_to_pdadc_table(ah, pdg, pdg_curve_to_idx);
> + Â Â Â Â Â Â Â ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
>
> Â Â Â Â Â Â Â Â/* Set txp.offset, note that table_min
> Â Â Â Â Â Â Â Â * can be negative */
> @@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> Â Â Â Â Â Â Â Âreturn -EINVAL;
> Â Â Â Â}
>
> - Â Â Â /* Reset TX power values */
> - Â Â Â memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
> - Â Â Â ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
> - Â Â Â ah->ah_txpower.txp_min_pwr = 0;
> - Â Â Â ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
> -
> Â Â Â Â/* Initialize TX power table */
> Â Â Â Âswitch (ah->ah_radio) {
> Â Â Â Âcase AR5K_RF5110:
> @@ -3146,11 +3142,24 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> Â Â Â Â * so there is no need to recalculate the powertable, we 'll
> Â Â Â Â * just use the cached one */
> Â Â Â Âif (!fast) {
> + Â Â Â Â Â Â Â /* Reset TX power values */
> + Â Â Â Â Â Â Â memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
> + Â Â Â Â Â Â Â ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
> + Â Â Â Â Â Â Â ah->ah_txpower.txp_min_pwr = 0;
> + Â Â Â Â Â Â Â ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
> +
> + Â Â Â Â Â Â Â /* Calculate the powertable */
> Â Â Â Â Â Â Â Âret = ath5k_setup_channel_powertable(ah, channel,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âee_mode, type);
> - Â Â Â Â Â Â Â Â Â Â Â if (ret)
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return ret;
> - Â Â Â }
> + Â Â Â Â Â Â Â if (ret)
> + Â Â Â Â Â Â Â Â Â Â Â return ret;
> + Â Â Â /* Write cached table on hw */
> + Â Â Â } else if (type == AR5K_PWRTABLE_PWR_TO_PDADC)
> + Â Â Â Â Â Â Â ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
> + Â Â Â else
> + Â Â Â Â Â Â Â ath5k_setup_pcdac_table(ah);
> +
> +
>
> Â Â Â Â/* Limit max power if we have a CTL available */
> Â Â Â Âath5k_get_max_ctl_power(ah, channel);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux