Subject: Re: [PATCH net-next 1/3] net: phy: marvell10g: add mdix control

From: Antoine Tenart <[email-masked]>
Date: Tue, 3 Mar 2020 16:09:58 +0100

Hello Russell,

On Tue, Mar 03, 2020 at 02:43:57PM +0000, Russell King wrote:
>  
> +static int mv3310_config_mdix(struct phy_device *phydev)
> +{
> +	u16 val;
> +	int err;
> +
> +	switch (phydev->mdix_ctrl) {
> +	case ETH_TP_MDI_AUTO:
> +		val = MV_PCS_CSCR1_MDIX_AUTO;
> +		break;
> +	case ETH_TP_MDI_X:
> +		val = MV_PCS_CSCR1_MDIX_MDIX;
> +		break;
> +	case ETH_TP_MDI:
> +		val = MV_PCS_CSCR1_MDIX_MDI;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	err = phy_modify_mmd_changed(phydev, MDIO_MMD_PCS, MV_PCS_CSCR1,
> +				     MV_PCS_CSCR1_MDIX_MASK, val);
> +	if (err < 0)
> +		return err;
> +
> +	return mv3310_maybe_reset(phydev, MV_PCS_BASE_T, err > 0);

This helper is only introduced in patch 2.

Thanks,
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com