summaryrefslogtreecommitdiff
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-01-06 22:11:16 +0300
committerDavid S. Miller <davem@davemloft.net>2016-01-07 22:31:26 +0300
commite5a03bfd873c29eb786655ef2e95e53ed242b404 (patch)
treec860b98c0f61c9fda92a5b44c94068c312835247 /include/linux/mdio.h
parente7f4dc3536a40097f95103ddf98dd55b3a980f5b (diff)
downloadlinux-e5a03bfd873c29eb786655ef2e95e53ed242b404.tar.xz
phy: Add an mdio_device structure
Not all devices attached to an MDIO bus are phys. So add an mdio_device structure to represent the generic parts of an mdio device, and place this structure into the phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mdio.h')
-rw-r--r--include/linux/mdio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 0d073c23c10d..94f9f1491cde 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -13,6 +13,15 @@
struct mii_bus;
+struct mdio_device {
+ struct device dev;
+
+ struct mii_bus *bus;
+ /* Bus address of the MDIO device (0-31) */
+ int addr;
+};
+#define to_mdio_device(d) container_of(d, struct mdio_device, dev)
+
static inline bool mdio_phy_id_is_c45(int phy_id)
{
return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);