[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618213330.982046-1-anthony.l.nguyen@intel.com>
Date: Tue, 18 Jun 2024 14:33:28 -0700
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: davem@...emloft.net,
kuba@...nel.org,
pabeni@...hat.com,
edumazet@...gle.com,
netdev@...r.kernel.org
Cc: Jackie Jone <jackie.jone@...iedtelesis.co.nz>,
anthony.l.nguyen@...el.com,
chris.packham@...iedtelesis.co.nz,
andrew@...n.ch,
Jacob Keller <jacob.e.keller@...el.com>,
Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com>
Subject: [PATCH net-next] igb: Add MII write support
From: Jackie Jone <jackie.jone@...iedtelesis.co.nz>
To facilitate running PHY parametric tests, add support for the SIOCSMIIREG
ioctl. This allows a userspace application to write to the PHY registers
to enable the test modes.
Signed-off-by: Jackie Jone <jackie.jone@...iedtelesis.co.nz>
Acked-by: Jacob Keller <jacob.e.keller@...el.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index fce2930ae6af..3af03a211c3c 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -9139,6 +9139,10 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
return -EIO;
break;
case SIOCSMIIREG:
+ if (igb_write_phy_reg(&adapter->hw, data->reg_num & 0x1F,
+ data->val_in))
+ return -EIO;
+ break;
default:
return -EOPNOTSUPP;
}
--
2.41.0
Powered by blists - more mailing lists