Skip to content

Commit 5ebae48

Browse files
nxpfranklidavem330
authored andcommitted
net: fec: report correct hardware stamping info to ethtool
Report correct hardware stamping capability by ethtool interface. The v1.0 ptp4l check it. Signed-off-by: Frank Li <[email protected]> Acked-by: Sascha Hauer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d0e2c55 commit 5ebae48

File tree

1 file changed

+30
-1
lines changed
  • drivers/net/ethernet/freescale

1 file changed

+30
-1
lines changed

drivers/net/ethernet/freescale/fec.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,12 +1174,41 @@ static void fec_enet_get_drvinfo(struct net_device *ndev,
11741174
strlcpy(info->bus_info, dev_name(&ndev->dev), sizeof(info->bus_info));
11751175
}
11761176

1177+
static int fec_enet_get_ts_info(struct net_device *ndev,
1178+
struct ethtool_ts_info *info)
1179+
{
1180+
struct fec_enet_private *fep = netdev_priv(ndev);
1181+
1182+
if (fep->bufdesc_ex) {
1183+
1184+
info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
1185+
SOF_TIMESTAMPING_RX_SOFTWARE |
1186+
SOF_TIMESTAMPING_SOFTWARE |
1187+
SOF_TIMESTAMPING_TX_HARDWARE |
1188+
SOF_TIMESTAMPING_RX_HARDWARE |
1189+
SOF_TIMESTAMPING_RAW_HARDWARE;
1190+
if (fep->ptp_clock)
1191+
info->phc_index = ptp_clock_index(fep->ptp_clock);
1192+
else
1193+
info->phc_index = -1;
1194+
1195+
info->tx_types = (1 << HWTSTAMP_TX_OFF) |
1196+
(1 << HWTSTAMP_TX_ON);
1197+
1198+
info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
1199+
(1 << HWTSTAMP_FILTER_ALL);
1200+
return 0;
1201+
} else {
1202+
return ethtool_op_get_ts_info(ndev, info);
1203+
}
1204+
}
1205+
11771206
static const struct ethtool_ops fec_enet_ethtool_ops = {
11781207
.get_settings = fec_enet_get_settings,
11791208
.set_settings = fec_enet_set_settings,
11801209
.get_drvinfo = fec_enet_get_drvinfo,
11811210
.get_link = ethtool_op_get_link,
1182-
.get_ts_info = ethtool_op_get_ts_info,
1211+
.get_ts_info = fec_enet_get_ts_info,
11831212
};
11841213

11851214
static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)

0 commit comments

Comments
 (0)