Subject: Re: [PATCH net-next 1/4] net: wangxun: Add support for PTP clock

From: Vadim Fedorenko <[email-masked]>
Date: Thu, 2 Jan 2025 17:33:58 +0000

On 02/01/2025 10:30, Jiawen Wu wrote:
> Implement support for PTP clock on Wangxun NICs.
> 
> Signed-off-by: Jiawen Wu <[email-masked]>

[...]

>   
> +int wx_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
> +{
> +	struct wx *wx = netdev_priv(netdev);
> +
> +	switch (cmd) {
> +	case SIOCGHWTSTAMP:
> +		return wx_ptp_get_ts_config(wx, ifr);
> +	case SIOCSHWTSTAMP:
> +		return wx_ptp_set_ts_config(wx, ifr);
> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +}
> +EXPORT_SYMBOL(wx_ioctl);
> +
>   MODULE_DESCRIPTION("Common library for Wangxun(R) Ethernet drivers.");
>   MODULE_LICENSE("GPL");

[...]

> @@ -507,6 +513,7 @@ static const struct net_device_ops ngbe_netdev_ops = {
>   	.ndo_get_stats64        = wx_get_stats64,
>   	.ndo_vlan_rx_add_vid    = wx_vlan_rx_add_vid,
>   	.ndo_vlan_rx_kill_vid   = wx_vlan_rx_kill_vid,
> +	.ndo_eth_ioctl          = wx_ioctl,
>   };
>   
>   /**

[...]

> @@ -479,6 +488,7 @@ static const struct net_device_ops txgbe_netdev_ops = {
>   	.ndo_get_stats64        = wx_get_stats64,
>   	.ndo_vlan_rx_add_vid    = wx_vlan_rx_add_vid,
>   	.ndo_vlan_rx_kill_vid   = wx_vlan_rx_kill_vid,
> +	.ndo_eth_ioctl          = wx_ioctl,
>   };
> 

ioctl interface is deprecated for this case. Could you please use
.ndo_hwtstamp_get and .ndo_hwtstamp_set for the new code?