lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YyRpij7ahB0cqWyy@lunn.ch>
Date:   Fri, 16 Sep 2022 14:18:18 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        linux-kernel@...r.kernel.org, bryan.whitehead@...rochip.com,
        lxu@...linear.com, richardcochran@...il.com,
        UNGLinuxDriver@...rochip.com, Ian.Saturley@...rochip.com
Subject: Re: [PATCH net-next 2/2] net: lan743x: Add support to SGMII register
 dump for PCI11010/PCI11414 chips

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ