netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, bryan.whitehead@microchip.com,
	lxu@maxlinear.com, richardcochran@gmail.com,
	UNGLinuxDriver@microchip.com, Ian.Saturley@microchip.com
Subject: Re: [PATCH net-next 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips
Date: Fri, 16 Sep 2022 14:18:18 +0200	[thread overview]
Message-ID: <YyRpij7ahB0cqWyy@lunn.ch> (raw)
In-Reply-To: <20220916082327.370579-3-Raju.Lakkaraju@microchip.com>

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

  reply	other threads:[~2022-09-16 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  8:23 [PATCH net-next 0/2] net: lan743x: PCI11010 / PCI11414 devices Enhancements Raju Lakkaraju
2022-09-16  8:23 ` [PATCH net-next 1/2] net: lan743x: Remove PTP_PF_EXTTS support for non-PCI11x1x devices Raju Lakkaraju
2022-09-16  8:23 ` [PATCH net-next 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips Raju Lakkaraju
2022-09-16 12:18   ` Andrew Lunn [this message]
2022-09-16 13:09     ` Raju.Lakkaraju

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=YyRpij7ahB0cqWyy@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Ian.Saturley@microchip.com \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).