@@ -6224,19 +6224,26 @@ static const struct phylink_pcs_ops mvpp2_phylink_xlg_pcs_ops = {
6224
6224
.pcs_config = mvpp2_xlg_pcs_config ,
6225
6225
};
6226
6226
6227
- static int mvpp2_gmac_pcs_validate (struct phylink_pcs * pcs ,
6228
- unsigned long * supported ,
6229
- const struct phylink_link_state * state )
6227
+ static unsigned int mvpp2_gmac_pcs_inband_caps (struct phylink_pcs * pcs ,
6228
+ phy_interface_t interface )
6230
6229
{
6231
- /* When in 802.3z mode, we must have AN enabled:
6230
+ /* When operating in an 802.3z mode, we must have AN enabled:
6232
6231
* Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ...
6233
6232
* When <PortType> = 1 (1000BASE-X) this field must be set to 1.
6233
+ * Therefore, inband is "required".
6234
6234
*/
6235
- if (phy_interface_mode_is_8023z (state -> interface ) &&
6236
- !phylink_test (state -> advertising , Autoneg ))
6237
- return - EINVAL ;
6235
+ if (phy_interface_mode_is_8023z (interface ))
6236
+ return LINK_INBAND_ENABLE ;
6238
6237
6239
- return 0 ;
6238
+ /* SGMII and RGMII can be configured to use inband signalling of the
6239
+ * AN result. Indicate these as "possible".
6240
+ */
6241
+ if (interface == PHY_INTERFACE_MODE_SGMII ||
6242
+ phy_interface_mode_is_rgmii (interface ))
6243
+ return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE ;
6244
+
6245
+ /* For any other modes, indicate that inband is not supported. */
6246
+ return LINK_INBAND_DISABLE ;
6240
6247
}
6241
6248
6242
6249
static void mvpp2_gmac_pcs_get_state (struct phylink_pcs * pcs ,
@@ -6343,7 +6350,7 @@ static void mvpp2_gmac_pcs_an_restart(struct phylink_pcs *pcs)
6343
6350
}
6344
6351
6345
6352
static const struct phylink_pcs_ops mvpp2_phylink_gmac_pcs_ops = {
6346
- .pcs_validate = mvpp2_gmac_pcs_validate ,
6353
+ .pcs_inband_caps = mvpp2_gmac_pcs_inband_caps ,
6347
6354
.pcs_get_state = mvpp2_gmac_pcs_get_state ,
6348
6355
.pcs_config = mvpp2_gmac_pcs_config ,
6349
6356
.pcs_an_restart = mvpp2_gmac_pcs_an_restart ,
0 commit comments