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:	Sun, 16 Feb 2014 19:13:20 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Stefan Sørensen 
	<stefan.sorensen@...ctralink.com>
Cc:	mugunthanvnm@...com, davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH v3] net:cpsw: Pass unhandled ioctl's on to generic phy
 ioctl

On Sun, 2014-02-16 at 14:54 +0100, Stefan Sørensen wrote:
> This patch allows the use of a generic timestamping phy connected
> to the cpsw if CPTS support is not enabled. This also adds support
> of the SIOCGMIIREG and SIOCSMIIREG, and moves handling of SIOCGMIIPHY
> to the generic driver.
> 
> Signed-off-by: Stefan Sørensen <stefan.sorensen@...ctralink.com>

Reviewed-by: Ben Hutchings <ben@...adent.org.uk>

> ---
> Changes since v2:
>   - Return -EOPNOTSUPP on unsupported request
> Changes since v1:
>   - Remove SIOCGMIIPHY from cpsw
>   - Mention that SIOCGMIIREG and SIOCSMIIREG support is gained
> 
>  drivers/net/ethernet/ti/cpsw.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 1d860ce..39d1253 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1471,7 +1471,6 @@ static int cpsw_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
>  static int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
>  {
>  	struct cpsw_priv *priv = netdev_priv(dev);
> -	struct mii_ioctl_data *data = if_mii(req);
>  	int slave_no = cpsw_slave_index(priv);
>  
>  	if (!netif_running(dev))
> @@ -1484,14 +1483,11 @@ static int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
>  	case SIOCGHWTSTAMP:
>  		return cpsw_hwtstamp_get(dev, req);
>  #endif
> -	case SIOCGMIIPHY:
> -		data->phy_id = priv->slaves[slave_no].phy->addr;
> -		break;
> -	default:
> -		return -ENOTSUPP;
>  	}
>  
> -	return 0;
> +	if (!priv->slaves[slave_no].phy)
> +		return -EOPNOTSUPP;
> +	return phy_mii_ioctl(priv->slaves[slave_no].phy, req, cmd);
>  }
>  
>  static void cpsw_ndo_tx_timeout(struct net_device *ndev)

-- 
Ben Hutchings
Any sufficiently advanced bug is indistinguishable from a feature.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ