ATH9k_HTC mactime vs. system timestamp (timeval)

Adrian Chadd adrian at freebsd.org
Wed Mar 18 09:04:31 PDT 2015


Hi,

They're different because the MAC timestamp is based on whatever clock
the MAC is synched to.

In hostap mode it'll be itself, and no, there's no requirement for it
to be synched against the system timestamp.

In station mode it'll sync the MAC timestamp against the hostap timestamp.

The 802.11 timestamps are not supposed to be synched against the
system timestamp - they're designed for timekeeping inside a BSS to
synchronise things like power save, etc.



-a


On 18 March 2015 at 01:27, Steger, Marco <Marco.Steger at v2c2.at> wrote:
> Hi all,
>
> I have a small question about the mactime timestamp. I want to get an accurate timestamp for the point in time when the packet is received (driver/hw).
>
> Therefore, I took a look on the ath9k_rx_prepare.c file. In the function ath9k_rx_prepare the mactime is set:
> rx_status->mactime = be64_to_cpu(rxstatus->rs_tstamp);
>
> When I print this timestamp and compare it with the Debian/linux system timestamp (timeval) I recognized that:
> * both are (should be) 64bit values
> * but they are different:
>  [ 2141.033905] TS: timeval-ts [1426665454085102] mactime-ts [688414257]
>  [ 2141.034290] TS: timeval-ts [1426665454085613] mactime-ts [688414675]
>  [ 2141.034697] TS: timeval-ts [1426665454086024] mactime-ts [688415074]
>  [ 2141.035071] TS: timeval-ts [1426665454086420] mactime-ts [688415456]
>  [ 2141.035442] TS: timeval-ts [1426665454086797] mactime-ts [688415827]
>  [ 2141.035817] TS: timeval-ts [1426665454087170] mactime-ts [688416203]
>  [ 2141.036173] TS: timeval-ts [1426665454087544] mactime-ts [688416569]
>  [ 2141.036566] TS: timeval-ts [1426665454087915] mactime-ts [688416953]
>  [ 2141.036943] TS: timeval-ts [1426665454088301] mactime-ts [688417342]
>  [ 2141.037345] TS: timeval-ts [1426665454088682] mactime-ts [688417745]
>
> So I think there must/should be an easy way to get a system ts out of the mactime ts but I don't know how at the moment.
>
> Would be great if you can help me here!
>
> Best regards,
> Marco
>
>
> Dipl.-Ing. Marco Steger
> Junior Researcher
> Area Electrics/Electronics & Software (Area E)
>
> VIRTUAL VEHICLE
> Kompetenzzentrum - Das virtuelle Fahrzeug Forschungs-GmbH
>
> Inffeldgasse 21/A
> 8010  Graz  /  Austria
> Tel:        +43 316 873 9009
> E-Mail:     marco.steger at v2c2.at
> Web:        www.v2c2.at <http://www.v2c2.at/>
>
> Firmenname: Kompetenzzentrum - Das virtuelle Fahrzeug, Forschungsgesellschaft mbH
> Rechtsform: Gesellschaft mit beschränkter Haftung
> Firmensitz: A-8010 Graz, Inffeldgasse 21/A
> Firmenbuchnummer: 224755y
> Firmenbuchgericht: Landesgericht fürZRS Graz
>
>
>
> _______________________________________________
> ath9k_htc_fw mailing list
> ath9k_htc_fw at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath9k_htc_fw



More information about the ath9k_htc_fw mailing list