~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/net_tstamp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 #define SOF_TIMESTAMPING_SOFTWARE_MASK  (SOF_TIMESTAMPING_RX_SOFTWARE | \
  9                                          SOF_TIMESTAMPING_TX_SOFTWARE | \
 10                                          SOF_TIMESTAMPING_SOFTWARE)
 11 
 12 #define SOF_TIMESTAMPING_HARDWARE_MASK  (SOF_TIMESTAMPING_RX_HARDWARE | \
 13                                          SOF_TIMESTAMPING_TX_HARDWARE | \
 14                                          SOF_TIMESTAMPING_RAW_HARDWARE)
 15 
 16 enum hwtstamp_source {
 17         HWTSTAMP_SOURCE_UNSPEC,
 18         HWTSTAMP_SOURCE_NETDEV,
 19         HWTSTAMP_SOURCE_PHYLIB,
 20 };
 21 
 22 /**
 23  * struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
 24  *
 25  * @flags: see struct hwtstamp_config
 26  * @tx_type: see struct hwtstamp_config
 27  * @rx_filter: see struct hwtstamp_config
 28  * @ifr: pointer to ifreq structure from the original ioctl request, to pass to
 29  *      a legacy implementation of a lower driver
 30  * @copied_to_user: request was passed to a legacy implementation which already
 31  *      copied the ioctl request back to user space
 32  * @source: indication whether timestamps should come from the netdev or from
 33  *      an attached phylib PHY
 34  *
 35  * Prefer using this structure for in-kernel processing of hardware
 36  * timestamping configuration, over the inextensible struct hwtstamp_config
 37  * exposed to the %SIOCGHWTSTAMP and %SIOCSHWTSTAMP ioctl UAPI.
 38  */
 39 struct kernel_hwtstamp_config {
 40         int flags;
 41         int tx_type;
 42         int rx_filter;
 43         struct ifreq *ifr;
 44         bool copied_to_user;
 45         enum hwtstamp_source source;
 46 };
 47 
 48 static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
 49                                              const struct hwtstamp_config *cfg)
 50 {
 51         kernel_cfg->flags = cfg->flags;
 52         kernel_cfg->tx_type = cfg->tx_type;
 53         kernel_cfg->rx_filter = cfg->rx_filter;
 54 }
 55 
 56 static inline void hwtstamp_config_from_kernel(struct hwtstamp_config *cfg,
 57                                                const struct kernel_hwtstamp_config *kernel_cfg)
 58 {
 59         cfg->flags = kernel_cfg->flags;
 60         cfg->tx_type = kernel_cfg->tx_type;
 61         cfg->rx_filter = kernel_cfg->rx_filter;
 62 }
 63 
 64 static inline bool kernel_hwtstamp_config_changed(const struct kernel_hwtstamp_config *a,
 65                                                   const struct kernel_hwtstamp_config *b)
 66 {
 67         return a->flags != b->flags ||
 68                a->tx_type != b->tx_type ||
 69                a->rx_filter != b->rx_filter;
 70 }
 71 
 72 #endif /* _LINUX_NET_TIMESTAMPING_H_ */
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php