linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
To: linville@tuxdriver.com
Cc: jirislaby@gmail.com, mickflemm@gmail.com,
	mcgrof@qca.qualcomm.com, ath5k-devel@lists.ath5k.org,
	linux-wireless@vger.kernel.org, johannes.berg@intel.com,
	thomas@net.t-labs.tu-berlin.de, nbd@nbd.name
Subject: [PATCH 1/2] ath5k: fix wrong per rate target power eeprom reads for AR5K_EEPROM_MODE_11A
Date: Mon, 23 Jul 2012 18:01:14 +0200	[thread overview]
Message-ID: <1343059275-49590-2-git-send-email-thomas@net.t-labs.tu-berlin.de> (raw)
In-Reply-To: <1343059275-49590-1-git-send-email-thomas@net.t-labs.tu-berlin.de>

This patch reduces the per rate target power eeprom reads for
AR5K_EEPROM_MODE_11A from 10 to 8, as there are only 8 valid
power curve entries on the eeprom. The former 10 reads lead to
wrong per rate power limits where rates above 24MBit could be
amplified with to high distortion leading to bad performance.
This was fix validated against the madwifi codebase and a new
AR5K_EEPROM_N_5GHZ_RATE_CHAN 8 is defined.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
madwifi cross validation check. Thx to Felix Fiethkau
---
 drivers/net/wireless/ath/ath5k/eeprom.c | 2 +-
 drivers/net/wireless/ath/ath5k/eeprom.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 4026c90..b7e0258 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -1482,7 +1482,7 @@ ath5k_eeprom_read_target_rate_pwr_info(struct ath5k_hw *ah, unsigned int mode)
 	case AR5K_EEPROM_MODE_11A:
 		offset += AR5K_EEPROM_TARGET_PWR_OFF_11A(ee->ee_version);
 		rate_pcal_info = ee->ee_rate_tpwr_a;
-		ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_CHAN;
+		ee->ee_rate_target_pwr_num[mode] = AR5K_EEPROM_N_5GHZ_RATE_CHAN;
 		break;
 	case AR5K_EEPROM_MODE_11B:
 		offset += AR5K_EEPROM_TARGET_PWR_OFF_11B(ee->ee_version);
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h
index dc2bcfe..94a9bbe 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.h
+++ b/drivers/net/wireless/ath/ath5k/eeprom.h
@@ -182,6 +182,7 @@
 #define AR5K_EEPROM_EEP_DELTA		10
 #define AR5K_EEPROM_N_MODES		3
 #define AR5K_EEPROM_N_5GHZ_CHAN		10
+#define AR5K_EEPROM_N_5GHZ_RATE_CHAN	8
 #define AR5K_EEPROM_N_2GHZ_CHAN		3
 #define AR5K_EEPROM_N_2GHZ_CHAN_2413	4
 #define	AR5K_EEPROM_N_2GHZ_CHAN_MAX	4
-- 
1.7.11.1


  reply	other threads:[~2012-07-23 16:01 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 ` Thomas Huehn [this message]
2012-07-25 18:42   ` [PATCH 1/2] ath5k: fix wrong per rate target power eeprom reads for AR5K_EEPROM_MODE_11A 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
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=1343059275-49590-2-git-send-email-thomas@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=mcgrof@qca.qualcomm.com \
    --cc=mickflemm@gmail.com \
    --cc=nbd@nbd.name \
    /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).