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>] [day] [month] [year] [list]
Message-ID: <20250821082832.62943-1-parthiban.veerasooran@microchip.com>
Date: Thu, 21 Aug 2025 13:58:32 +0530
From: Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>
To: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Parthiban
 Veerasooran" <parthiban.veerasooran@...rochip.com>
Subject: [PATCH net] microchip: lan865x: fix missing ndo_eth_ioctl handler to support PHY ioctl

The LAN865x Ethernet driver is missing an .ndo_eth_ioctl implementation,
which is required to handle standard MII ioctl commands such as
SIOCGMIIREG and SIOCSMIIREG. These commands are used by userspace tools
(e.g., ethtool, mii-tool) to access and configure PHY registers.

This patch adds the lan865x_eth_ioctl() function to pass ioctl calls to
the PHY layer via phy_mii_ioctl() when the interface is up.

Without this handler, MII ioctl operations return -EINVAL, breaking PHY
diagnostics and configuration from userspace.

Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>
---
 drivers/net/ethernet/microchip/lan865x/lan865x.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index dd436bdff0f8..09e6a0406350 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -314,12 +314,22 @@ static int lan865x_net_open(struct net_device *netdev)
 	return 0;
 }
 
+static int lan865x_eth_ioctl(struct net_device *netdev, struct ifreq *rq,
+			     int cmd)
+{
+	if (!netif_running(netdev))
+		return -EINVAL;
+
+	return phy_mii_ioctl(netdev->phydev, rq, cmd);
+}
+
 static const struct net_device_ops lan865x_netdev_ops = {
 	.ndo_open		= lan865x_net_open,
 	.ndo_stop		= lan865x_net_close,
 	.ndo_start_xmit		= lan865x_send_packet,
 	.ndo_set_rx_mode	= lan865x_set_multicast_list,
 	.ndo_set_mac_address	= lan865x_set_mac_address,
+	.ndo_eth_ioctl          = lan865x_eth_ioctl,
 };
 
 static int lan865x_probe(struct spi_device *spi)

base-commit: 62a2b3502573091dc5de3f9acd9e47f4b5aac9a1
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ