]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: ixp4xx_eth: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 8 May 2025 21:10:42 +0000 (00:10 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 May 2025 01:10:24 +0000 (18:10 -0700)
commitc14e1ecefd9e706262ac713fd27530e3344ef85c
treef18c1eef2ab1d502b43426deff1ea7c035170c8d
parentef5224ed25e00ccca83749b3b425443c7551ef41
net: ixp4xx_eth: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()

New timestamping API was introduced in commit 66f7223039c0 ("net: add
NDOs for configuring hardware timestamping") from kernel v6.6. It is
time to convert the intel ixp4xx ethernet driver to the new API, so that
the ndo_eth_ioctl() path can be removed completely.

hwtstamp_get() and hwtstamp_set() are only called if netif_running()
when the code path is engaged through the legacy ioctl. As I don't
want to make an unnecessary functional change which I can't test,
preserve that restriction when going through the new operations.

When cpu_is_ixp46x() is false, the execution of SIOCGHWTSTAMP and
SIOCSHWTSTAMP falls through to phy_mii_ioctl(), which may process it in
case of a timestamping PHY, or may return -EOPNOTSUPP. In the new API,
the core handles timestamping PHYs directly and does not call the netdev
driver, so just return -EOPNOTSUPP directly for equivalent logic.

A gratuitous change I chose to do anyway is prefixing hwtstamp_get() and
hwtstamp_set() with the driver name, ipx4xx. This reflects modern coding
sensibilities, and we are touching the involved lines anyway.

The remainder of eth_ioctl() is exactly equivalent to
phy_do_ioctl_running(), so use that.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250508211043.3388702-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/xscale/ixp4xx_eth.c