diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2018-03-29 21:44:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-01 20:53:50 -0400 |
commit | ec1d8ccb07deaf30fd0508af6755364ac47dc08d (patch) | |
tree | 487d6a86e7a1b49f58d8bd611d169749016930ba | |
parent | c0b458a9463bd6be165374a8e9e3235800ee132e (diff) |
vlan: also check phy_driver ts_info for vlan's real device
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>
-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 f7e83f6d2e64..236452ebbd9e 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/net_tstamp.h> | 29 | #include <linux/net_tstamp.h> |
30 | #include <linux/etherdevice.h> | 30 | #include <linux/etherdevice.h> |
31 | #include <linux/ethtool.h> | 31 | #include <linux/ethtool.h> |
32 | #include <linux/phy.h> | ||
32 | #include <net/arp.h> | 33 | #include <net/arp.h> |
33 | #include <net/switchdev.h> | 34 | #include <net/switchdev.h> |
34 | 35 | ||
@@ -665,8 +666,11 @@ static int vlan_ethtool_get_ts_info(struct net_device *dev, | |||
665 | { | 666 | { |
666 | const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); | 667 | const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); |
667 | const struct ethtool_ops *ops = vlan->real_dev->ethtool_ops; | 668 | const struct ethtool_ops *ops = vlan->real_dev->ethtool_ops; |
669 | struct phy_device *phydev = vlan->real_dev->phydev; | ||
668 | 670 | ||
669 | if (ops->get_ts_info) { | 671 | if (phydev && phydev->drv && phydev->drv->ts_info) { |
672 | return phydev->drv->ts_info(phydev, info); | ||
673 | } else if (ops->get_ts_info) { | ||
670 | return ops->get_ts_info(vlan->real_dev, info); | 674 | return ops->get_ts_info(vlan->real_dev, info); |
671 | } else { | 675 | } else { |
672 | info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | | 676 | info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | |