@@ -3960,20 +3960,27 @@ static struct mvneta_port *mvneta_pcs_to_port(struct phylink_pcs *pcs)
3960
3960
return container_of (pcs , struct mvneta_port , phylink_pcs );
3961
3961
}
3962
3962
3963
- static int mvneta_pcs_validate (struct phylink_pcs * pcs ,
3964
- unsigned long * supported ,
3965
- const struct phylink_link_state * state )
3963
+ static unsigned int mvneta_pcs_inband_caps (struct phylink_pcs * pcs ,
3964
+ phy_interface_t interface )
3966
3965
{
3967
- /* We only support QSGMII, SGMII, 802.3z and RGMII modes.
3968
- * When in 802.3z mode, we must have AN enabled:
3966
+ /* When operating in an 802.3z mode, we must have AN enabled:
3969
3967
* "Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ...
3970
3968
* When <PortType> = 1 (1000BASE-X) this field must be set to 1."
3969
+ * Therefore, inband is "required".
3971
3970
*/
3972
- if (phy_interface_mode_is_8023z (state -> interface ) &&
3973
- !phylink_test (state -> advertising , Autoneg ))
3974
- return - EINVAL ;
3971
+ if (phy_interface_mode_is_8023z (interface ))
3972
+ return LINK_INBAND_ENABLE ;
3975
3973
3976
- return 0 ;
3974
+ /* QSGMII, SGMII and RGMII can be configured to use inband
3975
+ * signalling of the AN result. Indicate these as "possible".
3976
+ */
3977
+ if (interface == PHY_INTERFACE_MODE_SGMII ||
3978
+ interface == PHY_INTERFACE_MODE_QSGMII ||
3979
+ phy_interface_mode_is_rgmii (interface ))
3980
+ return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE ;
3981
+
3982
+ /* For any other modes, indicate that inband is not supported. */
3983
+ return LINK_INBAND_DISABLE ;
3977
3984
}
3978
3985
3979
3986
static void mvneta_pcs_get_state (struct phylink_pcs * pcs ,
@@ -4071,7 +4078,7 @@ static void mvneta_pcs_an_restart(struct phylink_pcs *pcs)
4071
4078
}
4072
4079
4073
4080
static const struct phylink_pcs_ops mvneta_phylink_pcs_ops = {
4074
- .pcs_validate = mvneta_pcs_validate ,
4081
+ .pcs_inband_caps = mvneta_pcs_inband_caps ,
4075
4082
.pcs_get_state = mvneta_pcs_get_state ,
4076
4083
.pcs_config = mvneta_pcs_config ,
4077
4084
.pcs_an_restart = mvneta_pcs_an_restart ,
0 commit comments