From: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
To: Nick Kossifidis <mickflemm@gmail.com>
Cc: Felix Fietkau <nbd@openwrt.org>,
jirislaby@gmail.com, johannes.berg@intel.com,
ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
linville@tuxdriver.com
Subject: Re: [ath5k-devel] [PATCH 2/2] ath5k: fix phy_init() to respect user txpower changes
Date: Thu, 26 Jul 2012 22:56:44 +0200 [thread overview]
Message-ID: <5011AF0C.9080304@net.t-labs.tu-berlin.de> (raw)
In-Reply-To: <CAFtRNNyP69cHcEscH8eeHcL9WW2-qrxKBa=5zmmmbnORTGFNXA@mail.gmail.com>
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
next prev parent reply other threads:[~2012-07-26 20:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 16:01 [PATCH 0/2] ath5k: fixing broken power gain calibration at 5GHz and txpower handling Thomas Huehn
2012-07-23 16:01 ` [PATCH 1/2] ath5k: fix wrong per rate target power eeprom reads for AR5K_EEPROM_MODE_11A Thomas Huehn
2012-07-25 18:42 ` Nick Kossifidis
2012-07-25 18:55 ` Felix Fietkau
2012-07-25 22:22 ` Nick Kossifidis
2012-07-25 22:01 ` [ath5k-devel] " Thomas Huehn
2012-07-25 22:31 ` Nick Kossifidis
2012-08-04 8:14 ` Thomas Huehn
2012-08-04 15:28 ` Nick Kossifidis
2012-08-05 11:06 ` Thomas Huehn
2012-08-05 11:56 ` Nick Kossifidis
2012-08-05 12:37 ` Thomas Huehn
2012-08-05 12:59 ` Nick Kossifidis
2012-08-05 18:26 ` Nick Kossifidis
2012-07-23 16:01 ` [PATCH 2/2] ath5k: fix phy_init() to respect user txpower changes Thomas Huehn
2012-07-23 16:42 ` [ath5k-devel] " Bob Copeland
2012-07-23 18:25 ` Thomas Huehn
2012-07-23 18:29 ` Thomas Huehn
2012-07-23 19:20 ` Bob Copeland
2012-07-25 19:22 ` Nick Kossifidis
2012-07-25 23:07 ` Thomas Huehn
2012-07-25 23:23 ` Nick Kossifidis
2012-07-25 23:40 ` [ath5k-devel] " Thomas Huehn
2012-07-26 10:20 ` Nick Kossifidis
2012-07-26 10:28 ` Felix Fietkau
2012-07-26 10:31 ` Nick Kossifidis
2012-07-26 10:41 ` Felix Fietkau
2012-07-26 17:48 ` Nick Kossifidis
2012-07-26 20:56 ` Thomas Huehn [this message]
2012-07-28 11:45 ` 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=5011AF0C.9080304@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=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).