aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/fec.c
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@freescale.com>2013-01-06 11:25:07 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-07 22:48:11 -0500
commit5ebae4897146ea770069fe8046b30f55a37a9518 (patch)
tree1b9fb499d4593fdf07c21aff0be711b5fdc6fd0e /drivers/net/ethernet/freescale/fec.c
parentd0e2c55e7c940a3ee91e9e23a2683b593690f1e9 (diff)
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 <Frank.Li@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec.c')
-rw-r--r--drivers/net/ethernet/freescale/fec.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 0a9748b64c24..6dc20943bd05 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1174,12 +1174,41 @@ static void fec_enet_get_drvinfo(struct net_device *ndev,
1174 strlcpy(info->bus_info, dev_name(&ndev->dev), sizeof(info->bus_info)); 1174 strlcpy(info->bus_info, dev_name(&ndev->dev), sizeof(info->bus_info));
1175} 1175}
1176 1176
1177static 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
1177static const struct ethtool_ops fec_enet_ethtool_ops = { 1206static const struct ethtool_ops fec_enet_ethtool_ops = {
1178 .get_settings = fec_enet_get_settings, 1207 .get_settings = fec_enet_get_settings,
1179 .set_settings = fec_enet_set_settings, 1208 .set_settings = fec_enet_set_settings,
1180 .get_drvinfo = fec_enet_get_drvinfo, 1209 .get_drvinfo = fec_enet_get_drvinfo,
1181 .get_link = ethtool_op_get_link, 1210 .get_link = ethtool_op_get_link,
1182 .get_ts_info = ethtool_op_get_ts_info, 1211 .get_ts_info = fec_enet_get_ts_info,
1183}; 1212};
1184 1213
1185static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) 1214static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)