linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
To: Nick Kossifidis <mickflemm@gmail.com>
Cc: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
	linville@tuxdriver.com, mcgrof@gmail.com, jirislaby@gmail.com,
	nbd@openwrt.org
Subject: Re: [PATCH 3/4] ath5k: Preserve tx power level requested from above on phy_init
Date: Sat, 28 Jul 2012 17:26:54 +0200	[thread overview]
Message-ID: <501404BE.7040606@net.t-labs.tu-berlin.de> (raw)
In-Reply-To: <1343485971-31360-3-git-send-email-mickflemm@gmail.com>

Hi Nick,

Nick Kossifidis schrieb:

> By using cur_pwr on phy_init we re-use the power level previously set by the
> driver, not the one we got from above.
> 
> Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
> ---
>  drivers/net/wireless/ath/ath5k/phy.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 84a9aaf..27ca993 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -3802,8 +3802,8 @@ ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
>  	 * 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;
>  


I would suggest to initialise the power_level as AR5K_TUNE_MAX_TXPOWER
in base.c funktion ath5k_init(struct ieee80211_hw *hw)

      /* init tx_power setting to maximum */
      ah->ah_txpower.txp_user_pwr = AR5K_TUNE_MAX_TXPOWER;

that would simplify the readability form above into:
	ret = ath5k_hw_txpower(ah, channel, ah->power_level)

What do you think ?

Greetings Thomas

  reply	other threads:[~2012-07-28 15:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-28 14:32 [PATCH 1/4] ath5k: Use correct value for min_pwr and cur_pwr Nick Kossifidis
2012-07-28 14:32 ` [PATCH 2/4] ath5k: Fix range scaling when setting rate power table Nick Kossifidis
2012-07-28 14:32 ` [PATCH 3/4] ath5k: Preserve tx power level requested from above on phy_init Nick Kossifidis
2012-07-28 15:26   ` Thomas Huehn [this message]
2012-07-28 15:33     ` Thomas Huehn
2012-07-28 20:47       ` Nick Kossifidis
2012-07-29 11:11         ` [ath5k-devel] " Thomas Huehn
2012-07-29 20:51           ` Nick Kossifidis
2012-07-30 11:45             ` Thomas Huehn
2012-07-28 14:32 ` [PATCH 4/4] ath5k: Put power_level where it belongs and rename it Nick Kossifidis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=501404BE.7040606@net.t-labs.tu-berlin.de \
    --to=thomas@net.t-labs.tu-berlin.de \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.com \
    --cc=mickflemm@gmail.com \
    --cc=nbd@openwrt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).