Lines Matching +full:10 +full:gbase +full:- +full:kr

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Based on code in sungem_phy.c and (long-removed) gianfar_phy.c
73 * Set phydev->irq to PHY_POLL if interrupts are not supported,
77 #define PHY_POLL -1
78 #define PHY_MAC_INTERRUPT -2
86 * enum phy_interface_t - Interface Mode definitions
88 * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch
90 * @PHY_INTERFACE_MODE_MII: Median-independent interface
91 * @PHY_INTERFACE_MODE_GMII: Gigabit median-independent interface
92 * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface
97 * @PHY_INTERFACE_MODE_RGMII: Reduced gigabit media-independent interface
103 * @PHY_INTERFACE_MODE_XGMII: 10 gigabit media-independent interface
104 * @PHY_INTERFACE_MODE_XLGMII:40 gigabit media-independent interface
113 * @PHY_INTERFACE_MODE_XAUI: 10 Gigabit Attachment Unit Interface
114 * @PHY_INTERFACE_MODE_10GBASER: 10G BaseR
116 * @PHY_INTERFACE_MODE_USXGMII: Universal Serial 10GE MII
117 * @PHY_INTERFACE_MODE_10GKR: 10GBASE-KR - with Clause 73 AN
149 /* 10GBASE-R, XFI, SFI - single lane 10G Serdes */
153 /* 10GBASE-KR - with Clause 73 AN */
159 * phy_supported_speeds - return all speeds currently supported by a PHY device
166 * phy_modes - map phy_interface_t enum to device tree binding of phy-mode
170 * into the device tree binding of 'phy-mode', so that Ethernet
189 return "rev-mii"; in phy_modes()
193 return "rev-rmii"; in phy_modes()
197 return "rgmii-id"; in phy_modes()
199 return "rgmii-rxid"; in phy_modes()
201 return "rgmii-txid"; in phy_modes()
217 return "1000base-x"; in phy_modes()
219 return "2500base-x"; in phy_modes()
221 return "5gbase-r"; in phy_modes()
227 return "10gbase-r"; in phy_modes()
229 return "25gbase-r"; in phy_modes()
233 return "10gbase-kr"; in phy_modes()
235 return "100base-x"; in phy_modes()
243 #define PHY_FORCE_TIMEOUT 10
259 * struct mdio_bus_stats - Statistics counters for MDIO busses
276 * struct phy_package_shared - Shared information in PHY packages
307 * struct mii_bus - Represents an MDIO bus
392 * mdiobus_alloc - Allocate an MDIO bus structure
424 * enum phy_state - PHY state machine states:
429 * - PHY driver probe function will set the state to @PHY_READY
434 * - start will set the state to UP
438 * - timer moves to @PHY_NOLINK or @PHY_RUNNING
441 * - irq or timer will set @PHY_RUNNING if link comes back
442 * - phy_stop moves to @PHY_HALTED
446 * - irq or timer will set @PHY_NOLINK if link goes down
447 * - phy_stop moves to @PHY_HALTED
453 * - phy_stop aborts the running test and moves to @PHY_HALTED
457 * - phy_start moves to @PHY_UP
472 * struct phy_c45_device_ids - 802.3-c45 Device Identifiers
487 * struct phy_device - An instance of a PHY
492 * @c45_ids: 802.3-c45 Device Identifiers if is_c45.
506 * @dev_flags: Device-specific flags used by the PHY driver.
512 * @irq: IRQ number of the PHY's interrupt (-1 if none)
634 * -1 means no interrupt
681 * struct phy_tdr_config - Configuration of a TDR raw test
699 #define PHY_PAIR_ALL -1
702 * struct phy_driver - Driver structure for a particular PHY type
746 * up device-specific structures, if any
752 * abilities it has. Should only set phydev->supported.
764 * autonegotiation if phydev->autoneg is on,
766 * if phydev->autoneg is off
797 * @set_wol: Some devices (e.g. qnap TS-119P II) require PHY
852 * within a plug-in module
858 * @module_eeprom: Get the eeprom information from the plug-in
909 #define PHY_ID_MATCH_VENDOR(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10)
942 * phy_is_started - Convenience function to check whether PHY is started
947 return phydev->state >= PHY_UP; in phy_is_started()
955 * phy_read - Convenience function for reading a given PHY register
965 return mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in phy_read()
982 * __phy_read - convenience function for reading a given PHY register
990 return __mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in __phy_read()
994 * phy_write - Convenience function for writing a given PHY register
1005 return mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, val); in phy_write()
1009 * __phy_write - Convenience function for writing a given PHY register
1018 return __mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, in __phy_write()
1023 * __phy_modify_changed() - Convenience function for modifying a PHY register
1037 return __mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr, in __phy_modify_changed()
1042 * phy_read_mmd - Convenience function for reading a register
1048 * phy_read_mmd_poll_timeout - Periodically poll a PHY register until a
1057 * tight-loops). Should be less than ~20ms since usleep_range
1058 * is used (see Documentation/timers/timers-howto.rst).
1061 * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
1079 * __phy_read_mmd - Convenience function for reading a register
1085 * phy_write_mmd - Convenience function for writing a register
1091 * __phy_write_mmd - Convenience function for writing a register
1113 * __phy_set_bits - Convenience function for setting bits in a PHY register
1126 * __phy_clear_bits - Convenience function for clearing bits in a PHY register
1140 * phy_set_bits - Convenience function for setting bits in a PHY register
1151 * phy_clear_bits - Convenience function for clearing bits in a PHY register
1162 * __phy_set_bits_mmd - Convenience function for setting bits in a register
1178 * __phy_clear_bits_mmd - Convenience function for clearing bits in a register
1194 * phy_set_bits_mmd - Convenience function for setting bits in a register
1208 * phy_clear_bits_mmd - Convenience function for clearing bits in a register
1222 * phy_interrupt_is_valid - Convenience function for testing a given PHY irq
1230 return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT; in phy_interrupt_is_valid()
1234 * phy_polling_mode - Convenience function for testing whether polling is
1240 if (phydev->state == PHY_CABLETEST) in phy_polling_mode()
1241 if (phydev->drv->flags & PHY_POLL_CABLE_TEST) in phy_polling_mode()
1244 return phydev->irq == PHY_POLL; in phy_polling_mode()
1248 * phy_has_hwtstamp - Tests whether a PHY time stamp configuration.
1253 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp; in phy_has_hwtstamp()
1257 * phy_has_rxtstamp - Tests whether a PHY supports receive time stamping.
1262 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp; in phy_has_rxtstamp()
1266 * phy_has_tsinfo - Tests whether a PHY reports time stamping and/or
1272 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info; in phy_has_tsinfo()
1276 * phy_has_txtstamp - Tests whether a PHY supports transmit time stamping.
1281 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp; in phy_has_txtstamp()
1286 return phydev->mii_ts->hwtstamp(phydev->mii_ts, ifr); in phy_hwtstamp()
1292 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type); in phy_rxtstamp()
1298 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); in phy_ts_info()
1304 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type); in phy_txtstamp()
1308 * phy_is_internal - Convenience function for testing if a PHY is internal
1313 return phydev->is_internal; in phy_is_internal()
1317 * phy_on_sfp - Convenience function for testing if a PHY is on an SFP module
1322 return phydev->is_on_sfp_module; in phy_on_sfp()
1326 * phy_interface_mode_is_rgmii - Convenience function for testing if a
1337 * phy_interface_mode_is_8023z() - does the PHY interface mode use 802.3z
1341 * Returns true if the PHY interface mode uses the 16-bit negotiation
1342 * word as defined in 802.3z. (See 802.3-2015 37.2.1 Config_Reg encoding)
1351 * phy_interface_is_rgmii - Convenience function for testing if a PHY interface
1357 return phy_interface_mode_is_rgmii(phydev->interface); in phy_interface_is_rgmii()
1361 * phy_is_pseudo_fixed_link - Convenience function for testing if this
1367 return phydev->is_pseudo_fixed_link; in phy_is_pseudo_fixed_link()
1480 return -EOPNOTSUPP; in phy_start_cable_test()
1488 return -EOPNOTSUPP; in phy_start_cable_test_tdr()
1498 mdio_device_reset(&phydev->mdio, value); in phy_device_reset()
1502 dev_err(&_phydev->mdio.dev, format, ##args)
1505 dev_info(&_phydev->mdio.dev, format, ##args)
1508 dev_warn(&_phydev->mdio.dev, format, ##args)
1511 dev_dbg(&_phydev->mdio.dev, format, ##args)
1515 return dev_name(&phydev->mdio.dev); in phydev_name()
1520 mutex_lock(&phydev->mdio.bus->mdio_lock); in phy_lock_mdio_bus()
1525 mutex_unlock(&phydev->mdio.bus->mdio_lock); in phy_unlock_mdio_bus()
1596 if (!phydev->drv) in phy_read_status()
1597 return -EIO; in phy_read_status()
1599 if (phydev->drv->read_status) in phy_read_status()
1600 return phydev->drv->read_status(phydev); in phy_read_status()
1686 struct phy_package_shared *shared = phydev->shared; in phy_package_read()
1689 return -EIO; in phy_package_read()
1691 return mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in phy_package_read()
1696 struct phy_package_shared *shared = phydev->shared; in __phy_package_read()
1699 return -EIO; in __phy_package_read()
1701 return __mdiobus_read(phydev->mdio.bus, shared->addr, regnum); in __phy_package_read()
1707 struct phy_package_shared *shared = phydev->shared; in phy_package_write()
1710 return -EIO; in phy_package_write()
1712 return mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in phy_package_write()
1718 struct phy_package_shared *shared = phydev->shared; in __phy_package_write()
1721 return -EIO; in __phy_package_write()
1723 return __mdiobus_write(phydev->mdio.bus, shared->addr, regnum, val); in __phy_package_write()
1729 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once()
1734 return !test_and_set_bit(b, &shared->flags); in __phy_package_set_once()
1769 * phy_module_driver() - Helper macro for registering PHY drivers