Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02eacbd0 authored by Richard Cochran's avatar Richard Cochran Committed by David S. Miller
Browse files

ethtool: Add a common function for drivers with transmit time stamping.



Currently, most drivers do not support transmit SO_TIMESTAMPING. For those
that do support it, there is one appropriate response to the get_ts_info
query. This patch adds a common function providing this response.

Signed-off-by: default avatarRichard Cochran <richardcochran@gmail.com>
Reviewed-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 509a7c25
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -811,6 +811,7 @@ struct net_device;


/* Some generic methods drivers may use in their ethtool_ops */
/* Some generic methods drivers may use in their ethtool_ops */
u32 ethtool_op_get_link(struct net_device *dev);
u32 ethtool_op_get_link(struct net_device *dev);
int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);


/**
/**
 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
 * ethtool_rxfh_indir_default - get default value for RX flow hash indirection
+11 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,17 @@ u32 ethtool_op_get_link(struct net_device *dev)
}
}
EXPORT_SYMBOL(ethtool_op_get_link);
EXPORT_SYMBOL(ethtool_op_get_link);


int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
{
	info->so_timestamping =
		SOF_TIMESTAMPING_TX_SOFTWARE |
		SOF_TIMESTAMPING_RX_SOFTWARE |
		SOF_TIMESTAMPING_SOFTWARE;
	info->phc_index = -1;
	return 0;
}
EXPORT_SYMBOL(ethtool_op_get_ts_info);

/* Handlers for each ethtool command */
/* Handlers for each ethtool command */


#define ETHTOOL_DEV_FEATURE_WORDS	((NETDEV_FEATURE_COUNT + 31) / 32)
#define ETHTOOL_DEV_FEATURE_WORDS	((NETDEV_FEATURE_COUNT + 31) / 32)