diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2021-11-27 16:28:48 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-11-28 09:22:52 +0000 |
commit | ca831382f14d7af58789ed052542cbe7ce815883 (patch) | |
tree | 42996c14b34eabeeb395e70a2424ba6a6b9a90c2 | |
parent | d42dde4e40cb0a89f5d24185309b38018e7561b4 (diff) |
net: phylink: pass mode into pcs_validate()
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/phy/phylink.c | 3 | ||||
-rw-r--r-- | include/linux/phylink.h | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index e465ae6f4c4d..4bee10a7fe06 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -681,7 +681,8 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, unsigned int mode, /* Validate the link parameters with the PCS */ if (pcs->ops->pcs_validate) { - ret = pcs->ops->pcs_validate(pcs, supported, state); + ret = pcs->ops->pcs_validate(pcs, mode, supported, + state); if (ret < 0 || phylink_is_empty_linkmode(supported)) return -EINVAL; diff --git a/include/linux/phylink.h b/include/linux/phylink.h index b2619cde64f5..57d867290662 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -471,7 +471,8 @@ struct phylink_pcs { * (where necessary). */ struct phylink_pcs_ops { - int (*pcs_validate)(struct phylink_pcs *pcs, unsigned long *supported, + int (*pcs_validate)(struct phylink_pcs *pcs, unsigned int mode, + unsigned long *supported, const struct phylink_link_state *state); int (*pcs_enable)(struct phylink_pcs *pcs); void (*pcs_disable)(struct phylink_pcs *pcs); @@ -494,6 +495,7 @@ struct phylink_pcs_ops { /** * pcs_validate() - validate the link configuration. * @pcs: a pointer to a &struct phylink_pcs. + * @mode: link autonegotiation mode * @supported: ethtool bitmask for supported link modes. * @state: a const pointer to a &struct phylink_link_state. * @@ -505,8 +507,8 @@ struct phylink_pcs_ops { * Returns -EINVAL if the interface mode/autoneg mode is not supported. * Returns non-zero positive if the link state can be supported. */ -int pcs_validate(struct phylink_pcs *pcs, unsigned long *supported, - const struct phylink_link_state *state); +int pcs_validate(struct phylink_pcs *pcs, unsigned int mode, + unsigned long *supported, struct phylink_link_state *state); /** * pcs_enable() - enable the PCS. |