Return-path: Received: from mail.atheros.com ([12.19.149.2]:34970 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433Ab0LFLyd (ORCPT ); Mon, 6 Dec 2010 06:54:33 -0500 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Mon, 06 Dec 2010 03:54:18 -0800 Date: Mon, 6 Dec 2010 17:24:10 +0530 From: Vasanthakumar Thiagarajan To: Felix Fietkau CC: Vasanth Thiagarajan , "linville@tuxdriver.com" , "linux-wireless@vger.kernel.org" Subject: Re: [PATCH V2 12/27] ath9k_hw: Find chansel of AR_PHY_65NM_CH0_SYNTH7 from an array for AR9485 Message-ID: <20101206115410.GU12908@vasanth-laptop> References: <1291288031-3409-13-git-send-email-vasanth@atheros.com> <4CF84BB8.8090007@openwrt.org> <20101203045054.GP12908@vasanth-laptop> <4CF8DF08.2060307@openwrt.org> <20101203124050.GR12908@vasanth-laptop> <4CF8E718.9070207@openwrt.org> <20101206060310.GS12908@vasanth-laptop> <4CFCBE04.7070509@openwrt.org> <20101206114401.GT12908@vasanth-laptop> <4CFCCE0E.6020906@openwrt.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: <4CFCCE0E.6020906@openwrt.org> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, Dec 06, 2010 at 05:20:38PM +0530, Felix Fietkau wrote: > On 2010-12-06 12:44 PM, Vasanthakumar Thiagarajan wrote: > >> > I don't have any doc for this register yet. > >> I'm pretty sure that the format of the register is still exactly the > >> same. I guess they added a small frequency offset to reduce spur. > >> > >> >> But how exactly is *one* magic number (and it's even a very small one) > >> >> worse than 14 of them, especially since anybody can verify that the > >> >> generated raw values are exactly the same? > >> > > >> > Anyway, still this formula gets it wrong for channel 14. > >> > Lets have this table for now, I'll clean this up once I > >> > get the proper doc for this register?. > >> How did you test this? When I put this part into a test program, it > >> generates exactly the same values as the table all channels, > >> including 14. > > > > I just did the following > > > > #define CHANSEL_2G_9485(_freq) ((((freq) * 0x10000) - 215) / CHANSEL_DIV) > > for (i = 0; i < 14; i++) { > > freq = 2412 + (i * 5); > > printk("chan %d : %x \n",i + 1,CHANSEL_2G_9485(freq)); > > } > > > > output: > > > > chan 1 : a0ccbe > > chan 2 : a12213 > > chan 3 : a17769 > > chan 4 : a1ccbe > > chan 5 : a22213 > > chan 6 : a27769 > > chan 7 : a2ccbe > > chan 8 : a32213 > > chan 9 : a37769 > > chan 10 : a3ccbe > > chan 11 : a42213 > > chan 12 : a47769 > > chan 13 : a4ccbe > > chan 14 : a52213 > 2412 + 13 * 5 == 2477, not 2484. oops, sorry. Vasanth