Lines Matching +full:5 +full:g +full:- +full:usxgmii

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Based on code in sungem_phy.c and (long-removed) gianfar_phy.c
79 * Set phydev->irq to PHY_POLL if interrupts are not supported,
83 #define PHY_POLL -1
84 #define PHY_MAC_INTERRUPT -2
93 * enum phy_interface_t - Interface Mode definitions
95 * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch
97 * @PHY_INTERFACE_MODE_MII: Media-independent interface
98 * @PHY_INTERFACE_MODE_GMII: Gigabit media-independent interface
99 * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface
104 * @PHY_INTERFACE_MODE_RGMII: Reduced gigabit media-independent interface
110 * @PHY_INTERFACE_MODE_XGMII: 10 gigabit media-independent interface
111 * @PHY_INTERFACE_MODE_XLGMII:40 gigabit media-independent interface
119 * @PHY_INTERFACE_MODE_5GBASER: 5G BaseR
122 * @PHY_INTERFACE_MODE_10GBASER: 10G BaseR
123 * @PHY_INTERFACE_MODE_25GBASER: 25G BaseR
125 * @PHY_INTERFACE_MODE_10GKR: 10GBASE-KR - with Clause 73 AN
127 * @PHY_INTERFACE_MODE_1000BASEKX: 1000Base-KX - with Clause 73 AN
160 /* 10GBASE-R, XFI, SFI - single lane 10G Serdes */
164 /* 10GBASE-KR - with Clause 73 AN */
206 * phy_supported_speeds - return all speeds currently supported by a PHY device
213 * phy_modes - map phy_interface_t enum to device tree binding of phy-mode
217 * into the device tree binding of 'phy-mode', so that Ethernet
236 return "rev-mii"; in phy_modes()
240 return "rev-rmii"; in phy_modes()
244 return "rgmii-id"; in phy_modes()
246 return "rgmii-rxid"; in phy_modes()
248 return "rgmii-txid"; in phy_modes()
266 return "1000base-x"; in phy_modes()
268 return "1000base-kx"; in phy_modes()
270 return "2500base-x"; in phy_modes()
272 return "5gbase-r"; in phy_modes()
278 return "10gbase-r"; in phy_modes()
280 return "25gbase-r"; in phy_modes()
282 return "usxgmii"; in phy_modes()
284 return "10gbase-kr"; in phy_modes()
286 return "100base-x"; in phy_modes()
312 * struct mdio_bus_stats - Statistics counters for MDIO busses
329 * struct phy_package_shared - Shared information in PHY packages
361 * struct mii_bus - Represents an MDIO bus
443 * mdiobus_alloc - Allocate an MDIO bus structure
475 * enum phy_state - PHY state machine states:
480 * - PHY driver probe function will set the state to @PHY_READY
485 * - start will set the state to UP
489 * - timer moves to @PHY_NOLINK or @PHY_RUNNING
492 * - irq or timer will set @PHY_RUNNING if link comes back
493 * - phy_stop moves to @PHY_HALTED
497 * - irq or timer will set @PHY_NOLINK if link goes down
498 * - phy_stop moves to @PHY_HALTED
504 * - phy_stop aborts the running test and moves to @PHY_HALTED
507 * - phy_start moves to @PHY_UP
510 * - phy_stop moves to @PHY_HALTED
526 * struct phy_c45_device_ids - 802.3-c45 Device Identifiers
541 * struct phy_device - An instance of a PHY
548 * @c45_ids: 802.3-c45 Device Identifiers if is_c45.
561 * @wol_enabled: Set to true if the PHY or the attached MAC have Wake-on-LAN
564 * @dev_flags: Device-specific flags used by the PHY driver.
566 * - Bits [15:0] are free to use by the PHY driver to communicate
568 * - Bits [23:16] are currently reserved for future use.
569 * - Bits [31:24] are reserved for defining generic
571 * @irq: IRQ number of the PHY's interrupt (-1 if none)
723 * -1 means no interrupt
778 * struct phy_tdr_config - Configuration of a TDR raw test
796 #define PHY_PAIR_ALL -1
799 * struct phy_plca_cfg - Configuration of the PLCA (Physical Layer Collision
802 * @version: read-only PLCA register map version. -1 = not available. Ignored
804 * IDVER register (31.CA00). -1 = not available.
805 * @enabled: PLCA configured mode (enabled/disabled). -1 = not available / don't
807 * @node_id: the PLCA local node identifier. -1 = not available / don't set.
810 * meaningful for the coordinator (node_id = 0). -1 = not available / don't
812 * @to_tmr: The value of the PLCA to_timer in bit-times, which determines the
815 * -1 = not available / don't set. Allowed values [0 .. 255].
819 * per TO, and so on. -1 = not available / don't set.
823 * greater than the MAC inter-packet gap (which is typically 96 bits).
824 * -1 = not available / don't set. Allowed values [0 .. 255].
841 * struct phy_plca_status - Status of the PLCA (Physical Layer Collision
873 * struct phy_driver - Driver structure for a particular PHY type
917 * up device-specific structures, if any
923 * abilities it has. Should only set phydev->supported.
930 * whether to advertise lower-speed modes for that interface. It is
947 * autonegotiation if phydev->autoneg is on,
949 * if phydev->autoneg is off
980 * @set_wol: Some devices (e.g. qnap TS-119P II) require PHY
1035 * within a plug-in module
1041 * @module_eeprom: Get the eeprom information from the plug-in
1098 * follows the standard LED class meaning, e.g. LED_OFF,
1121 * Return 0 if yes, -EOPNOTSUPP if not, or an error code.
1160 * phy_id_compare - compare @id1 with @id2 taking account of @mask
1174 * phydev_id_compare - compare @id with the PHY's Clause 22 ID
1184 return phy_id_compare(id, phydev->phy_id, phydev->drv->phy_id_mask); in phydev_id_compare()
1221 * phy_is_started - Convenience function to check whether PHY is started
1226 return phydev->state >= PHY_UP; in phy_is_started()
1234 * phy_read - Convenience function for reading a given PHY register
1244 return mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in phy_read()
1262 * __phy_read - convenience function for reading a given PHY register
1270 return __mdiobus_read(phydev->mdio.bus, phydev->mdio.addr, regnum); in __phy_read()
1274 * phy_write - Convenience function for writing a given PHY register
1285 return mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, val); in phy_write()
1289 * __phy_write - Convenience function for writing a given PHY register
1298 return __mdiobus_write(phydev->mdio.bus, phydev->mdio.addr, regnum, in __phy_write()
1303 * __phy_modify_changed() - Convenience function for modifying a PHY register
1317 return __mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr, in __phy_modify_changed()
1322 * phy_read_mmd - Convenience function for reading a register
1328 * phy_read_mmd_poll_timeout - Periodically poll a PHY register until a
1337 * tight-loops). Should be less than ~20ms since usleep_range
1338 * is used (see Documentation/timers/timers-howto.rst).
1341 * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
1361 * __phy_read_mmd - Convenience function for reading a register
1367 * phy_write_mmd - Convenience function for writing a register
1373 * __phy_write_mmd - Convenience function for writing a register
1395 * __phy_set_bits - Convenience function for setting bits in a PHY register
1408 * __phy_clear_bits - Convenience function for clearing bits in a PHY register
1422 * phy_set_bits - Convenience function for setting bits in a PHY register
1433 * phy_clear_bits - Convenience function for clearing bits in a PHY register
1444 * __phy_set_bits_mmd - Convenience function for setting bits in a register
1460 * __phy_clear_bits_mmd - Convenience function for clearing bits in a register
1476 * phy_set_bits_mmd - Convenience function for setting bits in a register
1490 * phy_clear_bits_mmd - Convenience function for clearing bits in a register
1504 * phy_interrupt_is_valid - Convenience function for testing a given PHY irq
1512 return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT; in phy_interrupt_is_valid()
1516 * phy_polling_mode - Convenience function for testing whether polling is
1522 if (phydev->state == PHY_CABLETEST) in phy_polling_mode()
1523 if (phydev->drv->flags & PHY_POLL_CABLE_TEST) in phy_polling_mode()
1526 return phydev->irq == PHY_POLL; in phy_polling_mode()
1530 * phy_has_hwtstamp - Tests whether a PHY time stamp configuration.
1535 return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp; in phy_has_hwtstamp()
1539 * phy_has_rxtstamp - Tests whether a PHY supports receive time stamping.
1544 return phydev && phydev->mii_ts && phydev->mii_ts->rxtstamp; in phy_has_rxtstamp()
1548 * phy_has_tsinfo - Tests whether a PHY reports time stamping and/or
1554 return phydev && phydev->mii_ts && phydev->mii_ts->ts_info; in phy_has_tsinfo()
1558 * phy_has_txtstamp - Tests whether a PHY supports transmit time stamping.
1563 return phydev && phydev->mii_ts && phydev->mii_ts->txtstamp; in phy_has_txtstamp()
1570 return phydev->mii_ts->hwtstamp(phydev->mii_ts, cfg, extack); in phy_hwtstamp()
1576 return phydev->mii_ts->rxtstamp(phydev->mii_ts, skb, type); in phy_rxtstamp()
1582 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); in phy_ts_info()
1588 phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type); in phy_txtstamp()
1592 * phy_is_internal - Convenience function for testing if a PHY is internal
1597 return phydev->is_internal; in phy_is_internal()
1601 * phy_on_sfp - Convenience function for testing if a PHY is on an SFP module
1606 return phydev->is_on_sfp_module; in phy_on_sfp()
1610 * phy_interface_mode_is_rgmii - Convenience function for testing if a
1621 * phy_interface_mode_is_8023z() - does the PHY interface mode use 802.3z
1625 * Returns true if the PHY interface mode uses the 16-bit negotiation
1626 * word as defined in 802.3z. (See 802.3-2015 37.2.1 Config_Reg encoding)
1635 * phy_interface_is_rgmii - Convenience function for testing if a PHY interface
1641 return phy_interface_mode_is_rgmii(phydev->interface); in phy_interface_is_rgmii()
1645 * phy_is_pseudo_fixed_link - Convenience function for testing if this
1651 return phydev->is_pseudo_fixed_link; in phy_is_pseudo_fixed_link()
1766 return -EOPNOTSUPP; in phy_start_cable_test()
1774 return -EOPNOTSUPP; in phy_start_cable_test_tdr()
1780 mdio_device_reset(&phydev->mdio, value); in phy_device_reset()
1784 dev_err(&_phydev->mdio.dev, format, ##args)
1787 dev_err_probe(&_phydev->mdio.dev, err, format, ##args)
1790 dev_info(&_phydev->mdio.dev, format, ##args)
1793 dev_warn(&_phydev->mdio.dev, format, ##args)
1796 dev_dbg(&_phydev->mdio.dev, format, ##args)
1800 return dev_name(&phydev->mdio.dev); in phydev_name()
1805 mutex_lock(&phydev->mdio.bus->mdio_lock); in phy_lock_mdio_bus()
1810 mutex_unlock(&phydev->mdio.bus->mdio_lock); in phy_unlock_mdio_bus()
1904 if (!phydev->drv) in phy_read_status()
1905 return -EIO; in phy_read_status()
1907 if (phydev->drv->read_status) in phy_read_status()
1908 return phydev->drv->read_status(phydev); in phy_read_status()
2008 struct phy_package_shared *shared = phydev->shared; in phy_package_address()
2009 u8 base_addr = shared->base_addr; in phy_package_address()
2011 if (addr_offset >= PHY_MAX_ADDR - base_addr) in phy_package_address()
2012 return -EIO; in phy_package_address()
2028 return mdiobus_read(phydev->mdio.bus, addr, regnum); in phy_package_read()
2039 return __mdiobus_read(phydev->mdio.bus, addr, regnum); in __phy_package_read()
2051 return mdiobus_write(phydev->mdio.bus, addr, regnum, val); in phy_package_write()
2063 return __mdiobus_write(phydev->mdio.bus, addr, regnum, val); in __phy_package_write()
2085 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once()
2090 return !test_and_set_bit(b, &shared->flags); in __phy_package_set_once()
2125 * phy_module_driver() - Helper macro for registering PHY drivers