Location reporting
| Driver | HAL | Supported Hardware | 802.11n support | Debugging |
The AR9380 and later devices support a “time of flight” feature which can be used to estimate the distance between devices.
Overview
This is in note form for now!
- there's a separate location timer register and control register
- the counter is fed from the mac clock, so 44MHz in 20MHz wide operation, and 88MHz in 40MHz operation
- a specific bit is set for a TX frame, which causes the full packet exchange to be returned
- right now the only way to get the location timestamp is to enable the location timer, which causes /all/ frames to be timestamped with the location timestamp - ie, the TX/RX descriptor timestamps are no longer TSF.
The normal way this happens is:
- fire off a TX frame with location_mode=1, not_sounding=0
- get an RX frame (ACK) with the more bit set
- .. and the second frame in the set is the sounding data with the rate, timestamp, etc and the payload is the CSI.
Implementation
Descriptor example
[1467602208.961128] [100500] TXD DescId=0x061b
DescLen=23, TxQcuNum=1, CtrlStat=1, DescId=0x168c
Link 0x00000000
Data0 0x9f1055e0 Len 28
Data1 0x00000000 Len 0
Data2 0x00000000 Len 0
Data3 0x00000000 Len 0
Desc ID=0x061b, Chksum=0xccb0 (ctl10=0x061bccb0)
Frame Len=30, VMF=0, LowRxChain=0, TxClrRetry=0
TX power 0 = 60, RtsEna=0, Veol=0, ClrDstMask=0
TxIntrReq=0, DestIdxValid=1, CtsEnable=0
Paprd Chain Mask=0x0, TxMore=0, DestIdx=4, FrType=0x0
NoAck=0, InsertTs=0, CorruptFcs=0, ExtOnly=0, ExtAndCtl=0
IsAggr=0, MoreRifs=0, LocMode=1
DurUpEna=1, Burstdur=0x0000
Try0=4, Try1=3, Try2=4, Try3=2
rate0=0x8c, rate1=0x8b, rate2=0x8a, rate3=0x88
try 0: PktDur=44, RTS/CTS ena=0
try 1: PktDur=48, RTS/CTS ena=0
try 2: PktDur=48, RTS/CTS ena=0
try 3: PktDur=62, RTS/CTS ena=0
AggrLen=0, PadDelim=0, EncrType=0, TxDcApStaSel=0
Calib=0 LDPC=1
try 0: chainMask=0x7, GI=1, 2040=0, STBC=0
try 1: chainMask=0x7, GI=1, 2040=0, STBC=0
try 2: chainMask=0x7, GI=1, 2040=0, STBC=0
try 3: chainMask=0x7, GI=1, 2040=0, STBC=0
NotSounding=1
try 0: ant=0x00000000, antsel=0, ness=0
try 1: TxPower=0, ant=0x00000000, antsel=0, ness=0
try 2: TxPower=0, ant=0x00000000, antsel=0, ness=0
try 3: TxPower=0, ant=0x00000000, antsel=0, ness=0
------
[1467602208.961131] [100500] TXPUSH txq=1, nframes=1, fifodepth=1, frmcount=1
[1467602208.961164] [100142] INTR: status=0x00000040
[1467602208.961320] [100142] INTR: status=0x00000042
[1467602208.961330] [100142] RXSTATUS
RSSI 0/0/0 / 0/0/0; combined: 0; rate=0x00
Len: 14; more=1, delim=0, upload=0
RX timestamp: 0
GI: 0, 2040: 0, parallel40: 0, stbc=0
Not sounding: 0, ness: 0, upload_valid: 0
RX antenna: 0x00000000
EVM: 0x00000000; 0x00000000; 0x00000000; 0x00000000
RX done: 1, RX frame ok: 0, CRC error: 0
Decrypt CRC err: 0, PHY err: 0, MIC err: 0
Pre delim CRC err: 0, uAPSD Trig: 0
RXKeyIdxValid: 0, KeyIdx: 0, PHY error: 0
RX more Aggr: 0, RX aggr 0, post delim CRC err: 0
hw upload data type: 0; position bit: 0
Hi RX chain: 0, RxFirstAggr: 0, DecryptBusy: 0, KeyMiss: 0
[1467602208.961332] [100142] RXSTATUS
RSSI 15/19/20 / 128/128/128; combined: 23; rate=0x09
Len: 390; more=0, delim=0, upload=1
RX timestamp: 1427944558
GI: 0, 2040: 0, parallel40: 0, stbc=0
Not sounding: 1, ness: 0, upload_valid: 1
RX antenna: 0x00000000
EVM: 0x00000000; 0x00000000; 0x00000000; 0x80808080
RX done: 1, RX frame ok: 1, CRC error: 0
Decrypt CRC err: 0, PHY err: 0, MIC err: 0
Pre delim CRC err: 0, uAPSD Trig: 0
RXKeyIdxValid: 0, KeyIdx: 0, PHY error: 0
RX more Aggr: 0, RX aggr 0, post delim CRC err: 0
hw upload data type: 1; position bit: 1
Hi RX chain: 0, RxFirstAggr: 0, DecryptBusy: 0, KeyMiss: 0
[1467602208.961471] [100500] TXSTATUS TxTimestamp=1427940337, DescId=0x05a5, QCU=1
DescId=0x05a50000
DescLen=9, TxQcuNum=1, CtrlStat=0, DescId=0x168c
TxTimestamp: 1427940337
TxDone=1, SeqNo=768, TxOpExceed=0, TXBFStatus=0
TXBfMismatch=0, BFStreamMiss=0, FinalTxIdx=0
TxBfDestMiss=0, TxBfExpired=0, PwrMgmt=0, Tid=0, FastTsBit=1
Frmok=1, xretries=0, fifounderrun=0, filt=0
DelimUnderrun=0, DataUnderun=0, DescCfgErr=0, TxTimerExceeded=0
RTScnt=0, FailCnt=0, VRetryCnt=0
RX RSSI 0 [15 19 20]
RX RSSI 1 [128 128 128] Comb=23
BA Valid=0
BALow=0xffffffff
BAHigh=0xffffffff