[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7/zlzcyTsF+z0cN@shell.armlinux.org.uk>
Date: Thu, 12 Jan 2023 11:48:39 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Jerry Ray <jerry.ray@...rochip.com>
Cc: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, jbe@...gutronix.de,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v6 6/6] dsa: lan9303: Migrate to PHYLINK
On Mon, Jan 09, 2023 at 03:18:49PM -0600, Jerry Ray wrote:
> +static void lan9303_phylink_get_caps(struct dsa_switch *ds, int port,
> + struct phylink_config *config)
> +{
> + struct lan9303 *chip = ds->priv;
> +
> + dev_dbg(chip->dev, "%s(%d) entered.", __func__, port);
> +
> + config->mac_capabilities = MAC_10 | MAC_100 | MAC_ASYM_PAUSE |
> + MAC_SYM_PAUSE;
You indicate that pause modes are supported, but...
> +static void lan9303_phylink_mac_link_up(struct dsa_switch *ds, int port,
> + unsigned int mode,
> + phy_interface_t interface,
> + struct phy_device *phydev, int speed,
> + int duplex, bool tx_pause,
> + bool rx_pause)
> +{
> + u32 ctl;
> +
> + /* On this device, we are only interested in doing something here if
> + * this is the xMII port. All other ports are 10/100 phys using MDIO
> + * to control there link settings.
> + */
> + if (port != 0)
> + return;
> +
> + ctl = lan9303_phy_read(ds, port, MII_BMCR);
> +
> + ctl &= ~BMCR_ANENABLE;
> +
> + if (speed == SPEED_100)
> + ctl |= BMCR_SPEED100;
> + else if (speed == SPEED_10)
> + ctl &= ~BMCR_SPEED100;
> + else
> + dev_err(ds->dev, "unsupported speed: %d\n", speed);
> +
> + if (duplex == DUPLEX_FULL)
> + ctl |= BMCR_FULLDPLX;
> + else
> + ctl &= ~BMCR_FULLDPLX;
> +
> + lan9303_phy_write(ds, port, MII_BMCR, ctl);
There is no code here to program the resolved pause modes. Is it handled
internally within the switch? (Please add a comment to this effect
either in get_caps or here.)
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists