From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [PATCH 4/7] rt2800: use eeprom OFDM 6M TX power as criterion
Date: Fri, 5 Oct 2012 13:44:12 +0200 [thread overview]
Message-ID: <1349437455-18754-4-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1349437455-18754-1-git-send-email-sgruszka@redhat.com>
Don use TX_PWR_CFG_0 register value of OFDM 6M tx power as criterion
since it can be changed. The same do vendor driver (see
AsicAdjustSingleSkuTxPower and AsicGetTxPowerOffset functions from
2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO).
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 57ffbca..e0e641d 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2524,7 +2524,6 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int is_rate_b,
enum ieee80211_band band, int power_level,
u8 txpower, int delta)
{
- u32 reg;
u16 eeprom;
u8 criterion;
u8 eirp_txpower;
@@ -2539,11 +2538,13 @@ static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int is_rate_b,
* .11b data rate need add additional 4dbm
* when calculating eirp txpower.
*/
- rt2800_register_read(rt2x00dev, TX_PWR_CFG_0, ®);
- criterion = rt2x00_get_field32(reg, TX_PWR_CFG_0_6MBS);
+ rt2x00_eeprom_read(rt2x00dev, EEPROM_TXPOWER_BYRATE + 1,
+ &eeprom);
+ criterion = rt2x00_get_field16(eeprom,
+ EEPROM_TXPOWER_BYRATE_RATE0);
- rt2x00_eeprom_read(rt2x00dev,
- EEPROM_EIRP_MAX_TX_POWER, &eeprom);
+ rt2x00_eeprom_read(rt2x00dev, EEPROM_EIRP_MAX_TX_POWER,
+ &eeprom);
if (band == IEEE80211_BAND_2GHZ)
eirp_txpower_criterion = rt2x00_get_field16(eeprom,
--
1.7.1
next prev parent reply other threads:[~2012-10-05 11:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 11:44 [PATCH 1/7] rt2800: use BBP_R1 for setting tx power Stanislaw Gruszka
2012-10-05 11:44 ` [PATCH 2/7] rt2800: limit TX_PWR_CFG_ values to 0xc Stanislaw Gruszka
2012-10-05 11:44 ` [PATCH 3/7] rt2800: compensate tx power also for non 11b rates on 2GHz Stanislaw Gruszka
2012-10-05 11:44 ` Stanislaw Gruszka [this message]
2012-10-05 11:44 ` [PATCH 5/7] rt2800: pass channel pointer to rt2800_config_txpower Stanislaw Gruszka
2012-10-05 11:44 ` [PATCH 6/7] rt2800: allow to reduce tx power on devices not exporting power limit Stanislaw Gruszka
2012-10-05 11:44 ` [PATCH 7/7] rt2800: comment tx power settings Stanislaw Gruszka
2012-10-05 16:27 ` [rt2x00-users] [PATCH 1/7] rt2800: use BBP_R1 for setting tx power Andreas Hartmann
2012-10-08 9:15 ` Stanislaw Gruszka
2012-10-13 6:47 ` Andreas Hartmann
2012-10-13 7:57 ` Stanislaw Gruszka
2012-10-13 9:42 ` Andreas Hartmann
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=1349437455-18754-4-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=users@rt2x00.serialmonkey.com \
/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).