mbox series

[net-next,0/2] net: phy: Fallback to C22 for PHY register read/write

Message ID 20240906093955.3083245-1-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
Headers show
Series net: phy: Fallback to C22 for PHY register read/write | expand

Message

Niklas Söderlund Sept. 6, 2024, 9:39 a.m. UTC
Hello,

This series extends the behavior of the SIOCGMIIREG and SIOCSMIIREG 
IOCTLs to use the convenience functions mmd_phy_read() and 
mmd_phy_write() for C45 access. This brings the benefit of the core 
falling back to indirect C22 access of the underlying driver do not 
itself provide C45 read/write capability.

Patch 1/2 exposes the read/write functions making them available to the 
IOCTL callback. While patch 2/2 changes the IOCTL callback to make use 
of them.

Without this change using tools like phytool to read/write registers on 
a C45 only PHY using a C22 only driver fails as the IOCTL callback don't 
know how to talk C45 on the mdio bus.

Niklas Söderlund (2):
  net: phy: Expose the direct mdiobus access functions
  net: phy: Fallback to C22 access if needed in phy_mii_ioctl()

 drivers/net/phy/phy-core.c | 10 ++++++----
 drivers/net/phy/phy.c      | 18 ++++++++++++------
 include/linux/phy.h        | 12 ++++++++++++
 3 files changed, 30 insertions(+), 10 deletions(-)