Merge "[qca-nss-drv]: Register the callback for ptp service code"
diff --git a/nss_data_plane/nss_data_plane_edma.c b/nss_data_plane/nss_data_plane_edma.c
index c4067ff..b84fd19 100644
--- a/nss_data_plane/nss_data_plane_edma.c
+++ b/nss_data_plane/nss_data_plane_edma.c
@@ -303,6 +303,12 @@
}
/*
+ * Packets with the ptp service code should be delivered to PHY driver for timestamping
+ */
+ nss_cmn_register_service_code(nss_ctx, nss_phy_tstamp_rx_buf,
+ NSS_PTP_EVENT_SERVICE_CODE, netdev);
+
+ /*
* Now we are registered and our side is ready, if the data plane was opened, ask it to start again
*/
if (is_open) {
@@ -316,6 +322,8 @@
*/
static void nss_data_plane_unregister_from_nss_dp(int if_num)
{
+ nss_cmn_unregister_service_code(nss_data_plane_edma_params[if_num].nss_ctx,
+ nss_phy_tstamp_rx_buf, NSS_PTP_EVENT_SERVICE_CODE);
nss_dp_restore_data_plane(nss_data_plane_edma_params[if_num].dpc.dev);
nss_data_plane_edma_params[if_num].dpc.dev = NULL;
nss_data_plane_edma_params[if_num].nss_ctx = NULL;
diff --git a/nss_phys_if.c b/nss_phys_if.c
index 0ba66e1..9038788 100644
--- a/nss_phys_if.c
+++ b/nss_phys_if.c
@@ -21,6 +21,9 @@
#include "nss_tx_rx_common.h"
#include "nss_tstamp.h"
+#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
+#include <nss_dp_api_if.h>
+#endif
#define NSS_PHYS_IF_TX_TIMEOUT 3000 /* 3 Seconds */
@@ -167,7 +170,9 @@
*/
if (unlikely(skb_shinfo(os_buf)->tx_flags & SKBTX_HW_TSTAMP)) {
/* try PHY Driver hook for transmit timestamping firstly */
- skb_tx_timestamp(os_buf);
+#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
+ nss_phy_tstamp_tx_buf(os_buf->dev, os_buf);
+#endif
if (!(skb_shinfo(os_buf)->tx_flags & SKBTX_IN_PROGRESS))
return nss_tstamp_tx_buf(nss_ctx, os_buf, if_num);
}