From patchwork Tue Nov 23 19:26:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Kossifidis X-Patchwork-Id: 350441 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 oANJQNBe019487 for ; Tue, 23 Nov 2010 19:26:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756493Ab0KWT0W (ORCPT ); Tue, 23 Nov 2010 14:26:22 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:37556 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754532Ab0KWT0V (ORCPT ); Tue, 23 Nov 2010 14:26:21 -0500 Received: by ewy5 with SMTP id 5so2669950ewy.19 for ; Tue, 23 Nov 2010 11:26:20 -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=EfR9kTx2LcnY5tyOV3zbn91ah0Q58dxLM4xa2g6I3m8=; b=KiIklxRY0vpwdpP89uGC3mVLUAIh6LCCLzvxR9w9gWgSxeN3kEHY6hmpSvIvFEADYJ PZ9nhjNnAvB8LvwsGiYmInCYhhoLyx0iZqb9P+9NbzSYWEJgBRm+tPQ6tmUiZbGrYrIj xCYaQaB1yyhW4e3Abrpq6Ud/Gnw8cMZYZ+4vQ= 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=JDKjHJmBZBDyTzfVZVM0N5CrkXYE9iphD6isJDTXlZqj+Gw7SyPPJFhq7C+Nvqi2NJ R2zygIgNfDS1yvZoUagswNO3JDDtuE8P0wtzrbr/yfB3u7c26oUIj3seAG5uMvp+X6qM d7EygQO6dHdiRdwS/vsY+yHyV1X7pm0LGXhfw= Received: by 10.14.126.69 with SMTP id a45mr1933566eei.15.1290540380111; Tue, 23 Nov 2010 11:26:20 -0800 (PST) Received: from localhost ([139.91.73.37]) by mx.google.com with ESMTPS id x54sm6113050eeh.17.2010.11.23.11.26.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 11:26:16 -0800 (PST) Date: Tue, 23 Nov 2010 21:26:13 +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 19/30] ath5k: Tweak power detector delays on RF5111/RF5112 Message-ID: <20101123192613.GS4303@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:26:59 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 706fc46..6913a52 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c @@ -851,7 +851,23 @@ static int ath5k_hw_rfregs_init(struct ath5k_hw *ah, ath5k_hw_rfb_op(ah, rf_regs, ee->ee_xpd[ee_mode], AR5K_RF_PLO_SEL, true); - /* TODO: Half/quarter channel support */ + /* Tweak power detectors for half/quarter rate support */ + if (ah->ah_bwmode == AR5K_BWMODE_5MHZ || + ah->ah_bwmode == AR5K_BWMODE_10MHZ) { + u8 wait_i; + + ath5k_hw_rfb_op(ah, rf_regs, 0x1f, + AR5K_RF_WAIT_S, true); + + wait_i = (ah->ah_bwmode == AR5K_BWMODE_5MHZ) ? + 0x1f : 0x10; + + ath5k_hw_rfb_op(ah, rf_regs, wait_i, + AR5K_RF_WAIT_I, true); + ath5k_hw_rfb_op(ah, rf_regs, 3, + AR5K_RF_MAX_TIME, true); + + } } if (ah->ah_radio == AR5K_RF5112) { @@ -949,8 +965,20 @@ static int ath5k_hw_rfregs_init(struct ath5k_hw *ah, ath5k_hw_rfb_op(ah, rf_regs, ee->ee_i_gain[ee_mode], AR5K_RF_GAIN_I, true); - /* TODO: Half/quarter channel support */ + /* Tweak power detector for half/quarter rates */ + if (ah->ah_bwmode == AR5K_BWMODE_5MHZ || + ah->ah_bwmode == AR5K_BWMODE_10MHZ) { + u8 pd_delay; + pd_delay = (ah->ah_bwmode == AR5K_BWMODE_5MHZ) ? + 0xf : 0x8; + + ath5k_hw_rfb_op(ah, rf_regs, pd_delay, + AR5K_RF_PD_PERIOD_A, true); + ath5k_hw_rfb_op(ah, rf_regs, 0xf, + AR5K_RF_PD_DELAY_A, true); + + } } if (ah->ah_radio == AR5K_RF5413 &&