summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-11-27 16:28:48 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-01-18 10:17:26 +0000
commita970e2cb2b6c15695bda3dbe5f44ba76943cc3ad (patch)
tree6435d2d04ed152350f8b6fed2034630bb0efcca7
parent6602ca96d3a615bb7ee31d14f8d12c723e26f2b1 (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.c3
-rw-r--r--include/linux/phylink.h8
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 6349f6558828..c586b5e71899 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -444,7 +444,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 ff14bdabc64b..4075a11bbaa4 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -468,7 +468,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);
@@ -487,6 +488,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.
*
@@ -500,8 +502,8 @@ struct phylink_pcs_ops {
* not depend on the MAC.
* Returns 0 if the link state can be supported but does depend on the MAC.
*/
-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.