Search Linux Wireless

Re: [PATCH 2/5] ath5k: Separate powertable setup and writing

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

 



2010/12/21 Bruno Randolf <br1@xxxxxxxxxxx>:
> And rename functions which write the powertable to make it clearer.
>
> Signed-off-by: Bruno Randolf <br1@xxxxxxxxxxx>
> ---
> Âdrivers/net/wireless/ath/ath5k/phy.c | Â 34 ++++++++++++++++------------------
> Â1 files changed, 16 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 7c6d7dc..6f0cf3a 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -2593,7 +2593,7 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min,
>
> Â/* Write PCDAC values on hw */
> Âstatic void
> -ath5k_setup_pcdac_table(struct ath5k_hw *ah)
> +ath5k_write_pcdac_table(struct ath5k_hw *ah)
> Â{
> Â Â Â Âu8 Â Â Â*pcdac_out = ah->ah_txpower.txp_pd_table;
>    Âint   i;
> @@ -2742,7 +2742,7 @@ 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 ee_mode)
> +ath5k_write_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;
> @@ -2957,8 +2957,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â(s16) pcinfo_R->freq,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âpcinfo_L->max_pwr, pcinfo_R->max_pwr);
>
> - Â Â Â /* We are ready to go, fill PCDAC/PDADC
> - Â Â Â Â* table and write settings on hardware */
> + Â Â Â /* Fill PCDAC/PDADC table */
> Â Â Â Âswitch (type) {
> Â Â Â Âcase AR5K_PWRTABLE_LINEAR_PCDAC:
> Â Â Â Â Â Â Â Â/* For RF5112 we can have one or two curves
> @@ -2971,9 +2970,6 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Â Â Â Â Â * match max power value with max
> Â Â Â Â Â Â Â Â * table index */
> Â Â Â Â Â Â Â Âah->ah_txpower.txp_offset = 64 - (table_max[0] / 2);
> -
> - Â Â Â Â Â Â Â /* Write settings on hw */
> - Â Â Â Â Â Â Â ath5k_setup_pcdac_table(ah);
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase AR5K_PWRTABLE_PWR_TO_PCDAC:
> Â Â Â Â Â Â Â Â/* We are done for RF5111 since it has only
> @@ -2983,9 +2979,6 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Â Â Â Â Â/* No rate powertable adjustment for RF5111 */
> Â Â Â Â Â Â Â Âah->ah_txpower.txp_min_idx = 0;
> Â Â Â Â Â Â Â Âah->ah_txpower.txp_offset = 0;
> -
> - Â Â Â Â Â Â Â /* Write settings on hw */
> - Â Â Â Â Â Â Â ath5k_setup_pcdac_table(ah);
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase AR5K_PWRTABLE_PWR_TO_PDADC:
> Â Â Â Â Â Â Â Â/* Set PDADC boundaries and fill
> @@ -2993,9 +2986,6 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Â Â Â Â Âath5k_combine_pwr_to_pdadc_curves(ah, table_min, table_max,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âee->ee_pd_gains[ee_mode]);
>
> - Â Â Â Â Â Â Â /* Write settings on hw */
> - Â Â Â Â Â Â Â ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
> -
> Â Â Â Â Â Â Â Â/* Set txp.offset, note that table_min
> Â Â Â Â Â Â Â Â * can be negative */
> Â Â Â Â Â Â Â Âah->ah_txpower.txp_offset = table_min[0];
> @@ -3009,6 +2999,15 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
> Â Â Â Âreturn 0;
> Â}
>
> +/* Write power table for current channel to hw */
> +static void
> +ath5k_write_channel_powertable(struct ath5k_hw *ah, u8 ee_mode, u8 type)
> +{
> + Â Â Â if (type == AR5K_PWRTABLE_PWR_TO_PDADC)
> + Â Â Â Â Â Â Â ath5k_write_pwr_to_pdadc_table(ah, ee_mode);
> + Â Â Â else
> + Â Â Â Â Â Â Â ath5k_write_pcdac_table(ah);
> +}
>
> Â/*
> Â* Per-rate tx power setting
> @@ -3159,11 +3158,10 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âee_mode, type);
> Â Â Â Â Â Â Â Â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);
> + Â Â Â }
> +
> + Â Â Â /* Write table on hw */
> + Â Â Â ath5k_write_channel_powertable(ah, ee_mode, type);
>
> Â Â Â Â/* Limit max power if we have a CTL available */
> Â Â Â Âath5k_get_max_ctl_power(ah, channel);
>
>

Acked-by: Nick Kossifidis <mickflemm@xxxxxxxxx>

-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
--
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