[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2364571-dff9-2654-5160-a37d9f48ba9b@gmail.com>
Date: Mon, 24 May 2021 19:16:20 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <olteanv@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next 02/13] net: dsa: sja1105: allow SGMII PCS
configuration to be per port
On 5/24/2021 4:22 PM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> The SJA1105 R and S switches have 1 SGMII port (port 4). Because there
> is only one such port, there is no "port" parameter in the configuration
> code for the SGMII PCS.
>
> However, the SJA1110 can have up to 4 SGMII ports, each with its own
> SGMII register map. So we need to generalize the logic.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
[snip]
>
> - if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT)) {
> - bool an_enabled = !!(bmcr & BMCR_ANENABLE);
> + if (!sja1105_supports_sgmii(priv, i))
> + continue;
> +
> + an_enabled = !!(bmcr[i] & BMCR_ANENABLE);
Nit you could have a temporary bmcr variable here in the loop which
aliases bmcr[i] just for the sake of reducing the diff to review.
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists