include/linux/net_tstamp.h
Source file repositories/reference/linux-study-clean/include/linux/net_tstamp.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/net_tstamp.h- Extension
.h- Size
- 2988 bytes
- Lines
- 97
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/net_tstamp.huapi/linux/ethtool_netlink_generated.h
Detected Declarations
struct hwtstamp_provider_descstruct hwtstamp_providerstruct kernel_hwtstamp_configfunction hwtstamp_config_to_kernelfunction hwtstamp_config_from_kernelfunction kernel_hwtstamp_config_changed
Annotated Snippet
struct hwtstamp_provider_desc {
int index;
enum hwtstamp_provider_qualifier qualifier;
};
/**
* struct hwtstamp_provider - hwtstamp provider object
*
* @rcu_head: RCU callback used to free the struct.
* @source: source of the hwtstamp provider.
* @phydev: pointer of the phydev source in case a PTP coming from phylib
* @desc: hwtstamp provider description.
*/
struct hwtstamp_provider {
struct rcu_head rcu_head;
enum hwtstamp_source source;
struct phy_device *phydev;
struct hwtstamp_provider_desc desc;
};
/**
* struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
*
* @flags: see struct hwtstamp_config
* @tx_type: see struct hwtstamp_config
* @rx_filter: see struct hwtstamp_config
* @ifr: pointer to ifreq structure from the original ioctl request, to pass to
* a legacy implementation of a lower driver
* @copied_to_user: request was passed to a legacy implementation which already
* copied the ioctl request back to user space
* @source: indication whether timestamps should come from the netdev or from
* an attached phylib PHY
* @qualifier: qualifier of the hwtstamp provider
*
* Prefer using this structure for in-kernel processing of hardware
* timestamping configuration, over the inextensible struct hwtstamp_config
* exposed to the %SIOCGHWTSTAMP and %SIOCSHWTSTAMP ioctl UAPI.
*/
struct kernel_hwtstamp_config {
int flags;
int tx_type;
int rx_filter;
struct ifreq *ifr;
bool copied_to_user;
enum hwtstamp_source source;
enum hwtstamp_provider_qualifier qualifier;
};
static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
const struct hwtstamp_config *cfg)
{
kernel_cfg->flags = cfg->flags;
kernel_cfg->tx_type = cfg->tx_type;
kernel_cfg->rx_filter = cfg->rx_filter;
}
static inline void hwtstamp_config_from_kernel(struct hwtstamp_config *cfg,
const struct kernel_hwtstamp_config *kernel_cfg)
{
cfg->flags = kernel_cfg->flags;
cfg->tx_type = kernel_cfg->tx_type;
cfg->rx_filter = kernel_cfg->rx_filter;
}
static inline bool kernel_hwtstamp_config_changed(const struct kernel_hwtstamp_config *a,
const struct kernel_hwtstamp_config *b)
{
return a->flags != b->flags ||
a->tx_type != b->tx_type ||
a->rx_filter != b->rx_filter;
}
#endif /* _LINUX_NET_TIMESTAMPING_H_ */
Annotation
- Immediate include surface: `uapi/linux/net_tstamp.h`, `uapi/linux/ethtool_netlink_generated.h`.
- Detected declarations: `struct hwtstamp_provider_desc`, `struct hwtstamp_provider`, `struct kernel_hwtstamp_config`, `function hwtstamp_config_to_kernel`, `function hwtstamp_config_from_kernel`, `function kernel_hwtstamp_config_changed`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.