Lines Matching refs:phydev

734 	void (*phy_link_change)(struct phy_device *phydev, bool up);
868 struct phy_device *phydev; member
910 int (*soft_reset)(struct phy_device *phydev);
916 int (*config_init)(struct phy_device *phydev);
922 int (*probe)(struct phy_device *phydev);
928 int (*get_features)(struct phy_device *phydev);
935 unsigned int (*inband_caps)(struct phy_device *phydev,
941 int (*config_inband)(struct phy_device *phydev, unsigned int modes);
952 int (*get_rate_matching)(struct phy_device *phydev,
957 int (*suspend)(struct phy_device *phydev);
959 int (*resume)(struct phy_device *phydev);
967 int (*config_aneg)(struct phy_device *phydev);
970 int (*aneg_done)(struct phy_device *phydev);
973 int (*read_status)(struct phy_device *phydev);
980 int (*config_intr)(struct phy_device *phydev);
983 irqreturn_t (*handle_interrupt)(struct phy_device *phydev);
986 void (*remove)(struct phy_device *phydev);
993 int (*match_phy_device)(struct phy_device *phydev);
1276 static inline bool phydev_id_compare(struct phy_device *phydev, u32 id) in phydev_id_compare() argument
1278 return phy_id_compare(id, phydev->phy_id, phydev->drv->phy_id_mask); in phydev_id_compare()
1291 static inline bool phy_is_started(struct phy_device *phydev) in phy_is_started() argument
1293 return phydev->state >= PHY_UP; in phy_is_started()
1301 static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode) in phy_disable_eee_mode() argument
1303 WARN_ON(phy_is_started(phydev)); in phy_disable_eee_mode()
1305 linkmode_set_bit(link_mode, phydev->eee_disabled_modes); in phy_disable_eee_mode()
1306 linkmode_clear_bit(link_mode, phydev->advertising_eee); in phy_disable_eee_mode()
1309 void phy_resolve_aneg_pause(struct phy_device *phydev);
1310 void phy_resolve_aneg_linkmode(struct phy_device *phydev);
1321 static inline int phy_read(struct phy_device *phydev, u32 regnum) in phy_read() argument
1323 return mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in phy_read()
1326 #define phy_read_poll_timeout(phydev, regnum, val, cond, sleep_us, \ argument
1332 sleep_us, timeout_us, sleep_before_read, phydev, regnum); \
1336 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
1347 static inline int __phy_read(struct phy_device *phydev, u32 regnum) in __phy_read() argument
1349 return __mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in __phy_read()
1362 static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) in phy_write() argument
1364 return mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, val); in phy_write()
1375 static inline int __phy_write(struct phy_device *phydev, u32 regnum, u16 val) in __phy_write() argument
1377 return __mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, in __phy_write()
1393 static inline int __phy_modify_changed(struct phy_device *phydev, u32 regnum, in __phy_modify_changed() argument
1396 return __mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr, in __phy_modify_changed()
1404 int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1425 #define phy_read_mmd_poll_timeout(phydev, devaddr, regnum, val, cond, \ argument
1432 phydev, devaddr, regnum); \
1436 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
1444 int __phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1450 int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1456 int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1458 int __phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1460 int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1462 int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1463 int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1465 int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1467 int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1469 int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1471 int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1482 static inline int __phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in __phy_set_bits() argument
1484 return __phy_modify(phydev, regnum, 0, val); in __phy_set_bits()
1495 static inline int __phy_clear_bits(struct phy_device *phydev, u32 regnum, in __phy_clear_bits() argument
1498 return __phy_modify(phydev, regnum, val, 0); in __phy_clear_bits()
1507 static inline int phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_set_bits() argument
1509 return phy_modify(phydev, regnum, 0, val); in phy_set_bits()
1518 static inline int phy_clear_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_clear_bits() argument
1520 return phy_modify(phydev, regnum, val, 0); in phy_clear_bits()
1533 static inline int __phy_set_bits_mmd(struct phy_device *phydev, int devad, in __phy_set_bits_mmd() argument
1536 return __phy_modify_mmd(phydev, devad, regnum, 0, val); in __phy_set_bits_mmd()
1549 static inline int __phy_clear_bits_mmd(struct phy_device *phydev, int devad, in __phy_clear_bits_mmd() argument
1552 return __phy_modify_mmd(phydev, devad, regnum, val, 0); in __phy_clear_bits_mmd()
1563 static inline int phy_set_bits_mmd(struct phy_device *phydev, int devad, in phy_set_bits_mmd() argument
1566 return phy_modify_mmd(phydev, devad, regnum, 0, val); in phy_set_bits_mmd()
1577 static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad, in phy_clear_bits_mmd() argument
1580 return phy_modify_mmd(phydev, devad, regnum, val, 0); in phy_clear_bits_mmd()
1590 static inline bool phy_interrupt_is_valid(struct phy_device *phydev) in phy_interrupt_is_valid() argument
1592 return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT; in phy_interrupt_is_valid()
1600 static inline bool phy_polling_mode(struct phy_device *phydev) in phy_polling_mode() argument
1602 if (phydev->state == PHY_CABLETEST) in phy_polling_mode()
1603 if (phydev->drv->flags & PHY_POLL_CABLE_TEST) in phy_polling_mode()
1606 if (phydev->drv->update_stats) in phy_polling_mode()
1609 return phydev->irq == PHY_POLL; in phy_polling_mode()
1616 static inline bool phy_has_hwtstamp(struct phy_device *phydev) in phy_has_hwtstamp() argument
1618 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp; in phy_has_hwtstamp()
1625 static inline bool phy_has_rxtstamp(struct phy_device *phydev) in phy_has_rxtstamp() argument
1627 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp; in phy_has_rxtstamp()
1635 static inline bool phy_has_tsinfo(struct phy_device *phydev) in phy_has_tsinfo() argument
1637 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info; in phy_has_tsinfo()
1644 static inline bool phy_has_txtstamp(struct phy_device *phydev) in phy_has_txtstamp() argument
1646 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp; in phy_has_txtstamp()
1649 static inline int phy_hwtstamp(struct phy_device *phydev, in phy_hwtstamp() argument
1653 return phydev->mii_ts->hwtstamp(phydev->mii_ts, cfg, extack); in phy_hwtstamp()
1656 static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_rxtstamp() argument
1659 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type); in phy_rxtstamp()
1662 static inline int phy_ts_info(struct phy_device *phydev, in phy_ts_info() argument
1665 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); in phy_ts_info()
1668 static inline void phy_txtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_txtstamp() argument
1671 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type); in phy_txtstamp()
1684 static inline bool phy_is_default_hwtstamp(struct phy_device *phydev) in phy_is_default_hwtstamp() argument
1686 return phy_has_hwtstamp(phydev) && phydev->default_timestamp; in phy_is_default_hwtstamp()
1693 static inline bool phy_on_sfp(struct phy_device *phydev) in phy_on_sfp() argument
1695 return phydev->is_on_sfp_module; in phy_on_sfp()
1728 static inline bool phy_interface_is_rgmii(struct phy_device *phydev) in phy_interface_is_rgmii() argument
1730 return phy_interface_mode_is_rgmii(phydev->interface); in phy_interface_is_rgmii()
1738 static inline bool phy_is_pseudo_fixed_link(struct phy_device *phydev) in phy_is_pseudo_fixed_link() argument
1740 return phydev->is_pseudo_fixed_link; in phy_is_pseudo_fixed_link()
1743 int phy_save_page(struct phy_device *phydev);
1744 int phy_select_page(struct phy_device *phydev, int page);
1745 int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
1746 int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
1747 int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
1748 int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
1750 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
1764 void phy_device_free(struct phy_device *phydev);
1804 static inline void phy_device_free(struct phy_device *phydev) { } in phy_device_free() argument
1806 void phy_device_remove(struct phy_device *phydev);
1807 int phy_get_c45_ids(struct phy_device *phydev);
1808 int phy_init_hw(struct phy_device *phydev);
1809 int phy_suspend(struct phy_device *phydev);
1810 int phy_resume(struct phy_device *phydev);
1811 int __phy_resume(struct phy_device *phydev);
1812 int phy_loopback(struct phy_device *phydev, bool enable, int speed);
1817 int phy_sfp_probe(struct phy_device *phydev,
1822 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
1824 int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
1830 void phy_disconnect(struct phy_device *phydev);
1831 void phy_detach(struct phy_device *phydev);
1832 void phy_start(struct phy_device *phydev);
1833 void phy_stop(struct phy_device *phydev);
1834 int phy_config_aneg(struct phy_device *phydev);
1835 int _phy_start_aneg(struct phy_device *phydev);
1836 int phy_start_aneg(struct phy_device *phydev);
1837 int phy_aneg_done(struct phy_device *phydev);
1838 unsigned int phy_inband_caps(struct phy_device *phydev,
1840 int phy_config_inband(struct phy_device *phydev, unsigned int modes);
1841 int phy_speed_down(struct phy_device *phydev, bool sync);
1842 int phy_speed_up(struct phy_device *phydev);
1845 int phy_restart_aneg(struct phy_device *phydev);
1846 int phy_reset_after_clk_enable(struct phy_device *phydev);
1849 int phy_start_cable_test(struct phy_device *phydev,
1851 int phy_start_cable_test_tdr(struct phy_device *phydev,
1856 int phy_start_cable_test(struct phy_device *phydev, in phy_start_cable_test() argument
1863 int phy_start_cable_test_tdr(struct phy_device *phydev, in phy_start_cable_test_tdr() argument
1872 static inline void phy_device_reset(struct phy_device *phydev, int value) in phy_device_reset() argument
1874 mdio_device_reset(&phydev->mdio, value); in phy_device_reset()
1892 static inline const char *phydev_name(const struct phy_device *phydev) in phydev_name() argument
1894 return dev_name(&phydev->mdio.dev); in phydev_name()
1897 static inline void phy_lock_mdio_bus(struct phy_device *phydev) in phy_lock_mdio_bus() argument
1899 mutex_lock(&phydev->mdio.bus->mdio_lock); in phy_lock_mdio_bus()
1902 static inline void phy_unlock_mdio_bus(struct phy_device *phydev) in phy_unlock_mdio_bus() argument
1904 mutex_unlock(&phydev->mdio.bus->mdio_lock); in phy_unlock_mdio_bus()
1907 void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1909 char *phy_attached_info_irq(struct phy_device *phydev)
1911 void phy_attached_info(struct phy_device *phydev);
1914 int genphy_read_abilities(struct phy_device *phydev);
1915 int genphy_setup_forced(struct phy_device *phydev);
1916 int genphy_restart_aneg(struct phy_device *phydev);
1917 int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1918 int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1919 int genphy_aneg_done(struct phy_device *phydev);
1920 int genphy_update_link(struct phy_device *phydev);
1921 int genphy_read_lpa(struct phy_device *phydev);
1922 int genphy_read_status_fixed(struct phy_device *phydev);
1923 int genphy_read_status(struct phy_device *phydev);
1924 int genphy_read_master_slave(struct phy_device *phydev);
1925 int genphy_suspend(struct phy_device *phydev);
1926 int genphy_resume(struct phy_device *phydev);
1927 int genphy_loopback(struct phy_device *phydev, bool enable, int speed);
1928 int genphy_soft_reset(struct phy_device *phydev);
1929 irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev);
1931 static inline int genphy_config_aneg(struct phy_device *phydev) in genphy_config_aneg() argument
1933 return __genphy_config_aneg(phydev, false); in genphy_config_aneg()
1936 static inline int genphy_no_config_intr(struct phy_device *phydev) in genphy_no_config_intr() argument
1946 int genphy_c37_config_aneg(struct phy_device *phydev);
1947 int genphy_c37_read_status(struct phy_device *phydev, bool *changed);
1950 int genphy_c45_restart_aneg(struct phy_device *phydev);
1951 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1952 int genphy_c45_aneg_done(struct phy_device *phydev);
1953 int genphy_c45_read_link(struct phy_device *phydev);
1954 int genphy_c45_read_lpa(struct phy_device *phydev);
1955 int genphy_c45_read_pma(struct phy_device *phydev);
1956 int genphy_c45_pma_setup_forced(struct phy_device *phydev);
1957 int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev);
1958 int genphy_c45_an_config_aneg(struct phy_device *phydev);
1959 int genphy_c45_an_disable_aneg(struct phy_device *phydev);
1960 int genphy_c45_read_mdix(struct phy_device *phydev);
1961 int genphy_c45_pma_read_abilities(struct phy_device *phydev);
1962 int genphy_c45_pma_read_ext_abilities(struct phy_device *phydev);
1963 int genphy_c45_pma_baset1_read_abilities(struct phy_device *phydev);
1964 int genphy_c45_read_eee_abilities(struct phy_device *phydev);
1965 int genphy_c45_pma_baset1_read_master_slave(struct phy_device *phydev);
1966 int genphy_c45_read_status(struct phy_device *phydev);
1967 int genphy_c45_baset1_read_status(struct phy_device *phydev);
1968 int genphy_c45_config_aneg(struct phy_device *phydev);
1969 int genphy_c45_loopback(struct phy_device *phydev, bool enable, int speed);
1970 int genphy_c45_pma_resume(struct phy_device *phydev);
1971 int genphy_c45_pma_suspend(struct phy_device *phydev);
1972 int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable);
1973 int genphy_c45_plca_get_cfg(struct phy_device *phydev,
1975 int genphy_c45_plca_set_cfg(struct phy_device *phydev,
1977 int genphy_c45_plca_get_status(struct phy_device *phydev,
1979 int genphy_c45_eee_is_active(struct phy_device *phydev, unsigned long *lp);
1980 int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
1982 int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
1984 int genphy_c45_an_config_eee_aneg(struct phy_device *phydev);
1990 int gen10g_config_aneg(struct phy_device *phydev);
1992 static inline int phy_read_status(struct phy_device *phydev) in phy_read_status() argument
1994 if (!phydev->drv) in phy_read_status()
1997 if (phydev->drv->read_status) in phy_read_status()
1998 return phydev->drv->read_status(phydev); in phy_read_status()
2000 return genphy_read_status(phydev); in phy_read_status()
2008 void phy_error(struct phy_device *phydev);
2010 void phy_trigger_machine(struct phy_device *phydev);
2011 void phy_mac_interrupt(struct phy_device *phydev);
2012 void phy_start_machine(struct phy_device *phydev);
2013 void phy_stop_machine(struct phy_device *phydev);
2014 void phy_ethtool_ksettings_get(struct phy_device *phydev,
2016 int phy_ethtool_ksettings_set(struct phy_device *phydev,
2018 int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
2021 int phy_disable_interrupts(struct phy_device *phydev);
2022 void phy_request_interrupt(struct phy_device *phydev);
2023 void phy_free_interrupt(struct phy_device *phydev);
2024 void phy_print_status(struct phy_device *phydev);
2025 int phy_get_rate_matching(struct phy_device *phydev,
2027 void phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
2028 void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
2029 void phy_advertise_supported(struct phy_device *phydev);
2030 void phy_advertise_eee_all(struct phy_device *phydev);
2031 void phy_support_sym_pause(struct phy_device *phydev);
2032 void phy_support_asym_pause(struct phy_device *phydev);
2033 void phy_support_eee(struct phy_device *phydev);
2034 void phy_disable_eee(struct phy_device *phydev);
2035 void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
2037 void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
2038 bool phy_validate_pause(struct phy_device *phydev,
2040 void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause);
2042 s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
2045 int phy_get_tx_amplitude_gain(struct phy_device *phydev, struct device *dev,
2061 int phy_eee_tx_clock_stop_capable(struct phy_device *phydev);
2062 int phy_eee_rx_clock_stop(struct phy_device *phydev, bool clk_stop_enable);
2063 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
2064 int phy_get_eee_err(struct phy_device *phydev);
2065 int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_keee *data);
2066 int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_keee *data);
2067 int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
2068 void phy_ethtool_get_wol(struct phy_device *phydev,
2079 int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data);
2080 int phy_ethtool_get_sset_count(struct phy_device *phydev);
2081 int phy_ethtool_get_stats(struct phy_device *phydev,
2084 void __phy_ethtool_get_phy_stats(struct phy_device *phydev,
2087 void __phy_ethtool_get_link_ext_stats(struct phy_device *phydev,
2090 int phy_ethtool_get_plca_cfg(struct phy_device *phydev,
2092 int phy_ethtool_set_plca_cfg(struct phy_device *phydev,
2095 int phy_ethtool_get_plca_status(struct phy_device *phydev,
2098 int __phy_hwtstamp_get(struct phy_device *phydev,
2100 int __phy_hwtstamp_set(struct phy_device *phydev,
2149 bool phy_driver_is_genphy(struct phy_device *phydev);
2150 bool phy_driver_is_genphy_10g(struct phy_device *phydev);