Search Linux Wireless

Re: [ath5k-devel] [PATCH 2/2] ath5k: fix phy_init() to respect user txpower changes

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

 



Hi Nick,

Nick Kossifidis schrieb:

> I think this is a better approach (I'll prepare a proper patch as soon
> as I have some bandwidth to work with wireless-testing, maybe
> tomorrow)...
> 
> --- old/phy.c	2012-07-26 20:40:00.869150187 +0300
> +++ new/phy.c	2012-07-26 20:43:25.074710577 +0300
> @@ -3562,6 +3562,12 @@
>  		for (i = 8; i <= 15; i++)
>  			rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta;
> 
> +
> +	/* Min/max in 0.25dB units */
> +	ah->ah_txpower.txp_min_pwr = 2 * rates[7];
> +	ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
> +	ah->ah_txpower.txp_ofdm = rates[7];
> +
>  	/* Now that we have all rates setup use table offset to
>  	 * match the power range set by user with the power indices
>  	 * on PCDAC/PDADC table */
> @@ -3571,11 +3577,6 @@
>  		if (rates[i] > 63)
>  			rates[i] = 63;
>  	}
> -
> -	/* Min/max in 0.25dB units */
> -	ah->ah_txpower.txp_min_pwr = 2 * rates[7];
> -	ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
> -	ah->ah_txpower.txp_ofdm = rates[7];
>  }
> 

> @@ -3789,8 +3790,8 @@
>  	 * RF buffer settings on 5211/5212+ so that we
>  	 * properly set curve indices.
>  	 */
> -	ret = ath5k_hw_txpower(ah, channel, ah->ah_txpower.txp_cur_pwr ?
> -			ah->ah_txpower.txp_cur_pwr / 2 : AR5K_TUNE_MAX_TXPOWER);
> +	ret = ath5k_hw_txpower(ah, channel, ah->power_level ?
> +			ah->power_level * 2 : AR5K_TUNE_MAX_TXPOWER);
>  	if (ret)
>  		return ret;
> 
> Works for you ?

works as well.

There are now 2 unused variables as left over:
ah->ah_txpower.txp_cur_pwr
ah->ah_txpower.txp_min_pwr

Do we need them anymore to check for hw chan limit ?

> BTW is there a way to pass the actual tx power set back to
> mac80211/cfg80211 so that user knows what power his card is actually
> transmitting at ?
 

I think that on point of the todo list.

Greetings Thomas
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux