linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom
@ 2010-10-05  9:32 Gabor Juhos
  2010-10-05 20:06 ` [ath9k-devel] " Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Gabor Juhos @ 2010-10-05  9:32 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, ath9k-devel, Gabor Juhos, Shu Hwa Shen

The base_eep_header_4k structure contains information that the
device supports high power tx gain table or not. However the
ath9k_hw_4k_get_eeprom function does not return that value when
it is called with EEP_TXGAIN_TYPE. This leads to that the tx gain
initialization will use the init values from the original tx gain
table even if the device inidicates that the high power table
should be used.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Shu Hwa Shen <shensh@zcomm.com.cn>
---
 drivers/net/wireless/ath/ath9k/eeprom_4k.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index d6eed1f..872e75b 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -179,6 +179,9 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
 	struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
 	struct modal_eep_4k_header *pModal = &eep->modalHeader;
 	struct base_eep_header_4k *pBase = &eep->baseEepHeader;
+	u16 ver_minor;
+
+	ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK;
 
 	switch (param) {
 	case EEP_NFTHRESH_2:
@@ -204,7 +207,7 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
 	case EEP_DB_2:
 		return pModal->db1_1;
 	case EEP_MINOR_REV:
-		return pBase->version & AR5416_EEP_VER_MINOR_MASK;
+		return ver_minor;
 	case EEP_TX_MASK:
 		return pBase->txMask;
 	case EEP_RX_MASK:
@@ -217,6 +220,11 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
 		return pModal->version;
 	case EEP_ANT_DIV_CTL1:
 		return pModal->antdiv_ctl1;
+	case EEP_TXGAIN_TYPE:
+		if (ver_minor >= AR5416_EEP_MINOR_VER_19)
+			return pBase->txGainType;
+		else
+			return AR5416_EEP_TXGAIN_ORIGINAL;
 	default:
 		return 0;
 	}
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [ath9k-devel] [PATCH] ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom
  2010-10-05  9:32 [PATCH] ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom Gabor Juhos
@ 2010-10-05 20:06 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2010-10-05 20:06 UTC (permalink / raw)
  To: Gabor Juhos, Cliff Holden, Bennyam Malavazi
  Cc: John W. Linville, ath9k-devel@venema.h4ckr.net,
	linux-wireless@vger.kernel.org, Shu Hwa Shen

On Tue, Oct 05, 2010 at 02:32:17AM -0700, Gabor Juhos wrote:
> The base_eep_header_4k structure contains information that the
> device supports high power tx gain table or not. However the
> ath9k_hw_4k_get_eeprom function does not return that value when
> it is called with EEP_TXGAIN_TYPE. This leads to that the tx gain
> initialization will use the init values from the original tx gain
> table even if the device inidicates that the high power table
> should be used.
> 
> Changes-licensed-under: ISC
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Signed-off-by: Shu Hwa Shen <shensh@zcomm.com.cn>

Thanks for the patch, I'm reviewing this internally, I don't see
it used on our HAL for ar5416/ so just want to double check this
is correct.

 Luis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-05 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05  9:32 [PATCH] ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom Gabor Juhos
2010-10-05 20:06 ` [ath9k-devel] " Luis R. Rodriguez

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).