ath9k: RX timestamp is reported at end of frame
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
Accurate RX timestamp reporting is important for proper IBSS merging, mesh synchronization, and MCCA scheduling. Namely, knowing where the TSF is recorded is needed to sync with the beacon timestamp field.
Tested with AR9280.
---
v2:
clarify commit log (Luis)
drivers/net/wireless/ath/ath9k/recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/recv.c +1 -1
@@ -976,7 +976,7 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common, rx_status->freq = hw->conf.channel->center_freq; rx_status->signal = ah->noise + rx_stats->rs_rssi; rx_status->antenna = rx_stats->rs_antenna; - rx_status->flag |=RX_FLAG_MACTIME_MPDU ; + rx_status->flag |=RX_FLAG_MACTIME_END ;if (rx_stats->rs_moreaggr) rx_status->flag |=RX_FLAG_NO_SIGNAL_VAL ;
Signature · 1 line
1.7.10.4
PATCH v2 2/2 ath9k_htc: RX timestamp is reported at end of frame
Accurate RX timestamp reporting is important for proper IBSS merging, mesh synchronization, and MCCA scheduling. Namely, knowing where the TSF is recorded is needed to sync with the beacon timestamp field.
Tested with AR9271.
---
v2:
clarify commit log (Luis)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +1 -1
@@ -1082,7 +1082,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, rx_status->freq = hw->conf.channel->center_freq; rx_status->signal = rxbuf->rxstatus.rs_rssi +ATH_DEFAULT_NOISE_FLOOR ; rx_status->antenna = rxbuf->rxstatus.rs_antenna; - rx_status->flag |=RX_FLAG_MACTIME_MPDU ; + rx_status->flag |=RX_FLAG_MACTIME_END ;return true;
Signature · 1 line
1.7.10.4
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
In reply to Thomas Pedersendrivers/net/wireless/ath/ath9k/recv.c static int ath9k_rx_skb_preprocess(struct ath_common *common, · line 979
Quoted 6 lines · Thomas Pedersen
Accurate RX timestamp reporting is important for proper IBSS merging, mesh synchronization, and MCCA scheduling. Namely, knowing where the TSF is recorded is needed to sync with the beacon timestamp field.
drivers/net/wireless/ath/ath9k/recv.c +1
-1- rx_status->flag |=RX_FLAG_MACTIME_MPDU ; + rx_status->flag |=RX_FLAG_MACTIME_END ;
This and the other similar patches obviously won't apply any more.
Before you repost though I think it would make sense to fix the calculation issue that Simon pointed out on the radiotap list? I hope he comes up with some code though as I'm not good enough at bitrate calculations :-)
johannes
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
Quoted 4 lines · Johannes Berg
Before you repost though I think it would make sense to fix the calculation issue that Simon pointed out on the radiotap list? I hope he comes up with some code though as I'm not good enough at bitrate calculations :-)
What was his comment?
Adrian
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
Quoted 8 lines · Adrian Chadd
Quoted 4 lines · Johannes Berg
Before you repost though I think it would make sense to fix the calculation issue that Simon pointed out on the radiotap list? I hope he comes up with some code though as I'm not good enough at bitrate calculations :-)
What was his comment?
Since it's not on gmane yet:
"Unfortunately this patch does not do a very accurate calculation, so it makes the problem worse. It simply multiplies rate by the number of bits to get a time. This does not take into account the limited accuracy in rate (11n has fractional rates), nor does it consider the rounding into blocks caused by FEC, or symbols. As a result the data is made worse by the current code. Either the code should do an accurate fix, or it should record the raw value and let the end user correct it properly."
---
Thomas
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
Just do what Sam did in the FreeBSD TDMA code - calculate the actual beginning of the frame by using the TSF, the size of the last frame, the rate from the last frame, and call ath_hal_calctxtime() (or the linux equivalent, obviously.)
For clarification we should find out what the TSF is for 11n aggregates. Or the math is totally wrong.
Thanks,
Adrian
PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame
Quoted 7 lines · Adrian Chadd
Just do what Sam did in the FreeBSD TDMA code - calculate the actual beginning of the frame by using the TSF, the size of the last frame, the rate from the last frame, and call
ath_hal_calctxtime()(or the linux equivalent, obviously.)For clarification we should find out what the TSF is for 11n aggregates. Or the math is totally wrong.
For reference - only the TSF in the final subframe in an aggregate is valid. The others aren't.
We'll have to jump through some hoops to calculate the timestamp of each individual MPDU.
Adrian