diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-08-21 13:04:32 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-04-16 16:51:04 +0100 |
commit | 2c621b33b510f6b9adbadcf1eec01cdf62fa9bd6 (patch) | |
tree | 715513a18cdbd2ddcf32482ad6e661435d8790f7 /include | |
parent | 5de9ed47abfe7547ff008e97992ba2650e47a20d (diff) |
net: phy: add phy_query_inband()
Add a method to query the PHY's in-band capabilities for a PHY
interface mode. This can be used to determine for the specified
interface mode whether in-band signalling is supported, and whether
the PHY requires in-band signalling.
When not implemented, or the PHY driver doesn't report any modes
for the interface, LINK_INBAND_VALID will not be set. When set, the
remainder of the flags can be interpreted.
LINK_INBAND_POSSIBLE means that the device can be configured to use
or not use in-band signalling. Later patches may add support to
configure this at the PHY.
LINK_INBAND_REQUIRED means that the device uses in-band signalling
which can not be disabled.
When only LINK_INBAND_VALID has been set, this means that the device
does not support any in-band signalling, and can't be configured to
do so.
"Bypass" mode (where the device may be configured for in-band, but
may still bring the link up if there is no in-band received from the
link partner) is not considered in this patch.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/phy.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index d341e0a055ba..53cbf3957713 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -796,6 +796,24 @@ struct phy_tdr_config { #define PHY_PAIR_ALL -1 /** + * enum link_inband_signalling - inband signalling modes that are supported + * + * @LINK_INBAND_VALID: inband signalling report is valid + * @LINK_INBAND_POSSIBLE: inband signalling can be used + * @LINK_INBAND_REQUIRED: inband signalling is required + * + * The possible and required bits can only be used if the valid bit is set. + * If possible is clear, that means inband signalling can not be used. + * Required is only valid when possible is set, and means that inband + * signalling must be used. + */ +enum link_inband_signalling { + LINK_INBAND_VALID = BIT(0), + LINK_INBAND_POSSIBLE = BIT(1), + LINK_INBAND_REQUIRED = BIT(2), +}; + +/** * struct phy_plca_cfg - Configuration of the PLCA (Physical Layer Collision * Avoidance) Reconciliation Sublayer. * @@ -925,6 +943,14 @@ struct phy_driver { int (*get_features)(struct phy_device *phydev); /** + * @query_inband: query whether inband is supported for the given PHY + * interface mode. Returns a bitmask of bits defined by enum + * link_inband_signalling. + */ + unsigned int (*query_inband)(struct phy_device *phydev, + phy_interface_t interface); + + /** * @get_rate_matching: Get the supported type of rate matching for a * particular phy interface. This is used by phy consumers to determine * whether to advertise lower-speed modes for that interface. It is @@ -1744,6 +1770,8 @@ int phy_config_aneg(struct phy_device *phydev); int _phy_start_aneg(struct phy_device *phydev); int phy_start_aneg(struct phy_device *phydev); int phy_aneg_done(struct phy_device *phydev); +unsigned int phy_query_inband(struct phy_device *phydev, + phy_interface_t interface); int phy_speed_down(struct phy_device *phydev, bool sync); int phy_speed_up(struct phy_device *phydev); bool phy_check_valid(int speed, int duplex, unsigned long *features); |