linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Cardona <javier@cozybit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>,
	"Luis R. Rodriguez" <rodrigue@qca.qualcomm.com>,
	linux-wireless@vger.kernel.org, henry@logout.com,
	"greenmesh@lists.osll.spb.ru" <greenmesh@lists.osll.spb.ru>
Subject: Re: [Greenmesh] [ath9k] mesh powersave hardware sleep + wakeup
Date: Wed, 18 Apr 2012 07:56:28 -0700	[thread overview]
Message-ID: <CAPjQAd99vzQDO0PzC-0jq1j8h4ekQAP_dRE=g5f=w=6EwcXrDw@mail.gmail.com> (raw)
In-Reply-To: <1334714536.3725.33.camel@jlt3.sipsolutions.net>

On Tue, Apr 17, 2012 at 7:02 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> (...)
> Keep in mind that TSF == start of TSF field, while rx_status->timestamp
> == start of first symbol, which I didn't even remember when you guys did
> all the Toffset things, I'm guessing they're all wrong :-)

I think you guessed wrong :)

http://www.mail-archive.com/devel@lists.open80211s.org/msg01552.html

+       if (rx_status->flag & RX_FLAG_MACTIME_MPDU && rx_status->mactime) {
+               /*
+                * The mactime is defined as the time the first data symbol
+                * of the frame hits the PHY, and the timestamp of the beacon
+                * is defined as "the time that the data symbol containing the
+                * first bit of the timestamp is transmitted to the PHY plus
+                * the transmitting STA's delays through its local PHY from the
+                * MAC-PHY interface to its interface with the WM" (802.11
+                * 11.1.2)
+                *
+                * T_r, in 13.13.2.2.2, is just defined as "the frame reception
+                * time" but we unless we interpret that time to be the same
+                * time of the beacon timestamp, the offset calculation will be
+                * off.  Below we adjust t_r to be "the time at which the first
+                * symbol of the timestamp element in the beacon is received".
+                * This correction depends on the rate.
+                *
+                * Based on similar code in ibss.c
+                */
+               int rate;
+
+               if (rx_status->flag & RX_FLAG_HT) {
+                       /* TODO:
+                        * In principle there could be HT-beacons (Dual Beacon
+                        * HT Operation options), but for now ignore them and
+                        * just use the primary (i.e. non-HT) beacons for
+                        * synchronization.
+                        * */
+                       goto no_sync;
+               } else
+                       rate = local->hw.wiphy->bands[rx_status->band]->
+                               bitrates[rx_status->rate_idx].bitrate;
+
+               /* 24 bytes of header * 8 bits/byte *
+                * 10*(100 Kbps)/Mbps / rate (100 Kbps)*/
+               t_r = rx_status->mactime + (24 * 8 * 10 / rate);
+       }


-- 
Javier Cardona
cozybit Inc.
http://www.cozybit.com

  reply	other threads:[~2012-04-18 14:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16  9:42 [ath9k] mesh powersave hardware sleep + wakeup Marco Porsch
2012-03-16 20:45 ` Luis R. Rodriguez
2012-03-16 22:09   ` Marco Porsch
2012-04-11 11:00     ` [Greenmesh] " Marco Porsch
2012-04-12  4:05       ` Johannes Berg
2012-04-12  7:41         ` Marco Porsch
2012-04-18  2:02           ` Johannes Berg
2012-04-18 14:56             ` Javier Cardona [this message]
2012-04-18 15:05               ` Johannes Berg
2012-04-18 15:16                 ` Javier Cardona
2012-04-19  2:41                   ` Yeoh Chun-Yeow
2012-04-19  2:51                     ` Javier Cardona
2012-04-27 15:53       ` Marco Porsch

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='CAPjQAd99vzQDO0PzC-0jq1j8h4ekQAP_dRE=g5f=w=6EwcXrDw@mail.gmail.com' \
    --to=javier@cozybit.com \
    --cc=greenmesh@lists.osll.spb.ru \
    --cc=henry@logout.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marco.porsch@etit.tu-chemnitz.de \
    --cc=rodrigue@qca.qualcomm.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 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).