Subject: Re: [PATCH v6 net-next 06/10] net: dsa: microchip: add support for phylink management

From: "Russell King (Oracle)" <[email-masked]>
Date: Fri, 29 Oct 2021 09:21:35 +0100

Hi,

Sorry for missing this.

The use of bitmap_foo() seems to have not been commented on, which
are now unnecessary as linkmode_foo() helpers were added in
b31cdffa2329 ("net: phy: Move linkmode helpers to somewhere public").

On Fri, Oct 29, 2021 at 10:52:52AM +0530, Prasanna Vengateshan wrote:
> +static void lan937x_phylink_validate(struct dsa_switch *ds, int port,
> +				     unsigned long *supported,
> +				     struct phylink_link_state *state)
> +{
> +	struct ksz_device *dev = ds->priv;
> +	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
> +
> +	/* Check for unsupported interfaces */
> +	if (!phy_interface_mode_is_rgmii(state->interface) &&
> +	    state->interface != PHY_INTERFACE_MODE_RMII &&
> +	    state->interface != PHY_INTERFACE_MODE_MII &&
> +	    state->interface != PHY_INTERFACE_MODE_NA &&
> +	    state->interface != PHY_INTERFACE_MODE_INTERNAL) {
> +		bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);

		linkmode_zero(supported);

...
> +
> +	bitmap_and(supported, supported, mask, __ETHTOOL_LINK_MODE_MASK_NBITS);
> +	bitmap_and(state->advertising, state->advertising, mask,
> +		   __ETHTOOL_LINK_MODE_MASK_NBITS);

	linkmode_and(supported, supported, mask);
	linkmode_and(state->advertising, state->advertising, mask);

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!