RE: [PATCH net-next 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips

From: Raju.Lakkaraju
Date: Fri Sep 16 2022 - 09:10:08 EST


Hi Andrew,

Thank you for quick review comments.
By mistake I sent the wrong file.

Already V1 patch posted with fix.
i.e
[PATCH net-next V1 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips

Thanks,
Raju

-----Original Message-----
From: Andrew Lunn <andrew@xxxxxxx>
Sent: 16 September 2022 05:48 PM
To: Raju Lakkaraju - I30499 <Raju.Lakkaraju@xxxxxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Bryan Whitehead - C21958 <Bryan.Whitehead@xxxxxxxxxxxxx>; lxu@xxxxxxxxxxxxx; richardcochran@xxxxxxxxx; UNGLinuxDriver <UNGLinuxDriver@xxxxxxxxxxxxx>; Ian Saturley - M21209 <Ian.Saturley@xxxxxxxxxxxxx>
Subject: Re: [PATCH net-next 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

On Fri, Sep 16, 2022 at 01:53:27PM +0530, Raju Lakkaraju wrote:
> Add support to SGMII register dump

> +static void lan743x_get_pauseparam(struct net_device *dev,
> + struct ethtool_pauseparam *pause) {
> + struct lan743x_adapter *adapter = netdev_priv(dev);
> +
> +// pause->autoneg = adapter->pause_autoneg;
> + pause->tx_pause = adapter->pause_tx;
> + pause->rx_pause = adapter->pause_rx; }
> +
> +static int lan743x_set_pauseparam(struct net_device *dev,
> + struct ethtool_pauseparam *pause) {
> + struct lan743x_adapter *adapter = netdev_priv(dev);
> + struct phy_device *phydev = dev->phydev;
> +
> + if (pause->autoneg)
> + return -EINVAL;
> +
> + if (!phydev)
> + return -EINVAL;
> +
> + if (!phy_validate_pause(phydev, pause))
> + return -EINVAL;
> +
> + //adapter->pause_auto = pause->autoneg;
> + adapter->pause_rx = pause->rx_pause;
> + adapter->pause_tx = pause->tx_pause;
> +
> + phy_set_asym_pause(phydev, pause->rx_pause, pause->tx_pause);
> +
> + return 0;
> }

This is not part of register dumping...

> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -25,6 +25,22 @@
> #define PCS_POWER_STATE_DOWN 0x6
> #define PCS_POWER_STATE_UP 0x4
>
> +static int lan743x_sgmii_read(struct lan743x_adapter *adapter,
> + u8 mmd, u16 addr); int
> +lan743x_sgmii_dump_read(struct lan743x_adapter *adapter,
> + u8 dev, u16 adr) {
> + int ret;
> +
> + ret = lan743x_sgmii_read(adapter, dev, adr);
> + if (ret < 0) {
> + pr_warn("SGMII read fail\n");

Better to use netdev_warn(), so we know which devices has read problems.

Andrew