aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mdio.h8
-rw-r--r--include/linux/phy.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 94f9f1491cde..8cd9579e18ea 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -19,9 +19,12 @@ struct mdio_device {
19 struct mii_bus *bus; 19 struct mii_bus *bus;
20 /* Bus address of the MDIO device (0-31) */ 20 /* Bus address of the MDIO device (0-31) */
21 int addr; 21 int addr;
22 int flags;
22}; 23};
23#define to_mdio_device(d) container_of(d, struct mdio_device, dev) 24#define to_mdio_device(d) container_of(d, struct mdio_device, dev)
24 25
26#define MDIO_DEVICE_FLAG_PHY 1
27
25static inline bool mdio_phy_id_is_c45(int phy_id) 28static inline bool mdio_phy_id_is_c45(int phy_id)
26{ 29{
27 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); 30 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);
@@ -188,4 +191,9 @@ int mdiobus_read_nested(struct mii_bus *bus, int addr, u32 regnum);
188int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); 191int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
189int mdiobus_write_nested(struct mii_bus *bus, int addr, u32 regnum, u16 val); 192int mdiobus_write_nested(struct mii_bus *bus, int addr, u32 regnum, u16 val);
190 193
194int mdiobus_register_device(struct mdio_device *mdiodev);
195int mdiobus_unregister_device(struct mdio_device *mdiodev);
196bool mdiobus_is_registered_device(struct mii_bus *bus, int addr);
197struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr);
198
191#endif /* __LINUX_MDIO_H__ */ 199#endif /* __LINUX_MDIO_H__ */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 239a0c2bc49d..2d7beef20825 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -180,7 +180,7 @@ struct mii_bus {
180 struct device dev; 180 struct device dev;
181 181
182 /* list of all PHYs on bus */ 182 /* list of all PHYs on bus */
183 struct phy_device *phy_map[PHY_MAX_ADDR]; 183 struct mdio_device *mdio_map[PHY_MAX_ADDR];
184 184
185 /* PHY addresses to be ignored when probing */ 185 /* PHY addresses to be ignored when probing */
186 u32 phy_mask; 186 u32 phy_mask;