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]
Date:   Tue, 17 Dec 2019 06:43:09 +0000
From:   Radhey Shyam Pandey <radheys@...inx.com>
To:     Richard Cochran <richardcochran@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        David Miller <davem@...emloft.net>,
        Michal Simek <michals@...inx.com>
Subject: RE: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy.

> -----Original Message-----
> From: Richard Cochran <richardcochran@...il.com>
> Sent: Tuesday, December 17, 2019 12:03 AM
> To: netdev@...r.kernel.org
> Cc: linux-arm-kernel@...ts.infradead.org; David Miller
> <davem@...emloft.net>; Michal Simek <michals@...inx.com>; Radhey
> Shyam Pandey <radheys@...inx.com>
> Subject: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy.
> 
> In order to allow PHY drivers to handle ioctls, the MAC driver must pass
> the calls through.  However, the axienet driver does not support ioctls
> at all.  This patch fixes the issue by handing off the invocations to the
> PHY appropriately.
> 
> Signed-off-by: Richard Cochran <richardcochran@...il.com>
> ---
>  .../net/ethernet/xilinx/xilinx_axienet_main.c  | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 05fa7371c39a..d0b996f220f5 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1067,6 +1067,23 @@ static int axienet_change_mtu(struct net_device
> *ndev, int new_mtu)
>  	return 0;
>  }
> 
> +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
> +{
> +	if (!netif_running(dev))
> +		return -EINVAL;
> +
> +	switch (cmd) {
> +	case SIOCGMIIPHY:
> +	case SIOCGMIIREG:
> +	case SIOCSMIIREG:
> +	case SIOCSHWTSTAMP:
For hw timestamp we are passing the request to phy?

> +	case SIOCGHWTSTAMP:
> +		return phy_mii_ioctl(dev->phydev, rq, cmd);

Driver migrated to phylink so now we have to use phylink_mii_ioctl.

> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +}
> +
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>  /**
>   * axienet_poll_controller - Axi Ethernet poll mechanism.
> @@ -1095,6 +1112,7 @@ static const struct net_device_ops
> axienet_netdev_ops = {
>  	.ndo_set_mac_address = netdev_set_mac_address,
>  	.ndo_validate_addr = eth_validate_addr,
>  	.ndo_set_rx_mode = axienet_set_multicast_list,
> +	.ndo_do_ioctl = axienet_ioctl,
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>  	.ndo_poll_controller = axienet_poll_controller,
>  #endif
> --
> 2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ