diff options
author | Stefan Sørensen <stefan.sorensen@spectralink.com> | 2014-02-16 14:54:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-17 00:30:29 -0500 |
commit | c1b5994770ad5ae03336b5cdd1e0ad622a870a00 (patch) | |
tree | cd693347085ef9f2ff970120c8e027ef489fd10b /drivers/net/ethernet/ti/cpsw.c | |
parent | ada0f8633c5b8dad640e1a2bcb95499ec187ac17 (diff) | |
download | blackbird-op-linux-c1b5994770ad5ae03336b5cdd1e0ad622a870a00.tar.gz blackbird-op-linux-c1b5994770ad5ae03336b5cdd1e0ad622a870a00.zip |
net:cpsw: Pass unhandled ioctl's on to generic phy ioctl
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>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 1d860ce914ed..39d12535c3c6 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) |