Lines Matching refs:phydev
726 void (*phy_link_change)(struct phy_device *phydev, bool up);
796 int (*soft_reset)(struct phy_device *phydev);
802 int (*config_init)(struct phy_device *phydev);
808 int (*probe)(struct phy_device *phydev);
814 int (*get_features)(struct phy_device *phydev);
828 int (*get_rate_matching)(struct phy_device *phydev,
833 int (*suspend)(struct phy_device *phydev);
835 int (*resume)(struct phy_device *phydev);
843 int (*config_aneg)(struct phy_device *phydev);
846 int (*aneg_done)(struct phy_device *phydev);
849 int (*read_status)(struct phy_device *phydev);
856 int (*config_intr)(struct phy_device *phydev);
859 irqreturn_t (*handle_interrupt)(struct phy_device *phydev);
862 void (*remove)(struct phy_device *phydev);
869 int (*match_phy_device)(struct phy_device *phydev);
992 int (*run)(struct phy_device *phydev);
1015 void of_set_phy_supported(struct phy_device *phydev);
1016 void of_set_phy_eee_broken(struct phy_device *phydev);
1017 int phy_speed_down_core(struct phy_device *phydev);
1023 static inline bool phy_is_started(struct phy_device *phydev) in phy_is_started() argument
1025 return phydev->state >= PHY_UP; in phy_is_started()
1028 void phy_resolve_aneg_pause(struct phy_device *phydev);
1029 void phy_resolve_aneg_linkmode(struct phy_device *phydev);
1030 void phy_check_downshift(struct phy_device *phydev);
1041 static inline int phy_read(struct phy_device *phydev, u32 regnum) in phy_read() argument
1043 return mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in phy_read()
1046 #define phy_read_poll_timeout(phydev, regnum, val, cond, sleep_us, \ argument
1050 sleep_us, timeout_us, sleep_before_read, phydev, regnum); \
1054 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
1066 static inline int __phy_read(struct phy_device *phydev, u32 regnum) in __phy_read() argument
1068 return __mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in __phy_read()
1081 static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) in phy_write() argument
1083 return mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, val); in phy_write()
1094 static inline int __phy_write(struct phy_device *phydev, u32 regnum, u16 val) in __phy_write() argument
1096 return __mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, in __phy_write()
1112 static inline int __phy_modify_changed(struct phy_device *phydev, u32 regnum, in __phy_modify_changed() argument
1115 return __mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr, in __phy_modify_changed()
1123 int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1143 #define phy_read_mmd_poll_timeout(phydev, devaddr, regnum, val, cond, \ argument
1148 phydev, devaddr, regnum); \
1152 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
1160 int __phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1166 int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1172 int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1174 int __phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1176 int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1178 int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1179 int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1181 int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1183 int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1185 int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1187 int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1198 static inline int __phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in __phy_set_bits() argument
1200 return __phy_modify(phydev, regnum, 0, val); in __phy_set_bits()
1211 static inline int __phy_clear_bits(struct phy_device *phydev, u32 regnum, in __phy_clear_bits() argument
1214 return __phy_modify(phydev, regnum, val, 0); in __phy_clear_bits()
1223 static inline int phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_set_bits() argument
1225 return phy_modify(phydev, regnum, 0, val); in phy_set_bits()
1234 static inline int phy_clear_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_clear_bits() argument
1236 return phy_modify(phydev, regnum, val, 0); in phy_clear_bits()
1249 static inline int __phy_set_bits_mmd(struct phy_device *phydev, int devad, in __phy_set_bits_mmd() argument
1252 return __phy_modify_mmd(phydev, devad, regnum, 0, val); in __phy_set_bits_mmd()
1265 static inline int __phy_clear_bits_mmd(struct phy_device *phydev, int devad, in __phy_clear_bits_mmd() argument
1268 return __phy_modify_mmd(phydev, devad, regnum, val, 0); in __phy_clear_bits_mmd()
1279 static inline int phy_set_bits_mmd(struct phy_device *phydev, int devad, in phy_set_bits_mmd() argument
1282 return phy_modify_mmd(phydev, devad, regnum, 0, val); in phy_set_bits_mmd()
1293 static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad, in phy_clear_bits_mmd() argument
1296 return phy_modify_mmd(phydev, devad, regnum, val, 0); in phy_clear_bits_mmd()
1306 static inline bool phy_interrupt_is_valid(struct phy_device *phydev) in phy_interrupt_is_valid() argument
1308 return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT; in phy_interrupt_is_valid()
1316 static inline bool phy_polling_mode(struct phy_device *phydev) in phy_polling_mode() argument
1318 if (phydev->state == PHY_CABLETEST) in phy_polling_mode()
1319 if (phydev->drv->flags & PHY_POLL_CABLE_TEST) in phy_polling_mode()
1322 return phydev->irq == PHY_POLL; in phy_polling_mode()
1329 static inline bool phy_has_hwtstamp(struct phy_device *phydev) in phy_has_hwtstamp() argument
1331 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp; in phy_has_hwtstamp()
1338 static inline bool phy_has_rxtstamp(struct phy_device *phydev) in phy_has_rxtstamp() argument
1340 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp; in phy_has_rxtstamp()
1348 static inline bool phy_has_tsinfo(struct phy_device *phydev) in phy_has_tsinfo() argument
1350 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info; in phy_has_tsinfo()
1357 static inline bool phy_has_txtstamp(struct phy_device *phydev) in phy_has_txtstamp() argument
1359 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp; in phy_has_txtstamp()
1362 static inline int phy_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) in phy_hwtstamp() argument
1364 return phydev->mii_ts->hwtstamp(phydev->mii_ts, ifr); in phy_hwtstamp()
1367 static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_rxtstamp() argument
1370 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type); in phy_rxtstamp()
1373 static inline int phy_ts_info(struct phy_device *phydev, in phy_ts_info() argument
1376 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); in phy_ts_info()
1379 static inline void phy_txtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_txtstamp() argument
1382 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type); in phy_txtstamp()
1389 static inline bool phy_is_internal(struct phy_device *phydev) in phy_is_internal() argument
1391 return phydev->is_internal; in phy_is_internal()
1398 static inline bool phy_on_sfp(struct phy_device *phydev) in phy_on_sfp() argument
1400 return phydev->is_on_sfp_module; in phy_on_sfp()
1433 static inline bool phy_interface_is_rgmii(struct phy_device *phydev) in phy_interface_is_rgmii() argument
1435 return phy_interface_mode_is_rgmii(phydev->interface); in phy_interface_is_rgmii()
1443 static inline bool phy_is_pseudo_fixed_link(struct phy_device *phydev) in phy_is_pseudo_fixed_link() argument
1445 return phydev->is_pseudo_fixed_link; in phy_is_pseudo_fixed_link()
1448 int phy_save_page(struct phy_device *phydev);
1449 int phy_select_page(struct phy_device *phydev, int page);
1450 int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
1451 int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
1452 int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
1453 int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
1455 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
1469 void phy_device_free(struct phy_device *phydev);
1509 static inline void phy_device_free(struct phy_device *phydev) { } in phy_device_free() argument
1511 void phy_device_remove(struct phy_device *phydev);
1512 int phy_get_c45_ids(struct phy_device *phydev);
1513 int phy_init_hw(struct phy_device *phydev);
1514 int phy_suspend(struct phy_device *phydev);
1515 int phy_resume(struct phy_device *phydev);
1516 int __phy_resume(struct phy_device *phydev);
1517 int phy_loopback(struct phy_device *phydev, bool enable);
1520 int phy_sfp_probe(struct phy_device *phydev,
1525 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
1527 int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
1533 void phy_disconnect(struct phy_device *phydev);
1534 void phy_detach(struct phy_device *phydev);
1535 void phy_start(struct phy_device *phydev);
1536 void phy_stop(struct phy_device *phydev);
1537 int phy_config_aneg(struct phy_device *phydev);
1538 int phy_start_aneg(struct phy_device *phydev);
1539 int phy_aneg_done(struct phy_device *phydev);
1540 int phy_speed_down(struct phy_device *phydev, bool sync);
1541 int phy_speed_up(struct phy_device *phydev);
1543 int phy_restart_aneg(struct phy_device *phydev);
1544 int phy_reset_after_clk_enable(struct phy_device *phydev);
1547 int phy_start_cable_test(struct phy_device *phydev,
1549 int phy_start_cable_test_tdr(struct phy_device *phydev,
1554 int phy_start_cable_test(struct phy_device *phydev, in phy_start_cable_test() argument
1561 int phy_start_cable_test_tdr(struct phy_device *phydev, in phy_start_cable_test_tdr() argument
1570 int phy_cable_test_result(struct phy_device *phydev, u8 pair, u16 result);
1571 int phy_cable_test_fault_length(struct phy_device *phydev, u8 pair,
1574 static inline void phy_device_reset(struct phy_device *phydev, int value) in phy_device_reset() argument
1576 mdio_device_reset(&phydev->mdio, value); in phy_device_reset()
1594 static inline const char *phydev_name(const struct phy_device *phydev) in phydev_name() argument
1596 return dev_name(&phydev->mdio.dev); in phydev_name()
1599 static inline void phy_lock_mdio_bus(struct phy_device *phydev) in phy_lock_mdio_bus() argument
1601 mutex_lock(&phydev->mdio.bus->mdio_lock); in phy_lock_mdio_bus()
1604 static inline void phy_unlock_mdio_bus(struct phy_device *phydev) in phy_unlock_mdio_bus() argument
1606 mutex_unlock(&phydev->mdio.bus->mdio_lock); in phy_unlock_mdio_bus()
1609 void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1611 char *phy_attached_info_irq(struct phy_device *phydev)
1613 void phy_attached_info(struct phy_device *phydev);
1616 int genphy_read_abilities(struct phy_device *phydev);
1617 int genphy_setup_forced(struct phy_device *phydev);
1618 int genphy_restart_aneg(struct phy_device *phydev);
1619 int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1620 int genphy_config_eee_advert(struct phy_device *phydev);
1621 int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1622 int genphy_aneg_done(struct phy_device *phydev);
1623 int genphy_update_link(struct phy_device *phydev);
1624 int genphy_read_lpa(struct phy_device *phydev);
1625 int genphy_read_status_fixed(struct phy_device *phydev);
1626 int genphy_read_status(struct phy_device *phydev);
1627 int genphy_read_master_slave(struct phy_device *phydev);
1628 int genphy_suspend(struct phy_device *phydev);
1629 int genphy_resume(struct phy_device *phydev);
1630 int genphy_loopback(struct phy_device *phydev, bool enable);
1631 int genphy_soft_reset(struct phy_device *phydev);
1632 irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev);
1634 static inline int genphy_config_aneg(struct phy_device *phydev) in genphy_config_aneg() argument
1636 return __genphy_config_aneg(phydev, false); in genphy_config_aneg()
1639 static inline int genphy_no_config_intr(struct phy_device *phydev) in genphy_no_config_intr() argument
1649 int genphy_c37_config_aneg(struct phy_device *phydev);
1650 int genphy_c37_read_status(struct phy_device *phydev);
1653 int genphy_c45_restart_aneg(struct phy_device *phydev);
1654 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1655 int genphy_c45_aneg_done(struct phy_device *phydev);
1656 int genphy_c45_read_link(struct phy_device *phydev);
1657 int genphy_c45_read_lpa(struct phy_device *phydev);
1658 int genphy_c45_read_pma(struct phy_device *phydev);
1659 int genphy_c45_pma_setup_forced(struct phy_device *phydev);
1660 int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev);
1661 int genphy_c45_an_config_aneg(struct phy_device *phydev);
1662 int genphy_c45_an_disable_aneg(struct phy_device *phydev);
1663 int genphy_c45_read_mdix(struct phy_device *phydev);
1664 int genphy_c45_pma_read_abilities(struct phy_device *phydev);
1665 int genphy_c45_pma_baset1_read_master_slave(struct phy_device *phydev);
1666 int genphy_c45_read_status(struct phy_device *phydev);
1667 int genphy_c45_baset1_read_status(struct phy_device *phydev);
1668 int genphy_c45_config_aneg(struct phy_device *phydev);
1669 int genphy_c45_loopback(struct phy_device *phydev, bool enable);
1670 int genphy_c45_pma_resume(struct phy_device *phydev);
1671 int genphy_c45_pma_suspend(struct phy_device *phydev);
1672 int genphy_c45_fast_retrain(struct phy_device *phydev, bool enable);
1678 int gen10g_config_aneg(struct phy_device *phydev);
1680 static inline int phy_read_status(struct phy_device *phydev) in phy_read_status() argument
1682 if (!phydev->drv) in phy_read_status()
1685 if (phydev->drv->read_status) in phy_read_status()
1686 return phydev->drv->read_status(phydev); in phy_read_status()
1688 return genphy_read_status(phydev); in phy_read_status()
1696 void phy_error(struct phy_device *phydev);
1698 void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies);
1699 void phy_trigger_machine(struct phy_device *phydev);
1700 void phy_mac_interrupt(struct phy_device *phydev);
1701 void phy_start_machine(struct phy_device *phydev);
1702 void phy_stop_machine(struct phy_device *phydev);
1703 void phy_ethtool_ksettings_get(struct phy_device *phydev,
1705 int phy_ethtool_ksettings_set(struct phy_device *phydev,
1707 int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
1710 int phy_disable_interrupts(struct phy_device *phydev);
1711 void phy_request_interrupt(struct phy_device *phydev);
1712 void phy_free_interrupt(struct phy_device *phydev);
1713 void phy_print_status(struct phy_device *phydev);
1714 int phy_get_rate_matching(struct phy_device *phydev,
1716 void phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
1717 void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
1718 void phy_advertise_supported(struct phy_device *phydev);
1719 void phy_support_sym_pause(struct phy_device *phydev);
1720 void phy_support_asym_pause(struct phy_device *phydev);
1721 void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
1723 void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
1724 bool phy_validate_pause(struct phy_device *phydev,
1726 void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause);
1728 s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
1745 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
1746 int phy_get_eee_err(struct phy_device *phydev);
1747 int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
1748 int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
1749 int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
1750 void phy_ethtool_get_wol(struct phy_device *phydev,
1757 int phy_package_join(struct phy_device *phydev, int addr, size_t priv_size);
1758 void phy_package_leave(struct phy_device *phydev);
1759 int devm_phy_package_join(struct device *dev, struct phy_device *phydev,
1767 int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data);
1768 int phy_ethtool_get_sset_count(struct phy_device *phydev);
1769 int phy_ethtool_get_stats(struct phy_device *phydev,
1772 static inline int phy_package_read(struct phy_device *phydev, u32 regnum) in phy_package_read() argument
1774 struct phy_package_shared *shared = phydev->shared; in phy_package_read()
1779 return mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in phy_package_read()
1782 static inline int __phy_package_read(struct phy_device *phydev, u32 regnum) in __phy_package_read() argument
1784 struct phy_package_shared *shared = phydev->shared; in __phy_package_read()
1789 return __mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in __phy_package_read()
1792 static inline int phy_package_write(struct phy_device *phydev, in phy_package_write() argument
1795 struct phy_package_shared *shared = phydev->shared; in phy_package_write()
1800 return mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in phy_package_write()
1803 static inline int __phy_package_write(struct phy_device *phydev, in __phy_package_write() argument
1806 struct phy_package_shared *shared = phydev->shared; in __phy_package_write()
1811 return __mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in __phy_package_write()
1814 static inline bool __phy_package_set_once(struct phy_device *phydev, in __phy_package_set_once() argument
1817 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once()
1825 static inline bool phy_package_init_once(struct phy_device *phydev) in phy_package_init_once() argument
1827 return __phy_package_set_once(phydev, PHY_SHARED_F_INIT_DONE); in phy_package_init_once()
1830 static inline bool phy_package_probe_once(struct phy_device *phydev) in phy_package_probe_once() argument
1832 return __phy_package_set_once(phydev, PHY_SHARED_F_PROBE_DONE); in phy_package_probe_once()
1880 bool phy_driver_is_genphy(struct phy_device *phydev);
1881 bool phy_driver_is_genphy_10g(struct phy_device *phydev);