Commit 854f599
net: ixp4xx_eth: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
[ Upstream commit c14e1ec ]
New timestamping API was introduced in commit 66f7223 ("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>
Stable-dep-of: 594163e ("net: ethernet: xscale: Check for PTP support properly")
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 19f3599 commit 854f599
1 file changed
+29
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
390 | 392 | | |
391 | | - | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | | - | |
398 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
| |||
404 | 408 | | |
405 | 409 | | |
406 | 410 | | |
407 | | - | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | | - | |
| 414 | + | |
411 | 415 | | |
412 | 416 | | |
413 | 417 | | |
| |||
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
426 | | - | |
| 430 | + | |
427 | 431 | | |
428 | 432 | | |
429 | 433 | | |
430 | 434 | | |
431 | 435 | | |
432 | | - | |
| 436 | + | |
433 | 437 | | |
434 | 438 | | |
435 | | - | |
| 439 | + | |
| 440 | + | |
436 | 441 | | |
437 | | - | |
438 | 442 | | |
439 | 443 | | |
440 | | - | |
441 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
442 | 452 | | |
443 | 453 | | |
444 | 454 | | |
445 | | - | |
| 455 | + | |
446 | 456 | | |
447 | 457 | | |
448 | | - | |
| 458 | + | |
449 | 459 | | |
450 | 460 | | |
451 | | - | |
| 461 | + | |
452 | 462 | | |
453 | 463 | | |
454 | 464 | | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
458 | | - | |
| 468 | + | |
459 | 469 | | |
460 | 470 | | |
461 | 471 | | |
| |||
977 | 987 | | |
978 | 988 | | |
979 | 989 | | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | 990 | | |
996 | 991 | | |
997 | 992 | | |
| |||
1376 | 1371 | | |
1377 | 1372 | | |
1378 | 1373 | | |
1379 | | - | |
| 1374 | + | |
1380 | 1375 | | |
1381 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
1382 | 1379 | | |
1383 | 1380 | | |
1384 | 1381 | | |
| |||
0 commit comments