Skip to content

Commit

Permalink
net:cpsw: Pass unhandled ioctl's on to generic phy ioctl
Browse files Browse the repository at this point in the history
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@spectralink.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Sørensen authored and David S. Miller committed Feb 17, 2014
1 parent ada0f86 commit c1b5994
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down

0 comments on commit c1b5994

Please sign in to comment.