aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-01-06 14:11:16 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-07 14:31:26 -0500
commite5a03bfd873c29eb786655ef2e95e53ed242b404 (patch)
treec860b98c0f61c9fda92a5b44c94068c312835247 /include/linux/mdio.h
parente7f4dc3536a40097f95103ddf98dd55b3a980f5b (diff)
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 @@
13 13
14struct mii_bus; 14struct mii_bus;
15 15
16struct mdio_device {
17 struct device dev;
18
19 struct mii_bus *bus;
20 /* Bus address of the MDIO device (0-31) */
21 int addr;
22};
23#define to_mdio_device(d) container_of(d, struct mdio_device, dev)
24
16static inline bool mdio_phy_id_is_c45(int phy_id) 25static inline bool mdio_phy_id_is_c45(int phy_id)
17{ 26{
18 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); 27 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);