Skip to contentSkip to conversation

ath9k: RX timestamp is reported at end of frame

PATCH Superseded Thomas Pedersen 3 participants 7 messages Nov 13, 2012 – Nov 20, 2012 Qualcomm Atheros ATH9K wireless driver

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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
index a04028b..d4df98a 100644
@@ -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
#1 lore raw

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
index 06cdcb7..1708b01 100644
@@ -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
#2 lore raw

PATCH v2 1/2 ath9k: RX timestamp is reported at end of frame

In reply to Thomas Pedersen

drivers/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

#3 lore raw

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

#4 lore raw

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

#5 lore raw

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

#6 lore raw

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