All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Guerin <jonathan@guerin.id.au>
To: Bob Copeland <me@bobcopeland.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	ath5k-devel <ath5k-devel@lists.ath5k.org>
Subject: Re: [ath5k-devel] [support] ath5k contention windows
Date: Wed, 15 Sep 2010 10:44:09 +1000	[thread overview]
Message-ID: <AANLkTimfyZ4N9LWXi-Tbk-xsVisa3C=B=n4s3S6Lf5HV@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=8p2umy+m4emdqKMb=eTYiLTsR3ZENwFaJyoe8@mail.gmail.com>

On Wed, Sep 15, 2010 at 9:07 AM, Jonathan Guerin <jonathan@guerin.id.au> wrote:
> On Wed, Sep 15, 2010 at 3:39 AM, Bob Copeland <me@bobcopeland.com> wrote:
>> On Tue, Sep 14, 2010 at 1:51 AM, Jonathan Guerin <jonathan@guerin.id.au> wrote:
>>> as well as 1360 frames which came in with a negative CONTENTION_TIME.
>>>
>>> Ignoring the fact that some frames are coming up with a negative
>>> CONTENTION_TIME (which potentially points to another problem)
>>
>> How negative are these?  Are you subtracting more for, say, txtime
>> than you should be?
>
> Actually, I've found that they were exactly one slot time negative
> (give or take 1us). That said, I was doing these calculations using
> the 802.11a OFDM spec timings. I looked at the driver and realised
> that SIFS is actually being initialised to 14us, whereas it should be
> set to 16us. This will also affect DIFS. Once I take these into
> consideration, they come up as approximately 4-5us out. Now that I
> think about it, it could make sense.
>
> With regards to the tx_time, I'm using the OFDM tx_time formula from
> the 802.11-2007 spec. I'm trying to lock down enough aspects of the
> timing in order to verify it. From what I've seen now, my txtime is
> almost always 4us short, but I can't work out why. I will get the code
> for the txtime when I get into my office, I don't have it on this

The timings I used were from the 802.11-2007 spec.
SIFS, DIFS & Slot Time: Table 17-15—OFDM PHY characteristics
NDPS values: Table 17-3—Modulation-dependent parameters
txtime calculations: Section 17.4.3 OFDM TXTIME calculation

Here are the functions I use to do the basics:
int16_t ndbps(uint8_t rate_Mbps)
{
  //Radiotap returns rate in 500kbps units
  rate_Mbps/=2;

   static const uint8_t rate_nsyms[][2] = {
      {  6,  24 },
      {  9,  36 },
      { 12,  48 },
      { 18,  72 },
      { 24,  96 },
      { 36, 144 },
      { 48, 192 },
      { 54, 216 }
   };
   static const size_t nof_rate_nsyms = sizeof(rate_nsyms) /
sizeof(rate_nsyms[0]);
   for(size_t i = 0; i < nof_rate_nsyms; ++i) {
      if(rate_Mbps == rate_nsyms[i][0]) {
         return rate_nsyms[i][1];
      }
   }
   return -1;
}

int getTXTime(int rate, int noctets) {
  uint16_t usecs = 0;
  const int16_t nof_bps = ndbps(rate);

  int chan_rate = 1;

  if(-1 != nof_bps) {
    const uint16_t preamble = 16 * chan_rate;
    const uint16_t signal = 4 * chan_rate;
    const uint16_t tsym = 4 * chan_rate;
    const uint16_t nsyms = ceill((16.0 + 8.0 * (noctets) + 6.0) / nof_bps);
    usecs = preamble + signal + tsym * nsyms;
  }

  return(usecs);
}
>
>>
>> --
>> Bob Copeland %% www.bobcopeland.com
>>
>
> Thanks,
>
> Jonathan
>

Thanks,


--
Jonathan Guerin

  reply	other threads:[~2010-09-15  0:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTi=azJS6bn7-=Bbb--ibACaQWqv4ZGLMUpfxynm7@mail.gmail.com>
2010-09-14  5:53 ` [support] ath5k contention windows Jonathan Guerin
2010-09-15  3:40   ` Jonathan Guerin
2010-09-15  3:48     ` [ath5k-devel] " Bruno Randolf
2010-09-14 17:39 ` Bob Copeland
2010-09-14 23:07   ` Jonathan Guerin
2010-09-15  0:44     ` Jonathan Guerin [this message]
2010-09-15  1:47       ` Bruno Randolf
2010-09-15  1:58         ` Jonathan Guerin
2010-09-14 22:48 ` Nick Kossifidis
2010-09-14 23:07   ` Jonathan Guerin
2010-09-15  0:58     ` Bruno Randolf
2010-09-15  1:06       ` Jonathan Guerin
2010-09-15  3:04         ` Bob Copeland
2010-09-15  3:20           ` Jonathan Guerin

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='AANLkTimfyZ4N9LWXi-Tbk-xsVisa3C=B=n4s3S6Lf5HV@mail.gmail.com' \
    --to=jonathan@guerin.id.au \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=me@bobcopeland.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.