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: <646c6431-274f-4923-ab9d-bf0116645745@redhat.com>
Date: Thu, 28 Aug 2025 09:24:17 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>,
 andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] microchip: lan865x: add ndo_eth_ioctl handler to
 enable PHY ioctl support

On 8/22/25 10:50 AM, Parthiban Veerasooran wrote:
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index 84c41f193561..7f586f9558ff 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -320,12 +320,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,

It looks like you could use directly phy_do_ioctl_running() and avoid
some code duplication.

/P


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ