xref: /linux-6.15/include/linux/net_tstamp.h (revision bf8a352d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef _LINUX_NET_TIMESTAMPING_H_
4 #define _LINUX_NET_TIMESTAMPING_H_
5 
6 #include <uapi/linux/net_tstamp.h>
7 
8 /**
9  * struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
10  *
11  * @flags: see struct hwtstamp_config
12  * @tx_type: see struct hwtstamp_config
13  * @rx_filter: see struct hwtstamp_config
14  *
15  * Prefer using this structure for in-kernel processing of hardware
16  * timestamping configuration, over the inextensible struct hwtstamp_config
17  * exposed to the %SIOCGHWTSTAMP and %SIOCSHWTSTAMP ioctl UAPI.
18  */
19 struct kernel_hwtstamp_config {
20 	int flags;
21 	int tx_type;
22 	int rx_filter;
23 };
24 
25 static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
26 					     const struct hwtstamp_config *cfg)
27 {
28 	kernel_cfg->flags = cfg->flags;
29 	kernel_cfg->tx_type = cfg->tx_type;
30 	kernel_cfg->rx_filter = cfg->rx_filter;
31 }
32 
33 #endif /* _LINUX_NET_TIMESTAMPING_H_ */
34