1 From 40979666b4371012405715ffa61ab5760fcdc6b3 Mon Sep 17 00:00:00 2001
2 Message-Id: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
3 From: Baruch Siach <baruch@tkos.co.il>
4 Date: Mon, 3 May 2021 20:07:36 +0300
5 Subject: [PATCH 1/3] edma_tx_rx: support newer kernels time stamping API
8 hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 11 +++++++++++
9 1 file changed, 11 insertions(+)
11 --- a/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
12 +++ b/hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c
13 @@ -227,10 +227,16 @@ void nss_phy_tstamp_rx_buf(__attribute__
14 * set to the correct PTP class value by calling ptp_classify_raw
15 * in drv->rxtstamp function.
17 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
18 if (ndev && ndev->phydev && ndev->phydev->drv &&
19 ndev->phydev->drv->rxtstamp)
20 if(ndev->phydev->drv->rxtstamp(ndev->phydev, skb, 0))
23 + if (ndev && phy_has_rxtstamp(ndev->phydev))
24 + if (phy_rxtstamp(ndev->phydev, skb, 0))
28 netif_receive_skb(skb);
30 @@ -248,9 +254,14 @@ void nss_phy_tstamp_tx_buf(struct net_de
31 * set to the correct PTP class value by calling ptp_classify_raw
32 * in the drv->txtstamp function.
34 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
35 if (ndev && ndev->phydev && ndev->phydev->drv &&
36 ndev->phydev->drv->txtstamp)
37 ndev->phydev->drv->txtstamp(ndev->phydev, skb, 0);
39 + if (ndev && phy_has_txtstamp(ndev->phydev))
40 + phy_rxtstamp(ndev->phydev, skb, 0);
43 EXPORT_SYMBOL(nss_phy_tstamp_tx_buf);