Skip to content

Commit

Permalink
vlan: also check phy_driver ts_info for vlan's real device
Browse files Browse the repository at this point in the history
Just like function ethtool_get_ts_info(), we should also consider the
phy_driver ts_info call back. For example, driver dp83640.

Fixes: 37dd925 ("vlan: Pass ethtool get_ts_info queries to real device.")
Acked-by: Richard Cochran <[email protected]>
Signed-off-by: Hangbin Liu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
liuhangbin authored and davem330 committed Apr 2, 2018
1 parent c0b458a commit ec1d8cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -665,8 +666,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 |
Expand Down

0 comments on commit ec1d8cc

Please sign in to comment.