Lines Matching full:phydev

73  * Set phydev->irq to PHY_POLL if interrupts are not supported,
267 * Represents a shared structure between different phydev's in the same
639 void (*phy_link_change)(struct phy_device *phydev, bool up);
706 int (*soft_reset)(struct phy_device *phydev);
712 int (*config_init)(struct phy_device *phydev);
718 int (*probe)(struct phy_device *phydev);
722 * abilities it has. Should only set phydev->supported.
724 int (*get_features)(struct phy_device *phydev);
728 int (*suspend)(struct phy_device *phydev);
730 int (*resume)(struct phy_device *phydev);
734 * autonegotiation if phydev->autoneg is on,
735 * forces the speed to the current settings in phydev
736 * if phydev->autoneg is off
738 int (*config_aneg)(struct phy_device *phydev);
741 int (*aneg_done)(struct phy_device *phydev);
744 int (*read_status)(struct phy_device *phydev);
747 int (*ack_interrupt)(struct phy_device *phydev);
750 int (*config_intr)(struct phy_device *phydev);
757 int (*did_interrupt)(struct phy_device *phydev);
760 irqreturn_t (*handle_interrupt)(struct phy_device *phydev);
763 void (*remove)(struct phy_device *phydev);
767 * driver for the given phydev. If NULL, matching is based on
770 int (*match_phy_device)(struct phy_device *phydev);
893 int (*run)(struct phy_device *phydev);
913 void of_set_phy_supported(struct phy_device *phydev);
914 void of_set_phy_eee_broken(struct phy_device *phydev);
915 int phy_speed_down_core(struct phy_device *phydev);
919 * @phydev: The phy_device struct
921 static inline bool phy_is_started(struct phy_device *phydev) in phy_is_started() argument
923 return phydev->state >= PHY_UP; in phy_is_started()
926 void phy_resolve_aneg_pause(struct phy_device *phydev);
927 void phy_resolve_aneg_linkmode(struct phy_device *phydev);
928 void phy_check_downshift(struct phy_device *phydev);
932 * @phydev: the phy_device struct
939 static inline int phy_read(struct phy_device *phydev, u32 regnum) in phy_read() argument
941 return mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in phy_read()
944 #define phy_read_poll_timeout(phydev, regnum, val, cond, sleep_us, \ argument
948 sleep_us, timeout_us, sleep_before_read, phydev, regnum); \
952 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
959 * @phydev: the phy_device struct
964 static inline int __phy_read(struct phy_device *phydev, u32 regnum) in __phy_read() argument
966 return __mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in __phy_read()
971 * @phydev: the phy_device struct
979 static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) in phy_write() argument
981 return mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, val); in phy_write()
986 * @phydev: the phy_device struct
992 static inline int __phy_write(struct phy_device *phydev, u32 regnum, u16 val) in __phy_write() argument
994 return __mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, in __phy_write()
1000 * @phydev: a pointer to a &struct phy_device
1010 static inline int __phy_modify_changed(struct phy_device *phydev, u32 regnum, in __phy_modify_changed() argument
1013 return __mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr, in __phy_modify_changed()
1021 int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1027 * @phydev: The phy_device struct
1041 #define phy_read_mmd_poll_timeout(phydev, devaddr, regnum, val, cond, \ argument
1046 phydev, devaddr, regnum); \
1050 phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
1058 int __phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum);
1064 int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1070 int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
1072 int __phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1074 int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask,
1076 int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1077 int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set);
1079 int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1081 int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
1083 int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1085 int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
1090 * @phydev: the phy_device struct
1096 static inline int __phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in __phy_set_bits() argument
1098 return __phy_modify(phydev, regnum, 0, val); in __phy_set_bits()
1103 * @phydev: the phy_device struct
1109 static inline int __phy_clear_bits(struct phy_device *phydev, u32 regnum, in __phy_clear_bits() argument
1112 return __phy_modify(phydev, regnum, val, 0); in __phy_clear_bits()
1117 * @phydev: the phy_device struct
1121 static inline int phy_set_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_set_bits() argument
1123 return phy_modify(phydev, regnum, 0, val); in phy_set_bits()
1128 * @phydev: the phy_device struct
1132 static inline int phy_clear_bits(struct phy_device *phydev, u32 regnum, u16 val) in phy_clear_bits() argument
1134 return phy_modify(phydev, regnum, val, 0); in phy_clear_bits()
1140 * @phydev: the phy_device struct
1147 static inline int __phy_set_bits_mmd(struct phy_device *phydev, int devad, in __phy_set_bits_mmd() argument
1150 return __phy_modify_mmd(phydev, devad, regnum, 0, val); in __phy_set_bits_mmd()
1156 * @phydev: the phy_device struct
1163 static inline int __phy_clear_bits_mmd(struct phy_device *phydev, int devad, in __phy_clear_bits_mmd() argument
1166 return __phy_modify_mmd(phydev, devad, regnum, val, 0); in __phy_clear_bits_mmd()
1172 * @phydev: the phy_device struct
1177 static inline int phy_set_bits_mmd(struct phy_device *phydev, int devad, in phy_set_bits_mmd() argument
1180 return phy_modify_mmd(phydev, devad, regnum, 0, val); in phy_set_bits_mmd()
1186 * @phydev: the phy_device struct
1191 static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad, in phy_clear_bits_mmd() argument
1194 return phy_modify_mmd(phydev, devad, regnum, val, 0); in phy_clear_bits_mmd()
1199 * @phydev: the phy_device struct
1204 static inline bool phy_interrupt_is_valid(struct phy_device *phydev) in phy_interrupt_is_valid() argument
1206 return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT; in phy_interrupt_is_valid()
1212 * @phydev: the phy_device struct
1214 static inline bool phy_polling_mode(struct phy_device *phydev) in phy_polling_mode() argument
1216 if (phydev->state == PHY_CABLETEST) in phy_polling_mode()
1217 if (phydev->drv->flags & PHY_POLL_CABLE_TEST) in phy_polling_mode()
1220 return phydev->irq == PHY_POLL; in phy_polling_mode()
1225 * @phydev: the phy_device struct
1227 static inline bool phy_has_hwtstamp(struct phy_device *phydev) in phy_has_hwtstamp() argument
1229 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp; in phy_has_hwtstamp()
1234 * @phydev: the phy_device struct
1236 static inline bool phy_has_rxtstamp(struct phy_device *phydev) in phy_has_rxtstamp() argument
1238 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp; in phy_has_rxtstamp()
1244 * @phydev: the phy_device struct
1246 static inline bool phy_has_tsinfo(struct phy_device *phydev) in phy_has_tsinfo() argument
1248 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info; in phy_has_tsinfo()
1253 * @phydev: the phy_device struct
1255 static inline bool phy_has_txtstamp(struct phy_device *phydev) in phy_has_txtstamp() argument
1257 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp; in phy_has_txtstamp()
1260 static inline int phy_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) in phy_hwtstamp() argument
1262 return phydev->mii_ts->hwtstamp(phydev->mii_ts, ifr); in phy_hwtstamp()
1265 static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_rxtstamp() argument
1268 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type); in phy_rxtstamp()
1271 static inline int phy_ts_info(struct phy_device *phydev, in phy_ts_info() argument
1274 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); in phy_ts_info()
1277 static inline void phy_txtstamp(struct phy_device *phydev, struct sk_buff *skb, in phy_txtstamp() argument
1280 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type); in phy_txtstamp()
1285 * @phydev: the phy_device struct
1287 static inline bool phy_is_internal(struct phy_device *phydev) in phy_is_internal() argument
1289 return phydev->is_internal; in phy_is_internal()
1320 * @phydev: the phy_device struct
1322 static inline bool phy_interface_is_rgmii(struct phy_device *phydev) in phy_interface_is_rgmii() argument
1324 return phy_interface_mode_is_rgmii(phydev->interface); in phy_interface_is_rgmii()
1330 * @phydev: the phy_device struct
1332 static inline bool phy_is_pseudo_fixed_link(struct phy_device *phydev) in phy_is_pseudo_fixed_link() argument
1334 return phydev->is_pseudo_fixed_link; in phy_is_pseudo_fixed_link()
1337 int phy_save_page(struct phy_device *phydev);
1338 int phy_select_page(struct phy_device *phydev, int page);
1339 int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
1340 int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
1341 int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
1342 int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
1344 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
1353 void phy_device_free(struct phy_device *phydev);
1366 static inline void phy_device_free(struct phy_device *phydev) { } in phy_device_free() argument
1368 void phy_device_remove(struct phy_device *phydev);
1369 int phy_init_hw(struct phy_device *phydev);
1370 int phy_suspend(struct phy_device *phydev);
1371 int phy_resume(struct phy_device *phydev);
1372 int __phy_resume(struct phy_device *phydev);
1373 int phy_loopback(struct phy_device *phydev, bool enable);
1376 int phy_sfp_probe(struct phy_device *phydev,
1381 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
1383 int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
1389 void phy_disconnect(struct phy_device *phydev);
1390 void phy_detach(struct phy_device *phydev);
1391 void phy_start(struct phy_device *phydev);
1392 void phy_stop(struct phy_device *phydev);
1393 int phy_start_aneg(struct phy_device *phydev);
1394 int phy_aneg_done(struct phy_device *phydev);
1395 int phy_speed_down(struct phy_device *phydev, bool sync);
1396 int phy_speed_up(struct phy_device *phydev);
1398 int phy_restart_aneg(struct phy_device *phydev);
1399 int phy_reset_after_clk_enable(struct phy_device *phydev);
1402 int phy_start_cable_test(struct phy_device *phydev,
1404 int phy_start_cable_test_tdr(struct phy_device *phydev,
1409 int phy_start_cable_test(struct phy_device *phydev, in phy_start_cable_test() argument
1416 int phy_start_cable_test_tdr(struct phy_device *phydev, in phy_start_cable_test_tdr() argument
1425 int phy_cable_test_result(struct phy_device *phydev, u8 pair, u16 result);
1426 int phy_cable_test_fault_length(struct phy_device *phydev, u8 pair,
1429 static inline void phy_device_reset(struct phy_device *phydev, int value) in phy_device_reset() argument
1431 mdio_device_reset(&phydev->mdio, value); in phy_device_reset()
1446 static inline const char *phydev_name(const struct phy_device *phydev) in phydev_name() argument
1448 return dev_name(&phydev->mdio.dev); in phydev_name()
1451 static inline void phy_lock_mdio_bus(struct phy_device *phydev) in phy_lock_mdio_bus() argument
1453 mutex_lock(&phydev->mdio.bus->mdio_lock); in phy_lock_mdio_bus()
1456 static inline void phy_unlock_mdio_bus(struct phy_device *phydev) in phy_unlock_mdio_bus() argument
1458 mutex_unlock(&phydev->mdio.bus->mdio_lock); in phy_unlock_mdio_bus()
1461 void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1463 char *phy_attached_info_irq(struct phy_device *phydev)
1465 void phy_attached_info(struct phy_device *phydev);
1468 int genphy_read_abilities(struct phy_device *phydev);
1469 int genphy_setup_forced(struct phy_device *phydev);
1470 int genphy_restart_aneg(struct phy_device *phydev);
1471 int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1472 int genphy_config_eee_advert(struct phy_device *phydev);
1473 int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1474 int genphy_aneg_done(struct phy_device *phydev);
1475 int genphy_update_link(struct phy_device *phydev);
1476 int genphy_read_lpa(struct phy_device *phydev);
1477 int genphy_read_status_fixed(struct phy_device *phydev);
1478 int genphy_read_status(struct phy_device *phydev);
1479 int genphy_suspend(struct phy_device *phydev);
1480 int genphy_resume(struct phy_device *phydev);
1481 int genphy_loopback(struct phy_device *phydev, bool enable);
1482 int genphy_soft_reset(struct phy_device *phydev);
1484 static inline int genphy_config_aneg(struct phy_device *phydev) in genphy_config_aneg() argument
1486 return __genphy_config_aneg(phydev, false); in genphy_config_aneg()
1489 static inline int genphy_no_ack_interrupt(struct phy_device *phydev) in genphy_no_ack_interrupt() argument
1493 static inline int genphy_no_config_intr(struct phy_device *phydev) in genphy_no_config_intr() argument
1503 int genphy_c37_config_aneg(struct phy_device *phydev);
1504 int genphy_c37_read_status(struct phy_device *phydev);
1507 int genphy_c45_restart_aneg(struct phy_device *phydev);
1508 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart);
1509 int genphy_c45_aneg_done(struct phy_device *phydev);
1510 int genphy_c45_read_link(struct phy_device *phydev);
1511 int genphy_c45_read_lpa(struct phy_device *phydev);
1512 int genphy_c45_read_pma(struct phy_device *phydev);
1513 int genphy_c45_pma_setup_forced(struct phy_device *phydev);
1514 int genphy_c45_an_config_aneg(struct phy_device *phydev);
1515 int genphy_c45_an_disable_aneg(struct phy_device *phydev);
1516 int genphy_c45_read_mdix(struct phy_device *phydev);
1517 int genphy_c45_pma_read_abilities(struct phy_device *phydev);
1518 int genphy_c45_read_status(struct phy_device *phydev);
1519 int genphy_c45_config_aneg(struct phy_device *phydev);
1525 int gen10g_config_aneg(struct phy_device *phydev);
1527 static inline int phy_read_status(struct phy_device *phydev) in phy_read_status() argument
1529 if (!phydev->drv) in phy_read_status()
1532 if (phydev->drv->read_status) in phy_read_status()
1533 return phydev->drv->read_status(phydev); in phy_read_status()
1535 return genphy_read_status(phydev); in phy_read_status()
1544 void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies);
1545 void phy_mac_interrupt(struct phy_device *phydev);
1546 void phy_start_machine(struct phy_device *phydev);
1547 void phy_stop_machine(struct phy_device *phydev);
1548 void phy_ethtool_ksettings_get(struct phy_device *phydev,
1550 int phy_ethtool_ksettings_set(struct phy_device *phydev,
1552 int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
1555 int phy_disable_interrupts(struct phy_device *phydev);
1556 void phy_request_interrupt(struct phy_device *phydev);
1557 void phy_free_interrupt(struct phy_device *phydev);
1558 void phy_print_status(struct phy_device *phydev);
1559 int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
1560 void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
1561 void phy_advertise_supported(struct phy_device *phydev);
1562 void phy_support_sym_pause(struct phy_device *phydev);
1563 void phy_support_asym_pause(struct phy_device *phydev);
1564 void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
1566 void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
1567 bool phy_validate_pause(struct phy_device *phydev,
1569 void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause);
1571 s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
1588 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
1589 int phy_get_eee_err(struct phy_device *phydev);
1590 int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
1591 int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
1592 int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
1593 void phy_ethtool_get_wol(struct phy_device *phydev,
1600 int phy_package_join(struct phy_device *phydev, int addr, size_t priv_size);
1601 void phy_package_leave(struct phy_device *phydev);
1602 int devm_phy_package_join(struct device *dev, struct phy_device *phydev,
1610 int phy_ethtool_get_strings(struct phy_device *phydev, u8 *data);
1611 int phy_ethtool_get_sset_count(struct phy_device *phydev);
1612 int phy_ethtool_get_stats(struct phy_device *phydev,
1615 static inline int phy_package_read(struct phy_device *phydev, u32 regnum) in phy_package_read() argument
1617 struct phy_package_shared *shared = phydev->shared; in phy_package_read()
1622 return mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in phy_package_read()
1625 static inline int __phy_package_read(struct phy_device *phydev, u32 regnum) in __phy_package_read() argument
1627 struct phy_package_shared *shared = phydev->shared; in __phy_package_read()
1632 return __mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in __phy_package_read()
1635 static inline int phy_package_write(struct phy_device *phydev, in phy_package_write() argument
1638 struct phy_package_shared *shared = phydev->shared; in phy_package_write()
1643 return mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in phy_package_write()
1646 static inline int __phy_package_write(struct phy_device *phydev, in __phy_package_write() argument
1649 struct phy_package_shared *shared = phydev->shared; in __phy_package_write()
1654 return __mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in __phy_package_write()
1657 static inline bool __phy_package_set_once(struct phy_device *phydev, in __phy_package_set_once() argument
1660 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once()
1668 static inline bool phy_package_init_once(struct phy_device *phydev) in phy_package_init_once() argument
1670 return __phy_package_set_once(phydev, PHY_SHARED_F_INIT_DONE); in phy_package_init_once()
1673 static inline bool phy_package_probe_once(struct phy_device *phydev) in phy_package_probe_once() argument
1675 return __phy_package_set_once(phydev, PHY_SHARED_F_PROBE_DONE); in phy_package_probe_once()
1723 bool phy_driver_is_genphy(struct phy_device *phydev);
1724 bool phy_driver_is_genphy_10g(struct phy_device *phydev);