Thread (5 messages) flat view 5 messages, 2 authors, 2022-09-16

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

From: <hidden>
Date: 2022-09-16 13:10:08
Also in: lkml

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@lunn.ch> 
Sent: 16 September 2022 05:48 PM
To: Raju Lakkaraju - I30499 <redacted>
Cc: netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org; linux-kernel@vger.kernel.org; Bryan Whitehead - C21958 <Bryan.Whitehead@microchip.com>; lxu@maxlinear.com; richardcochran@gmail.com; UNGLinuxDriver <UNGLinuxDriver@microchip.com>; Ian Saturley - M21209 <redacted>
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...
quoted hunk ↗ jump to hunk
--- 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help