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: <CH2PR02MB700089E502A8C146D71C67C8C7350@CH2PR02MB7000.namprd02.prod.outlook.com>
Date:   Mon, 13 Jan 2020 06:12:10 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Andre Przywara <andre.przywara@....com>,
        "David S . Miller" <davem@...emloft.net>
CC:     Michal Simek <michals@...inx.com>,
        Robert Hancock <hancock@...systems.ca>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 09/14] net: axienet: Add mii-tool support

> -----Original Message-----
> From: Andre Przywara <andre.przywara@....com>
> Sent: Friday, January 10, 2020 5:24 PM
> To: David S . Miller <davem@...emloft.net>; Radhey Shyam Pandey
> <radheys@...inx.com>
> Cc: Michal Simek <michals@...inx.com>; Robert Hancock
> <hancock@...systems.ca>; netdev@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Subject: [PATCH 09/14] net: axienet: Add mii-tool support
> 
> mii-tool is useful for debugging, and all it requires to work is to wire
> up the ioctl ops function pointer.
> Add this to the axienet driver to enable mii-tool.
> 
> Signed-off-by: Andre Przywara <andre.przywara@....com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 7a747345e98e..64f799f3d248 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1152,6 +1152,16 @@ static void axienet_poll_controller(struct net_device
> *ndev)
>  }
>  #endif
> 
> +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
> +{
> +	struct axienet_local *lp = netdev_priv(dev);
> +
> +	if (!netif_running(dev))
> +		return -EINVAL;

I think phy ioctl should be allowed even if the device is not up. 
Or is there any specific reason for keeping it?

> +
> +	return phylink_mii_ioctl(lp->phylink, rq, cmd);
> +}
> +
>  static const struct net_device_ops axienet_netdev_ops = {
>  	.ndo_open = axienet_open,
>  	.ndo_stop = axienet_stop,
> @@ -1159,6 +1169,7 @@ static const struct net_device_ops
> axienet_netdev_ops = {
>  	.ndo_change_mtu	= axienet_change_mtu,
>  	.ndo_set_mac_address = netdev_set_mac_address,
>  	.ndo_validate_addr = eth_validate_addr,
> +	.ndo_do_ioctl = axienet_ioctl,
>  	.ndo_set_rx_mode = axienet_set_multicast_list,
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>  	.ndo_poll_controller = axienet_poll_controller,
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ