linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 27/30] ath5k: Use correct clock when setting ofdm timings
@ 2010-11-23 19:48 Nick Kossifidis
  0 siblings, 0 replies; only message in thread
From: Nick Kossifidis @ 2010-11-23 19:48 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless; +Cc: linville, me, mcgrof, jirislaby, nbd, br1

 * Use correct clock value when setting OFDM timings on
 non-default bwmodes.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
---
 drivers/net/wireless/ath/ath5k/phy.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 31239ab..95b602b 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -228,8 +228,20 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,
 	 * ALGO: coef = (5 * clock / carrier_freq) / 2
 	 * we scale coef by shifting clock value by 24 for
 	 * better precision since we use integers */
-	/* TODO: Half/quarter rate */
-	clock =  (channel->hw_value & CHANNEL_TURBO) ? 80 : 40;
+	switch (ah->ah_bwmode) {
+	case AR5K_BWMODE_40MHZ:
+		clock = 40 * 2;
+		break;
+	case AR5K_BWMODE_10MHZ:
+		clock = 40 / 2;
+		break;
+	case AR5K_BWMODE_5MHZ:
+		clock = 40 / 4;
+		break;
+	default:
+		clock = 40;
+		break;
+	}
 	coef_scaled = ((5 * (clock << 24)) / 2) / channel->center_freq;
 
 	/* Get exponent

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-23 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 19:48 [PATCH 27/30] ath5k: Use correct clock when setting ofdm timings Nick Kossifidis

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