diff options
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index b64825d6ad26..dbfd5ce9350f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -136,11 +136,7 @@ static inline const char *phy_modes(phy_interface_t interface) | |||
136 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ | 136 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ |
137 | #define PHY_ID_FMT "%s:%02x" | 137 | #define PHY_ID_FMT "%s:%02x" |
138 | 138 | ||
139 | /* | 139 | #define MII_BUS_ID_SIZE 61 |
140 | * Need to be a little smaller than phydev->dev.bus_id to leave room | ||
141 | * for the ":%02x" | ||
142 | */ | ||
143 | #define MII_BUS_ID_SIZE (20 - 3) | ||
144 | 140 | ||
145 | /* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit | 141 | /* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit |
146 | IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */ | 142 | IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */ |
@@ -599,7 +595,7 @@ struct phy_driver { | |||
599 | /* A Structure for boards to register fixups with the PHY Lib */ | 595 | /* A Structure for boards to register fixups with the PHY Lib */ |
600 | struct phy_fixup { | 596 | struct phy_fixup { |
601 | struct list_head list; | 597 | struct list_head list; |
602 | char bus_id[20]; | 598 | char bus_id[MII_BUS_ID_SIZE + 3]; |
603 | u32 phy_uid; | 599 | u32 phy_uid; |
604 | u32 phy_uid_mask; | 600 | u32 phy_uid_mask; |
605 | int (*run)(struct phy_device *phydev); | 601 | int (*run)(struct phy_device *phydev); |
@@ -687,6 +683,17 @@ static inline bool phy_is_internal(struct phy_device *phydev) | |||
687 | } | 683 | } |
688 | 684 | ||
689 | /** | 685 | /** |
686 | * phy_interface_mode_is_rgmii - Convenience function for testing if a | ||
687 | * PHY interface mode is RGMII (all variants) | ||
688 | * @mode: the phy_interface_t enum | ||
689 | */ | ||
690 | static inline bool phy_interface_mode_is_rgmii(phy_interface_t mode) | ||
691 | { | ||
692 | return mode >= PHY_INTERFACE_MODE_RGMII && | ||
693 | mode <= PHY_INTERFACE_MODE_RGMII_TXID; | ||
694 | }; | ||
695 | |||
696 | /** | ||
690 | * phy_interface_is_rgmii - Convenience function for testing if a PHY interface | 697 | * phy_interface_is_rgmii - Convenience function for testing if a PHY interface |
691 | * is RGMII (all variants) | 698 | * is RGMII (all variants) |
692 | * @phydev: the phy_device struct | 699 | * @phydev: the phy_device struct |