summaryrefslogtreecommitdiff
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2023-01-09 18:30:41 +0300
committerJakub Kicinski <kuba@kernel.org>2023-01-11 02:53:33 +0300
commit4e4aafcddbbfcdd6eed5780e190fcbfac8b4685a (patch)
tree8153e32b3863a9b490e2a6f7669dadcf262c77de /include/linux/phy.h
parent96b7a9d11a92cc0b09fd645657462a9d9558ef5f (diff)
downloadlinux-4e4aafcddbbfcdd6eed5780e190fcbfac8b4685a.tar.xz
net: mdio: Add dedicated C45 API to MDIO bus drivers
Currently C22 and C45 transactions are mixed over a combined API calls which make use of a special bit in the reg address to indicate if a C45 transaction should be performed. This makes it impossible to know if the bus driver actually supports C45. Additionally, many C22 only drivers don't return -EOPNOTSUPP when asked to perform a C45 transaction, they mistaking perform a C22 transaction. This is the first step to cleanly separate C22 from C45. To maintain backwards compatibility until all drivers which are capable of performing C45 are converted to this new API, the helper functions will fall back to the older API if the new API is not supported. Eventually this fallback will be removed. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 742754d72fc0..89b43cda5bda 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -364,6 +364,11 @@ struct mii_bus {
int (*read)(struct mii_bus *bus, int addr, int regnum);
/** @write: Perform a write transfer on the bus */
int (*write)(struct mii_bus *bus, int addr, int regnum, u16 val);
+ /** @read_c45: Perform a C45 read transfer on the bus */
+ int (*read_c45)(struct mii_bus *bus, int addr, int devnum, int regnum);
+ /** @write_c45: Perform a C45 write transfer on the bus */
+ int (*write_c45)(struct mii_bus *bus, int addr, int devnum,
+ int regnum, u16 val);
/** @reset: Perform a reset of the bus */
int (*reset)(struct mii_bus *bus);