All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>, netdev@vger.kernel.org
Subject: Re: [PATCH CFT net-next] net: enetc: use .mac_select_pcs() interface
Date: Fri, 7 Jan 2022 13:41:20 +0000	[thread overview]
Message-ID: <YdhDAHxFaUhiQFbd@shell.armlinux.org.uk> (raw)
In-Reply-To: <E1mxq4r-00GWrp-Ay@rmk-PC.armlinux.org.uk>

On Thu, Dec 16, 2021 at 12:41:41PM +0000, Russell King (Oracle) wrote:
> Convert the PCS selection to use mac_select_pcs, which allows the PCS
> to perform any validation it needs.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Hi,

Can anyone test this please? Claudiu?

Russell.

> ---
>  drivers/net/ethernet/freescale/enetc/enetc_pf.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
> index fe6a544f37f0..1f5bc8fe0a3c 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
> @@ -930,18 +930,21 @@ static void enetc_mdiobus_destroy(struct enetc_pf *pf)
>  	enetc_imdio_remove(pf);
>  }
>  
> +static struct phylink_pcs *
> +enetc_pl_mac_select_pcs(struct phylink_config *config, phy_interface_t iface)
> +{
> +	struct enetc_pf *pf = phylink_to_enetc_pf(config);
> +
> +	return pf->pcs ? &pf->pcs->pcs : NULL;
> +}
> +
>  static void enetc_pl_mac_config(struct phylink_config *config,
>  				unsigned int mode,
>  				const struct phylink_link_state *state)
>  {
>  	struct enetc_pf *pf = phylink_to_enetc_pf(config);
> -	struct enetc_ndev_priv *priv;
>  
>  	enetc_mac_config(&pf->si->hw, state->interface);
> -
> -	priv = netdev_priv(pf->si->ndev);
> -	if (pf->pcs)
> -		phylink_set_pcs(priv->phylink, &pf->pcs->pcs);
>  }
>  
>  static void enetc_force_rgmii_mac(struct enetc_hw *hw, int speed, int duplex)
> @@ -1058,6 +1061,7 @@ static void enetc_pl_mac_link_down(struct phylink_config *config,
>  
>  static const struct phylink_mac_ops enetc_mac_phylink_ops = {
>  	.validate = phylink_generic_validate,
> +	.mac_select_pcs = enetc_pl_mac_select_pcs,
>  	.mac_config = enetc_pl_mac_config,
>  	.mac_link_up = enetc_pl_mac_link_up,
>  	.mac_link_down = enetc_pl_mac_link_down,
> -- 
> 2.30.2
> 
> 

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

  reply	other threads:[~2022-01-07 13:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 12:41 [PATCH CFT net-next] net: enetc: use .mac_select_pcs() interface Russell King (Oracle)
2022-01-07 13:41 ` Russell King (Oracle) [this message]
2022-01-10 17:37   ` Claudiu Manoil
2022-01-11  8:27     ` Claudiu Manoil
2022-01-11  9:56     ` Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YdhDAHxFaUhiQFbd@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.