2023-06-23 12:18:14 +00:00
|
|
|
From 3357c64b3fc63fe003d5ef02ba7f6abca64d80bf Mon Sep 17 00:00:00 2001
|
2022-08-20 10:39:26 +00:00
|
|
|
From: Baruch Siach <baruch@tkos.co.il>
|
|
|
|
Date: Mon, 3 May 2021 20:07:36 +0300
|
2023-06-23 12:18:14 +00:00
|
|
|
Subject: [PATCH 2/8] edma_tx_rx: support newer kernels time stamping API
|
2022-08-20 10:39:26 +00:00
|
|
|
|
2023-06-23 12:18:14 +00:00
|
|
|
Timestamping API has changed in kernel 5.6, so update the implementation
|
|
|
|
for newer kernels.
|
|
|
|
|
|
|
|
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
2022-08-20 10:39:26 +00:00
|
|
|
---
|
|
|
|
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 11 +++++++++++
|
|
|
|
1 file changed, 11 insertions(+)
|
|
|
|
|
|
|
|
--- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
|
|
|
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
|
|
|
|
@@ -227,10 +227,16 @@ void nss_phy_tstamp_rx_buf(__attribute__
|
|
|
|
* set to the correct PTP class value by calling ptp_classify_raw
|
|
|
|
* in drv->rxtstamp function.
|
|
|
|
*/
|
|
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
|
|
|
|
if (ndev && ndev->phydev && ndev->phydev->drv &&
|
|
|
|
ndev->phydev->drv->rxtstamp)
|
|
|
|
if(ndev->phydev->drv->rxtstamp(ndev->phydev, skb, 0))
|
|
|
|
return;
|
|
|
|
+#else
|
|
|
|
+ if (ndev && phy_has_rxtstamp(ndev->phydev))
|
|
|
|
+ if (phy_rxtstamp(ndev->phydev, skb, 0))
|
|
|
|
+ return;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
netif_receive_skb(skb);
|
|
|
|
}
|
|
|
|
@@ -248,9 +254,14 @@ void nss_phy_tstamp_tx_buf(struct net_de
|
|
|
|
* set to the correct PTP class value by calling ptp_classify_raw
|
|
|
|
* in the drv->txtstamp function.
|
|
|
|
*/
|
|
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
|
|
|
|
if (ndev && ndev->phydev && ndev->phydev->drv &&
|
|
|
|
ndev->phydev->drv->txtstamp)
|
|
|
|
ndev->phydev->drv->txtstamp(ndev->phydev, skb, 0);
|
|
|
|
+#else
|
|
|
|
+ if (ndev && phy_has_txtstamp(ndev->phydev))
|
|
|
|
+ phy_rxtstamp(ndev->phydev, skb, 0);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(nss_phy_tstamp_tx_buf);
|
|
|
|
|