diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2018-03-30 09:44:00 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-13 19:48:34 +0200 |
commit | 2463af64c2b445e10e0c3f5a2f4c4db49dabc114 (patch) | |
tree | 28591a9d8e2dc6b84dce1acc69c2dbfc846bdcaf | |
parent | 827148d08d43bce95fda03b462e213fc0094c8b1 (diff) | |
download | linux-stable-2463af64c2b445e10e0c3f5a2f4c4db49dabc114.tar.gz linux-stable-2463af64c2b445e10e0c3f5a2f4c4db49dabc114.tar.bz2 linux-stable-2463af64c2b445e10e0c3f5a2f4c4db49dabc114.zip |
vlan: also check phy_driver ts_info for vlan's real device
[ Upstream commit ec1d8ccb07deaf30fd0508af6755364ac47dc08d ]
Just like function ethtool_get_ts_info(), we should also consider the
phy_driver ts_info call back. For example, driver dp83640.
Fixes: 37dd9255b2f6 ("vlan: Pass ethtool get_ts_info queries to real device.")
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/8021q/vlan_dev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 767144128b95..fb3e2a50d76e 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -29,6 +29,7 @@ #include <linux/net_tstamp.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> +#include <linux/phy.h> #include <net/arp.h> #include <net/switchdev.h> @@ -658,8 +659,11 @@ static int vlan_ethtool_get_ts_info(struct net_device *dev, { const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); const struct ethtool_ops *ops = vlan->real_dev->ethtool_ops; + struct phy_device *phydev = vlan->real_dev->phydev; - if (ops->get_ts_info) { + if (phydev && phydev->drv && phydev->drv->ts_info) { + return phydev->drv->ts_info(phydev, info); + } else if (ops->get_ts_info) { return ops->get_ts_info(vlan->real_dev, info); } else { info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | |