All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: Jonathan Guerin <jonathan@guerin.id.au>
Cc: ath5k-devel@lists.ath5k.org,
	"linux-wireless" <linux-wireless@vger.kernel.org>,
	Nick Kossifidis <mickflemm@gmail.com>
Subject: Re: [ath5k-devel] [ath5k] Incorrect value for ACK_TIMEOUT
Date: Wed, 15 Sep 2010 12:16:32 +0900	[thread overview]
Message-ID: <201009151216.32430.br1@einfach.org> (raw)
In-Reply-To: <AANLkTi=uaJd3VTZ8cT0YHdE5awsmJaiO+607OLTWrt1E@mail.gmail.com>

On Wed September 15 2010 12:01:50 Jonathan Guerin wrote:
> On Wed, Sep 15, 2010 at 12:30 PM, Bruno Randolf <br1@einfach.org> wrote:
> > On Wed September 15 2010 10:56:32 Jonathan Guerin wrote:
> >> According to the 802.11-2007 spec document, the ACKTimeout value is
> >> (Section 9.2.8 ACK procedure):
> >> ACKTimeout = aSIFSTime + aSlotTime + aPHY-RX-START-Delay
> >> 
> >> >From Table 17-15—OFDM PHY characteristics, the values are:
> >> aSIFSTime = 16
> >> aSlotTime = 9
> >> aPHY-RX-START-Delay = 25
> >> 
> >> Therefore, ACKTimeout = 50
> >> 
> >> In the driver source, this appears to be initialised to:
> >> 
> >> $$ ath5k.h
> >> #define AR5K_INIT_ACK_CTS_TIMEOUT             1024
> >> 
> >> $$ reg.h
> >> /*
> >>  * ACK/CTS timeout register
> >>  */
> >> #define AR5K_TIME_OUT         0x8014                  /* Register
> >> Address */ #define AR5K_TIME_OUT_ACK     0x00001fff      /* ACK timeout
> >> mask */ #define AR5K_TIME_OUT_ACK_S   0
> >> #define AR5K_TIME_OUT_CTS     0x1fff0000      /* CTS timeout mask */
> >> #define AR5K_TIME_OUT_CTS_S   16
> >> 
> >> Taking the value of the register (1024), masking it with the ACK
> >> Timeout Mask (0x1fff) and dividing it by the clock rate (40), we get a
> >> much smaller ACK Timeout value:
> >> 1024 & 0x1fff = 1024
> >> 1024/40 = 25us
> >> 
> >> 
> >> Am I understanding this right? Is the driver actually setting the ACK
> >> Timeout to be much smaller than even a DIFS, let alone matching the
> >> spec?
> > 
> > thanks for looking into this! i think you are right in that there is a
> > mistake here, but AR5K_INIT_ACK_CTS_TIMEOUT is just used for AR5210
> > chips for setting the AR5K_SLOT_TIME. so this is wrong, but it probably
> > does not affect you (or
> 
> I did realise after posting my message that the value was being
> written into the SLOT_TIME register, rather than the TIME_OUT one. My
> bad, I should've done a more thorough search...

probably writing this to SLOT_TIME is wrong too? anyhow 5210 is kind of broken 
and not so important, imho. but it would be good to fix it too.

> We have a 5213 chip - does this default to the 5212 branch inside ath5k?

yes. anything higher than 5212 is treated as 5212, generally.

> > this is all confusing and i think we should replace the initvals by
> > calling the function ath5k_hw_set_ack_timeout().
> 
> Should all of the init be changed to use these functions, along with
> #define init values?

i think it would be best if we could remove the initvals alltoghether and use 
the function to set the ack timeout. but i'm not sure if we need to have them 
initialized to some value at the beginning. in this case can we just override 
them later using the function. or just update the initvals numerically (but no 
defines).

it's great that you review this! i think no-one has looked at this since the 
original import, so there may be really old bugs here.

thanks,
bruno

  parent reply	other threads:[~2010-09-15  3:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  1:56 [ath5k] Incorrect value for ACK_TIMEOUT Jonathan Guerin
2010-09-15  2:30 ` [ath5k-devel] " Bruno Randolf
2010-09-15  3:01   ` Jonathan Guerin
2010-09-15  3:09     ` Jonathan Guerin
2010-09-15  3:16     ` Bruno Randolf [this message]
2010-09-15  3:28       ` Jonathan Guerin
2010-09-15  3:45         ` Bruno Randolf
2010-09-15  4:11           ` Jonathan Guerin
2010-09-15  7:17             ` Kalle Valo
2010-09-15  7:27               ` Jonathan Guerin
2010-09-15  7:32                 ` Bruno Randolf
2010-09-15  7:36                 ` Kalle Valo
2010-09-15 10:00                   ` Jonathan Guerin
2010-09-15 10:41                     ` Kalle Valo

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=201009151216.32430.br1@einfach.org \
    --to=br1@einfach.org \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=jonathan@guerin.id.au \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mickflemm@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.