From: Felix Fietkau <nbd@openwrt.org>
To: 8an@praha12.net
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>,
ath5k-devel@lists.ath5k.org
Subject: Re: [PATCH 4/4] ath5k: Implement mac80211 callback set_coverage
Date: Mon, 07 Dec 2009 10:48:01 +0100 [thread overview]
Message-ID: <4B1CCF51.2040304@openwrt.org> (raw)
In-Reply-To: <200912062123.13098.8an@praha12.net>
Lukáš Turek wrote:
> On 6.12.2009 20:20 Felix Fietkau wrote:
>> In 2.4 GHz, regular slot time is 20 usec, unless short slot is enabled.
>> 2.4 GHz with short slot and 5 GHz both use 9 usec.
> Yes, but where the short slot time gets enabled? According to the standard
> (don't have the reference now) all stations in 802.11g network should switch
> to 20 usec slot time when 802.11b-only station connects. But I can't find
> this anywhere in the driver, the only write to AR5K_DCU_GBL_IFS_SLOT is in
> initvals.c - it seems it's not implemented yet.
>
> After some more digging I found that the function ath5k_hw_clocktoh is wrong,
> there are more possible clock rates than 40 and 80, this is in FreeBSD
> driver:
> /* 11a Turbo 11b 11g 108g */
> static const uint8_t CLOCK_RATE[] = { 40, 80, 22, 44, 88 };
>
> Now the values in initvals.c finally make sense:
>
> a/XR aTurbo b g (DYN) gTurbo
> hex 0x168 0x1e0 0x1b8 0x18c 0x1e0
> clocks 360 480 440 396 480
> usec 9 6 20 9 6
>
> Unfortunately I still don't know how to calculate the ACK timeout for
> different slot time than 9. The formula in athctrl is
> 2 * slot_time + 3
> and I don't know where the '3' comes from. Any ideas?
I went through 802.11-2007 again to figure out how this is supposed to
be calculated. The document states:
aSIFSTime is: aRxRFDelay + aRxPLCPDelay + aMACProcessingDelay +
aRxTxTurnaroundTime.
aSlotTime is: aCCATime + aRxTxTurnaroundTime + aAirPropagationTime +
aMACProcessingDelay.
ACKTimeout is: aSIFSTime + aSlotTime + aPHY-RX-START-Delay
SIFS is usually 10 usec and aAirPropagationTime is the propagation for
the round trip, not just one way. It defaults to 1 usec.
Also, Coverage Class = aAirPropagationTime * 3 usec
So a more correct formula might be:
int slot_time = slot_time_base + coverage_class * 3;
int ack_timeout = slot_time + 10 + 3;
I'm still not sure about the offset of 3 for ack_timeout, but since it's
a small constant, it probably won't matter too much.
Of course, the distance settting code in iw probably also needs
changing, as it needs to accomodate for aAirPropagationTime being the
round trip time, not one-way.
- Felix
next prev parent reply other threads:[~2009-12-07 9:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 17:20 [PATCH 0/4] Setting coverage class (and ACK timeout and slot time) Lukáš Turek
2009-12-06 17:22 ` [PATCH 1/4] nl80211: Add new WIPHY attribute COVERAGE_CLASS Lukáš Turek
2009-12-06 18:01 ` Johannes Berg
2009-12-06 18:45 ` Lukáš Turek
2009-12-06 18:49 ` Johannes Berg
2009-12-06 19:28 ` Lukáš Turek
2009-12-06 19:32 ` Lukáš Turek
2009-12-06 21:59 ` Lukáš Turek
2009-12-07 6:57 ` Johannes Berg
2009-12-06 17:23 ` [PATCH 2/4] mac80211: Add new callback set_coverage Lukáš Turek
2009-12-07 10:59 ` Kalle Valo
2009-12-07 11:04 ` Johannes Berg
2009-12-06 17:24 ` [PATCH 3/4] ath5k: Fix functions for getting/setting slot time Lukáš Turek
2009-12-06 17:26 ` [PATCH 4/4] ath5k: Implement mac80211 callback set_coverage Lukáš Turek
2009-12-06 18:34 ` Felix Fietkau
2009-12-06 19:00 ` Lukáš Turek
2009-12-06 19:20 ` Felix Fietkau
2009-12-06 20:23 ` Lukáš Turek
2009-12-07 9:48 ` Felix Fietkau [this message]
2009-12-09 1:15 ` Lukáš Turek
2009-12-09 1:48 ` Felix Fietkau
2009-12-09 13:12 ` Lukáš Turek
2009-12-09 13:30 ` Felix Fietkau
2009-12-09 23:51 ` Lukáš Turek
2009-12-06 17:29 ` [PATCH] iw: Add support for NL80211_ATTR_WIPHY_COVERAGE_CLASS Lukáš Turek
2009-12-06 21:49 ` Luis R. Rodriguez
2009-12-06 21:52 ` Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B1CCF51.2040304@openwrt.org \
--to=nbd@openwrt.org \
--cc=8an@praha12.net \
--cc=ath5k-devel@lists.ath5k.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).