|
@@ -1173,6 +1173,21 @@ static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev,
|
|
|
msdu->tstamp = ns_to_ktime((u_int64_t)rx_ppdu_desc->tsf32 *
|
|
|
NSEC_PER_USEC);
|
|
|
}
|
|
|
+
|
|
|
+static inline void ol_rx_timestamp_update(ol_txrx_pdev_handle pdev,
|
|
|
+ qdf_nbuf_t head_msdu,
|
|
|
+ qdf_nbuf_t tail_msdu)
|
|
|
+{
|
|
|
+ qdf_nbuf_t loop_msdu;
|
|
|
+ struct htt_host_rx_desc_base *rx_desc;
|
|
|
+
|
|
|
+ loop_msdu = head_msdu;
|
|
|
+ while (loop_msdu) {
|
|
|
+ rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, loop_msdu);
|
|
|
+ ol_rx_timestamp(pdev->ctrl_pdev, rx_desc, loop_msdu);
|
|
|
+ loop_msdu = qdf_nbuf_next(loop_msdu);
|
|
|
+ }
|
|
|
+}
|
|
|
#else
|
|
|
static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev,
|
|
|
void *rx_desc, qdf_nbuf_t msdu)
|
|
@@ -1198,12 +1213,65 @@ static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev,
|
|
|
|
|
|
msdu->tstamp = ns_to_ktime(tsf64_ns);
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * ol_rx_timestamp_update() - update msdu tsf64 timestamp
|
|
|
+ * @pdev: pointer to txrx handle
|
|
|
+ * @head_msdu: pointer to head msdu
|
|
|
+ * @tail_msdu: pointer to tail msdu
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static inline void ol_rx_timestamp_update(ol_txrx_pdev_handle pdev,
|
|
|
+ qdf_nbuf_t head_msdu,
|
|
|
+ qdf_nbuf_t tail_msdu)
|
|
|
+{
|
|
|
+ qdf_nbuf_t loop_msdu;
|
|
|
+ uint64_t hostime, detlahostime, tsf64_time;
|
|
|
+ struct htt_host_rx_desc_base *rx_desc;
|
|
|
+
|
|
|
+ if (!ol_cfg_is_ptp_rx_opt_enabled(pdev->ctrl_pdev))
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (!tail_msdu)
|
|
|
+ return;
|
|
|
+
|
|
|
+ hostime = ktime_get_ns();
|
|
|
+ rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, tail_msdu);
|
|
|
+ if (rx_desc->ppdu_end.wb_timestamp_lower_32 == 0 &&
|
|
|
+ rx_desc->ppdu_end.wb_timestamp_upper_32 == 0) {
|
|
|
+ detlahostime = hostime - pdev->last_host_time;
|
|
|
+ do_div(detlahostime, NSEC_PER_USEC);
|
|
|
+ tsf64_time = pdev->last_tsf64_time + detlahostime;
|
|
|
+
|
|
|
+ rx_desc->ppdu_end.wb_timestamp_lower_32 =
|
|
|
+ tsf64_time & 0xFFFFFFFF;
|
|
|
+ rx_desc->ppdu_end.wb_timestamp_upper_32 = tsf64_time >> 32;
|
|
|
+ } else {
|
|
|
+ pdev->last_host_time = hostime;
|
|
|
+ pdev->last_tsf64_time =
|
|
|
+ (uint64_t)rx_desc->ppdu_end.wb_timestamp_upper_32 << 32 |
|
|
|
+ rx_desc->ppdu_end.wb_timestamp_lower_32;
|
|
|
+ }
|
|
|
+
|
|
|
+ loop_msdu = head_msdu;
|
|
|
+ while (loop_msdu) {
|
|
|
+ ol_rx_timestamp(pdev->ctrl_pdev, rx_desc, loop_msdu);
|
|
|
+ loop_msdu = qdf_nbuf_next(loop_msdu);
|
|
|
+ }
|
|
|
+}
|
|
|
#endif
|
|
|
#else
|
|
|
static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev,
|
|
|
void *rx_desc, qdf_nbuf_t msdu)
|
|
|
{
|
|
|
}
|
|
|
+
|
|
|
+static inline void ol_rx_timestamp_update(ol_txrx_pdev_handle pdev,
|
|
|
+ qdf_nbuf_t head_msdu,
|
|
|
+ qdf_nbuf_t tail_msdu)
|
|
|
+{
|
|
|
+}
|
|
|
#endif
|
|
|
|
|
|
#ifdef WLAN_FEATURE_DSRC
|
|
@@ -1492,8 +1560,6 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
|
|
|
uint32_t msdu_count;
|
|
|
uint8_t pktlog_bit;
|
|
|
uint32_t filled = 0;
|
|
|
- struct htt_host_rx_desc_base *rx_desc;
|
|
|
- qdf_nbuf_t loop_msdu;
|
|
|
|
|
|
if (tid >= OL_TXRX_NUM_EXT_TIDS) {
|
|
|
ol_txrx_err("invalid tid, %u", tid);
|
|
@@ -1578,15 +1644,9 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- /*Loop msdu to fill tstamp with tsf64 time in ol_rx_timestamp*/
|
|
|
- loop_msdu = head_msdu;
|
|
|
- while (loop_msdu) {
|
|
|
- qdf_nbuf_t msdu = head_msdu;
|
|
|
|
|
|
- rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, loop_msdu);
|
|
|
- ol_rx_timestamp(pdev->ctrl_pdev, rx_desc, msdu);
|
|
|
- loop_msdu = qdf_nbuf_next(loop_msdu);
|
|
|
- }
|
|
|
+ /*Loop msdu to fill tstamp with tsf64 time in ol_rx_timestamp*/
|
|
|
+ ol_rx_timestamp_update(pdev, head_msdu, tail_msdu);
|
|
|
|
|
|
peer->rx_opt_proc(vdev, peer, tid, head_msdu);
|
|
|
}
|