From: Bruno Randolf <br1@einfach.org>
To: linville@tuxdriver.com
Cc: 8an@praha12.net, ath5k-devel@lists.ath5k.org,
linux-wireless@vger.kernel.org, mickflemm@gmail.com
Subject: [PATCH 3/3] ath5k: IQ calibration for AR5211 is slightly different
Date: Fri, 05 Mar 2010 15:33:06 +0900 [thread overview]
Message-ID: <20100305063306.29522.89859.stgit@void> (raw)
In-Reply-To: <20100305063255.29522.83920.stgit@void>
according to the HAL sources the calculation of the Q value is slightly
different for AR5211 chips.
i couldn't test this since IQ calibration never finishes on older parts. this
is a different problem...
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/phy.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 4977d22..b474d51 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1399,7 +1399,11 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
}
i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7;
- q_coffd = q_pwr >> 7;
+
+ if (ah->ah_version == AR5K_AR5211)
+ q_coffd = q_pwr >> 6;
+ else
+ q_coffd = q_pwr >> 7;
/* protect against divide by 0 and loss of sign bits */
if (i_coffd == 0 || q_coffd < 2)
@@ -1412,7 +1416,10 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
else if (i_coff < -32)
i_coff = -32;
- q_coff = (i_pwr / q_coffd) - 128;
+ if (ah->ah_version == AR5K_AR5211)
+ q_coff = (i_pwr / q_coffd) - 64;
+ else
+ q_coff = (i_pwr / q_coffd) - 128;
/* Boundary check (signed 5 bit) */
if (q_coff > 15)
q_coff = 15;
next prev parent reply other threads:[~2010-03-05 6:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 6:32 [PATCH 1/3] ath5k: fix I/Q calibration (for real) Bruno Randolf
2010-03-05 6:33 ` [PATCH 2/3] ath5k: read eeprom IQ calibration values correctly for G mode Bruno Randolf
2010-03-05 6:33 ` Bruno Randolf [this message]
2010-03-05 13:26 ` [PATCH 1/3] ath5k: fix I/Q calibration (for real) Bob Copeland
2010-03-05 13:33 ` Bob Copeland
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=20100305063306.29522.89859.stgit@void \
--to=br1@einfach.org \
--cc=8an@praha12.net \
--cc=ath5k-devel@lists.ath5k.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mickflemm@gmail.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).