linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Felix Fietkau <nbd@openwrt.org>
Subject: [PATCH 09/13] ath9k_hw: use the configured power limit for AR9003
Date: Mon, 26 Apr 2010 15:04:37 -0400	[thread overview]
Message-ID: <1272308681-32396-10-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1272308681-32396-1-git-send-email-lrodriguez@atheros.com>

From: Felix Fietkau <nbd@openwrt.org>

Since the new AR9003 EEPROM code does tune the card for the configured
tx power level, we need to fill in the correct power limits in the TPC
part of the DMA descriptor.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |    1 +
 drivers/net/wireless/ath/ath9k/ar9003_mac.c    |    3 +++
 drivers/net/wireless/ath/ath9k/hw.h            |    1 +
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 5d92be4..79b0e28 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -1817,6 +1817,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
 					u8 twiceMaxRegulatoryPower,
 					u8 powerLimit)
 {
+	ah->txpower_limit = powerLimit;
 	ar9003_hw_set_target_power_eeprom(ah, chan->channel);
 	ar9003_hw_calibration_apply(ah, chan->channel);
 }
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 7d111fb..37ba374 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -311,6 +311,9 @@ static void ar9003_hw_set11n_txdesc(struct ath_hw *ah, void *ds,
 {
 	struct ar9003_txc *ads = (struct ar9003_txc *) ds;
 
+	if (txpower > ah->txpower_limit)
+		txpower = ah->txpower_limit;
+
 	txpower += ah->txpower_indexoffset;
 	if (txpower > 63)
 		txpower = 63;
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index bc682da..77245df 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -719,6 +719,7 @@ struct ath_hw {
 	u32 *addac5416_21;
 	u32 *bank6Temp;
 
+	u8 txpower_limit;
 	int16_t txpower_indexoffset;
 	int coverage_class;
 	u32 beacon_interval;
-- 
1.6.3.3


  parent reply	other threads:[~2010-04-26 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 19:04 [PATCH 00/13] ath9k/ath9k_hw: AR9003 fixes for April Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 01/13] ath9k_hw: update initvals for AR9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 02/13] ath9k_hw: fix pll clock setting for 5ghz on AR9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 03/13] ath9k_hw: fix typo in the AR9003 EEPROM data structure definition Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 04/13] ath9k_hw: disable TX IQ calibration for AR9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 05/13] ath9k_hw: Fix usec to hw clock conversion in 5Ghz for ar9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 06/13] ath9k_hw: update EEPROM data structure for AR9280 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 07/13] ath9k_hw: fix fast clock handling for 5GHz channels Luis R. Rodriguez
2011-02-08 12:46   ` Jorge Boncompte [DTI2]
2010-04-26 19:04 ` [PATCH 08/13] ath9k: wake queue after processing edma rx frames Luis R. Rodriguez
2010-04-26 19:04 ` Luis R. Rodriguez [this message]
2010-04-26 19:04 ` [PATCH 10/13] ath9k_hw: Fix typos in tx rate power level parsing for AR9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 11/13] ath9k_hw: Fix endian bug in an AR9003 EEPROM field Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 12/13] ath9k_hw: fix noisefloor timeout handling on AR9003 Luis R. Rodriguez
2010-04-26 19:04 ` [PATCH 13/13] ath9k_hw: Fix TX interrupt mitigation settings Luis R. Rodriguez

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=1272308681-32396-10-git-send-email-lrodriguez@atheros.com \
    --to=lrodriguez@atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).