Which Atheros chip for Distance Measuring

Florian Adamsky fa-atheros at haktar.org
Mon Sep 4 02:37:41 PDT 2017


Dear Oleksij,

first of all, sorry for the late reply.

On Sunday, Jun 11 2017, Oleksij Rempel wrote:

> Am 11.06.2017 um 15:06 schrieb Florian Adamsky:
>> Hi all,
>>
>> in one of our projects we need to measure the distance between two
>> 802.11 devices as accurately as possible. Our idea is to use the
>> round-trip time (RTT). To avoid any delay from the operation system and
>> from the network stack, our idea is to measure the arrival time of the
>> acknowledgment control frame.

[...]

> According to docs:
> https://wikidevi.com/wiki/Atheros_AR9271
> ar9271 has:
> rcv_timestamp - A snapshot of the PCU's timestamp (TSF value) (in ms)
> Bits [31:0] of the PCU's 64-bit TSF. Intended for packet logging and
> packet sniffing. The timestamp is sampled on the rising edge of
> rx_clear, which goes from the baseband to the MAC.
>
> and
>
> send_timestamp - Timestamp at the start of transmit. A snapshot of the
> lower 32 bits of PCU's timestamp (TSF value). This field can aid the
> software driver in implementing requirements associated with the
> aMaxTransmitMSDULifetime MAC attribute.
> The Tx timestamp is sampled upon tx_frame signal rising that goes from
> the MAC to the baseband. This value corresponds to the last attempt at
> packet transmission (not the first attempt).

I have an AR9271 and I'm trying to get both timestamp. For the
rcv_timestamp I'm using ath_rx_status.rs_tstamp which should be the
rcv_timestamp that is mentioned in the datasheet and not the mac
timestamp.

// ath9k/mac.h
struct ath_rx_status {
	u32 rs_tstamp;
        // (...)
};

I'm printing rx_stats.rs_tstamp in the function ath9k_rx_prepare in
htc_drv_txrx.c. It seems like that I get reasonable values for that.

However, I have some problems with send_timestamp. I would like to use
ts_tstamp from ath_tx_status:

// ath9k/mac.h
struct ath_tx_status {
	u32 ts_tstamp;
        // (...)
};

As far as I found out, the ath9k_htc_txstatus in htc_drv_txrx.c is the
callback if an frame was transmitted. But it seems like there is no
ath_tx_status anywhere used in htc_drv_txrx.c. Does anyone have an idea
how to access the send_timestamp?

Thanks in advance!
--
Dr. Florian Adamsky
http://florian.adamsky.it/



More information about the ath9k_htc_fw mailing list