diff options
Diffstat (limited to 'include/linux/phy.h')
| -rw-r--r-- | include/linux/phy.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 9e11039dd7a3..64ab823f7b74 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | 49 | ||
| 50 | #define PHY_HAS_INTERRUPT 0x00000001 | 50 | #define PHY_HAS_INTERRUPT 0x00000001 |
| 51 | #define PHY_HAS_MAGICANEG 0x00000002 | 51 | #define PHY_HAS_MAGICANEG 0x00000002 |
| 52 | #define PHY_IS_INTERNAL 0x00000004 | ||
| 52 | 53 | ||
| 53 | /* Interface Mode definitions */ | 54 | /* Interface Mode definitions */ |
| 54 | typedef enum { | 55 | typedef enum { |
| @@ -57,6 +58,7 @@ typedef enum { | |||
| 57 | PHY_INTERFACE_MODE_GMII, | 58 | PHY_INTERFACE_MODE_GMII, |
| 58 | PHY_INTERFACE_MODE_SGMII, | 59 | PHY_INTERFACE_MODE_SGMII, |
| 59 | PHY_INTERFACE_MODE_TBI, | 60 | PHY_INTERFACE_MODE_TBI, |
| 61 | PHY_INTERFACE_MODE_REVMII, | ||
| 60 | PHY_INTERFACE_MODE_RMII, | 62 | PHY_INTERFACE_MODE_RMII, |
| 61 | PHY_INTERFACE_MODE_RGMII, | 63 | PHY_INTERFACE_MODE_RGMII, |
| 62 | PHY_INTERFACE_MODE_RGMII_ID, | 64 | PHY_INTERFACE_MODE_RGMII_ID, |
| @@ -261,6 +263,7 @@ struct phy_c45_device_ids { | |||
| 261 | * phy_id: UID for this device found during discovery | 263 | * phy_id: UID for this device found during discovery |
| 262 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | 264 | * c45_ids: 802.3-c45 Device Identifers if is_c45. |
| 263 | * is_c45: Set to true if this phy uses clause 45 addressing. | 265 | * is_c45: Set to true if this phy uses clause 45 addressing. |
| 266 | * is_internal: Set to true if this phy is internal to a MAC. | ||
| 264 | * state: state of the PHY for management purposes | 267 | * state: state of the PHY for management purposes |
| 265 | * dev_flags: Device-specific flags used by the PHY driver. | 268 | * dev_flags: Device-specific flags used by the PHY driver. |
| 266 | * addr: Bus address of PHY | 269 | * addr: Bus address of PHY |
| @@ -298,6 +301,7 @@ struct phy_device { | |||
| 298 | 301 | ||
| 299 | struct phy_c45_device_ids c45_ids; | 302 | struct phy_c45_device_ids c45_ids; |
| 300 | bool is_c45; | 303 | bool is_c45; |
| 304 | bool is_internal; | ||
| 301 | 305 | ||
| 302 | enum phy_state state; | 306 | enum phy_state state; |
| 303 | 307 | ||
| @@ -508,6 +512,27 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
| 508 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 512 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
| 509 | } | 513 | } |
| 510 | 514 | ||
| 515 | /** | ||
| 516 | * phy_interrupt_is_valid - Convenience function for testing a given PHY irq | ||
| 517 | * @phydev: the phy_device struct | ||
| 518 | * | ||
| 519 | * NOTE: must be kept in sync with addition/removal of PHY_POLL and | ||
| 520 | * PHY_IGNORE_INTERRUPT | ||
| 521 | */ | ||
| 522 | static inline bool phy_interrupt_is_valid(struct phy_device *phydev) | ||
| 523 | { | ||
| 524 | return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT; | ||
| 525 | } | ||
| 526 | |||
| 527 | /** | ||
| 528 | * phy_is_internal - Convenience function for testing if a PHY is internal | ||
| 529 | * @phydev: the phy_device struct | ||
| 530 | */ | ||
| 531 | static inline bool phy_is_internal(struct phy_device *phydev) | ||
| 532 | { | ||
| 533 | return phydev->is_internal; | ||
| 534 | } | ||
| 535 | |||
| 511 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, | 536 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
| 512 | bool is_c45, struct phy_c45_device_ids *c45_ids); | 537 | bool is_c45, struct phy_c45_device_ids *c45_ids); |
| 513 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | 538 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); |
| @@ -545,6 +570,8 @@ void phy_drivers_unregister(struct phy_driver *drv, int n); | |||
| 545 | int phy_driver_register(struct phy_driver *new_driver); | 570 | int phy_driver_register(struct phy_driver *new_driver); |
| 546 | int phy_drivers_register(struct phy_driver *new_driver, int n); | 571 | int phy_drivers_register(struct phy_driver *new_driver, int n); |
| 547 | void phy_state_machine(struct work_struct *work); | 572 | void phy_state_machine(struct work_struct *work); |
| 573 | void phy_change(struct work_struct *work); | ||
| 574 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); | ||
| 548 | void phy_start_machine(struct phy_device *phydev, | 575 | void phy_start_machine(struct phy_device *phydev, |
| 549 | void (*handler)(struct net_device *)); | 576 | void (*handler)(struct net_device *)); |
| 550 | void phy_stop_machine(struct phy_device *phydev); | 577 | void phy_stop_machine(struct phy_device *phydev); |
