diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-07-15 07:13:00 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-07-15 08:02:30 -0700 |
commit | 30b3560050486275c6207c8c90c0d53a7cc73ac1 (patch) | |
tree | ba82e7543efefbd0cdfc4627f9fecc4df20b2da2 /include/linux/ethtool.h | |
parent | 9283477e28913c1e7625c0a8d6959745e2431533 (diff) | |
parent | 2111375b85ad173d58e7b8604246a3de60950ac8 (diff) | |
download | linux-stable-30b3560050486275c6207c8c90c0d53a7cc73ac1.tar.gz linux-stable-30b3560050486275c6207c8c90c0d53a7cc73ac1.tar.bz2 linux-stable-30b3560050486275c6207c8c90c0d53a7cc73ac1.zip |
Merge branch 'net-make-timestamping-selectable'
First part of "net: Make timestamping selectable" from Kory Maincent.
Change the driver-facing type already to lower rebasing pain.
Link: https://lore.kernel.org/20240709-feature_ptp_netnext-v17-0-b5317f50df2a@bootlin.com/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index a1ee76936f53..303fda54ef17 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -18,6 +18,7 @@ #include <linux/if_ether.h> #include <linux/netlink.h> #include <uapi/linux/ethtool.h> +#include <uapi/linux/net_tstamp.h> struct compat_ethtool_rx_flow_spec { u32 flow_type; @@ -706,6 +707,22 @@ struct ethtool_rxfh_param { }; /** + * struct kernel_ethtool_ts_info - kernel copy of struct ethtool_ts_info + * @cmd: command number = %ETHTOOL_GET_TS_INFO + * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags + * @phc_index: device index of the associated PHC, or -1 if there is none + * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values + * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values + */ +struct kernel_ethtool_ts_info { + u32 cmd; + u32 so_timestamping; + int phc_index; + enum hwtstamp_tx_types tx_types; + enum hwtstamp_rx_filters rx_filters; +}; + +/** * struct ethtool_ops - optional netdev operations * @cap_link_lanes_supported: indicates if the driver supports lanes * parameter. @@ -1018,7 +1035,7 @@ struct ethtool_ops { int (*get_dump_data)(struct net_device *, struct ethtool_dump *, void *); int (*set_dump)(struct net_device *, struct ethtool_dump *); - int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *); + int (*get_ts_info)(struct net_device *, struct kernel_ethtool_ts_info *); void (*get_ts_stats)(struct net_device *dev, struct ethtool_ts_stats *ts_stats); int (*get_module_info)(struct net_device *, @@ -1179,7 +1196,8 @@ int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index); /* Some generic methods drivers may use in their ethtool_ops */ u32 ethtool_op_get_link(struct net_device *dev); -int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti); +int ethtool_op_get_ts_info(struct net_device *dev, + struct kernel_ethtool_ts_info *eti); /** * ethtool_mm_frag_size_add_to_min - Translate (standard) additional fragment @@ -1228,7 +1246,8 @@ static inline int ethtool_mm_frag_size_min_to_add(u32 val_min, u32 *val_add, * @info: buffer to hold the result * Returns zero on success, non-zero otherwise. */ -int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info *info); +int ethtool_get_ts_info_by_layer(struct net_device *dev, + struct kernel_ethtool_ts_info *info); /** * ethtool_sprintf - Write formatted string to ethtool string data |