2009-12-22 16:08:13

by Lukáš Turek

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH 4/5] ath5k: Reimplement clock rate to usec conversion

On 22.12.2009 02:24 海藻敬之 wrote:
> Does original Atheros HAL calls the function just for 5GHz
> or calls for both 2GHz and 5 GHz.?
For both, too, the condition used is IS_CHAN_OFDM(chan).

> --- reset.c_org 2009-12-17 17:01:29.000000000 +0900
> +++ reset.c 2009-12-22 09:51:16.000000000 +0900
> @@ -64,7 +64,14 @@
> * 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;
> + if (channel->hw_value & CHANNEL_2GHZ)
> + clock = 44; /* here, we do not have to worry about CCK */

If it really improved your throughput, there might be something on it, but I
still don't think we should change it like that without really understanding
the algorithm. According to my interpretation the calculation should depend
on channel width (20MHz in normal mode, 40MHz in turbo mode, same for 802.11g
and 802.11a), not on MAC chip clocks. At least some Atheros chipsets have
separate radio chip with its own 40 MHz crystal.

I looked at ath9k source, and it uses the same calculation as FreeBSD HAL,
including the 0x64000000 constant. Is there anyone with access to Atheros
documentation who could explain the algorithm at last?

Lukas Turek


Attachments:
(No filename) (1.24 kB)
signature.asc (836.00 B)
This is a digitally signed message part.
Download all attachments