diff options
author | Vicentiu Galanopulo <vicentiu.galanopulo@nxp.com> | 2017-11-07 14:15:03 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-12-12 07:32:32 (GMT) |
commit | c533b864abd878475a65f27931a67888b3f439e3 (patch) | |
tree | f11794b81aaa667494e3ff228e73402fe82ab06a | |
parent | 69482aa5527e5d1fd80501a365b11c4b45c4f49f (diff) | |
download | linux-c533b864abd878475a65f27931a67888b3f439e3.tar.xz |
Added MII IOCTL support for SIOCGMIIREG
Signed-off-by: Vicentiu Galanopulo <vicentiu.galanopulo@nxp.com>
-rw-r--r-- | drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c index b315dda..bbaf29c 100644 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c @@ -469,14 +469,18 @@ int dpa_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) #ifdef CONFIG_FSL_DPAA_1588 struct dpa_priv_s *priv = netdev_priv(dev); #endif - int ret = 0; + int ret = -EINVAL; - /* at least one timestamping feature must be enabled */ -#ifdef CONFIG_FSL_DPAA_TS if (!netif_running(dev)) -#endif return -EINVAL; + if (cmd == SIOCGMIIREG) { + if (!dev->phydev) + ret = -EINVAL; + else + ret = phy_mii_ioctl(dev->phydev, rq, cmd); + } + #ifdef CONFIG_FSL_DPAA_TS if (cmd == SIOCSHWTSTAMP) return dpa_ts_ioctl(dev, rq, cmd); |