From patchwork Tue Nov 23 19:44:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Kossifidis X-Patchwork-Id: 350651 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 oANJiDUU029520 for ; Tue, 23 Nov 2010 19:44:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473Ab0KWToK (ORCPT ); Tue, 23 Nov 2010 14:44:10 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:45938 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322Ab0KWToI (ORCPT ); Tue, 23 Nov 2010 14:44:08 -0500 Received: by ewy5 with SMTP id 5so2681338ewy.19 for ; Tue, 23 Nov 2010 11:44:07 -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=I3ehvXXwVAj/LdZmwUl9lipPLWE3RwppeenT3WeyRTM=; b=ue4UqhCvz74ZZEOSnwIRmyNLM7ebj7zUBBvFLvX+CF92X0iEY1DmESk0icnWcHBhMk I7Kvyxj8Xfnu6zXixSIjfDc78iTjc8XcE34iLu5XyDX6CV1TWQFqOMF0pAPKYLGeYNQh lAQRcCN1UeWY699cMYexf0T2A6RpOtjzwQOWo= 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=Lvb71N3OEh4+tuO9WKC7EjsSiXaM8tPR7n31JCd2I8vv8RMspEJfHMB9OlN2REVtaW /HZNZz03CPkHbmwc7A5yRYps4fLhmp2sIO6D9PCGL9F9k0973W11RDIDHnatwki9QwIz EsszBehx/0RN3dzuz0mPek7n/wPuDWxP62XVo= Received: by 10.213.30.20 with SMTP id s20mr7386029ebc.16.1290541447584; Tue, 23 Nov 2010 11:44:07 -0800 (PST) Received: from localhost ([139.91.73.37]) by mx.google.com with ESMTPS id v51sm6135657eeh.16.2010.11.23.11.44.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 11:44:04 -0800 (PST) Date: Tue, 23 Nov 2010 21:44:02 +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 25/30] ath5k: Tweak phy activate to rx start delay based on bwmode Message-ID: <20101123194402.GY4303@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:44:46 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 1b6fcf9..8790f0a 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c @@ -3356,8 +3356,6 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, /* * On 5211+ read activation -> rx delay * and use it. - * - * TODO: Half/quarter rate support */ if (ah->ah_version != AR5K_AR5210) { u32 delay; @@ -3365,8 +3363,13 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, AR5K_PHY_RX_DELAY_M; delay = (channel->hw_value & CHANNEL_CCK) ? ((delay << 2) / 22) : (delay / 10); - - udelay(100 + (2 * delay)); + if (ah->ah_bwmode == AR5K_BWMODE_10MHZ) + delay = delay << 1; + if (ah->ah_bwmode == AR5K_BWMODE_5MHZ) + delay = delay << 2; + /* XXX: /2 on turbo ? Let's be safe + * for now */ + udelay(100 + delay); } else { mdelay(1); }