From patchwork Tue Nov 23 19:48:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Kossifidis X-Patchwork-Id: 350721 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oANJmuDT031959 for ; Tue, 23 Nov 2010 19:48:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751064Ab0KWTsz (ORCPT ); Tue, 23 Nov 2010 14:48:55 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:41002 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810Ab0KWTsz (ORCPT ); Tue, 23 Nov 2010 14:48:55 -0500 Received: by ewy5 with SMTP id 5so2684055ewy.19 for ; Tue, 23 Nov 2010 11:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=TwzS4c0kH59ampTxj02bhdZXzmcOxDZLUwbovu0M64Q=; b=ZjBDoCqqZR6Yr8p0XiA0UYMlq/995lJTXJqOgW8tpvnKgNgB90vUvjUK4wHCccXjL3 nWUfvrliOtM1enDL9dF8vsB9pubAmi/4yvN+TJHB1iI4Obm/SxHXuv+8Z8bVK+Y0g8mO 8Z0keuW8g2CRykQ7TMzFVFJlL9+7yxSgqeIlw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=EwriPFMUQiT7a2k7WIBVSOYiJfl499kh1qo7rEi0UqgBQp9KGP3RbeguO58MRoYIp0 BqT/BCVu67wCyeLNC6/GSncoGeUrs1Gc0ikLGBU5u0VliVtJ9S6JFVp1w2foC6gDnUsA cLuk3J4SPB6aXe9mQc2nlzkFiLY6MoTO1KSyY= Received: by 10.213.13.81 with SMTP id b17mr2183159eba.85.1290541734025; Tue, 23 Nov 2010 11:48:54 -0800 (PST) Received: from localhost ([139.91.73.37]) by mx.google.com with ESMTPS id x54sm6134684eeh.11.2010.11.23.11.48.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 11:48:40 -0800 (PST) Date: Tue, 23 Nov 2010 21:48:32 +0200 From: Nick Kossifidis To: ath5k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, me@bobcopeland.com, mcgrof@gmail.com, jirislaby@gmail.com, nbd@openwrt.org, br1@einfach.org Subject: [PATCH 27/30] ath5k: Use correct clock when setting ofdm timings Message-ID: <20101123194832.GA4303@makis.mantri> Mail-Followup-To: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org, linville@tuxdriver.com, me@bobcopeland.com, mcgrof@gmail.com, jirislaby@gmail.com, nbd@openwrt.org, br1@einfach.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 23 Nov 2010 19:48:57 +0000 (UTC) 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