Skip to content

Commit d4169f0

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: mvpp2: implement pcs_inband_caps() method
Report the PCS in-band capabilities to phylink for Marvell PP2 interfaces. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 513e8fb commit d4169f0

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6224,19 +6224,26 @@ static const struct phylink_pcs_ops mvpp2_phylink_xlg_pcs_ops = {
62246224
.pcs_config = mvpp2_xlg_pcs_config,
62256225
};
62266226

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)
62306229
{
6231-
/* When in 802.3z mode, we must have AN enabled:
6230+
/* When operating in an 802.3z mode, we must have AN enabled:
62326231
* Bit 2 Field InBandAnEn In-band Auto-Negotiation enable. ...
62336232
* When <PortType> = 1 (1000BASE-X) this field must be set to 1.
6233+
* Therefore, inband is "required".
62346234
*/
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;
62386237

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;
62406247
}
62416248

62426249
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)
63436350
}
63446351

63456352
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,
63476354
.pcs_get_state = mvpp2_gmac_pcs_get_state,
63486355
.pcs_config = mvpp2_gmac_pcs_config,
63496356
.pcs_an_restart = mvpp2_gmac_pcs_an_restart,

0 commit comments

Comments
 (0)