include/linux/ptp_clock_kernel.h
Source file repositories/reference/linux-study-clean/include/linux/ptp_clock_kernel.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ptp_clock_kernel.h- Extension
.h- Size
- 18478 bytes
- Lines
- 524
- 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
linux/device.hlinux/pps_kernel.hlinux/ptp_clock.hlinux/timecounter.hlinux/timekeeping.hlinux/skbuff.h
Detected Declarations
struct ptp_clock_requeststruct system_device_crosststampstruct ptp_system_timestampstruct ptp_clock_infostruct ptp_clockstruct ptp_clock_eventenum ptp_clock_eventsfunction scaled_ppm_to_ppbfunction diff_by_scaled_ppmfunction adjust_by_scaled_ppmfunction ptp_clock_unregisterfunction ptp_clock_eventfunction ptp_clock_index_by_of_nodefunction ptp_clock_index_by_devfunction ptp_find_pinfunction ptp_find_pin_unlockedfunction ptp_schedule_workerfunction ptp_cancel_worker_syncfunction ptp_get_vclocks_indexfunction ptp_convert_timestampfunction ptp_read_system_pretsfunction ptp_read_system_postts
Annotated Snippet
struct ptp_clock_request {
enum {
PTP_CLK_REQ_EXTTS,
PTP_CLK_REQ_PEROUT,
PTP_CLK_REQ_PPS,
} type;
union {
struct ptp_extts_request extts;
struct ptp_perout_request perout;
};
};
struct system_device_crosststamp;
/**
* struct ptp_system_timestamp - system time corresponding to a PHC timestamp
* @pre_sts: system time snapshot before capturing PHC
* @post_sts: system time snapshot after capturing PHC
* @clockid: clock-base used for capturing the system timestamps
*/
struct ptp_system_timestamp {
struct system_time_snapshot pre_sts;
struct system_time_snapshot post_sts;
clockid_t clockid;
};
/**
* struct ptp_clock_info - describes a PTP hardware clock
*
* @owner: The clock driver should set to THIS_MODULE.
* @name: A short "friendly name" to identify the clock and to
* help distinguish PHY based devices from MAC based ones.
* The string is not meant to be a unique id.
* @max_adj: The maximum possible frequency adjustment, in parts per billon.
* @n_alarm: The number of programmable alarms.
* @n_ext_ts: The number of external time stamp channels.
* @n_per_out: The number of programmable periodic signals.
* @n_pins: The number of programmable pins.
* @n_per_lp: The number of channels that support loopback the periodic
* output signal.
* @pps: Indicates whether the clock supports a PPS callback.
*
* @supported_perout_flags: The set of flags the driver supports for the
* PTP_PEROUT_REQUEST ioctl. The PTP core will
* reject a request with any flag not specified
* here.
*
* @supported_extts_flags: The set of flags the driver supports for the
* PTP_EXTTS_REQUEST ioctl. The PTP core will use
* this list to reject unsupported requests.
* PTP_ENABLE_FEATURE is assumed and does not need to
* be included. If PTP_STRICT_FLAGS is *not* set,
* then both PTP_RISING_EDGE and PTP_FALLING_EDGE
* will be assumed. Note that PTP_STRICT_FLAGS must
* be set if the drivers wants to honor
* PTP_EXTTS_REQUEST2 and any future flags.
*
* @pin_config: Array of length 'n_pins'. If the number of
* programmable pins is nonzero, then drivers must
* allocate and initialize this array.
*
* clock operations
*
* @adjfine: Adjusts the frequency of the hardware clock.
* parameter scaled_ppm: Desired frequency offset from
* nominal frequency in parts per million, but with a
* 16 bit binary fractional field.
*
* @adjphase: Indicates that the PHC should use an internal servo
* algorithm to correct the provided phase offset.
* parameter delta: PHC servo phase adjustment target
* in nanoseconds.
*
* @getmaxphase: Advertises maximum offset that can be provided
* to the hardware clock's phase control functionality
* through adjphase.
*
* @adjtime: Shifts the time of the hardware clock.
* parameter delta: Desired change in nanoseconds.
*
* @gettime64: Reads the current time from the hardware clock.
* This method is deprecated. New drivers should implement
* the @gettimex64 method instead.
* parameter ts: Holds the result.
*
* @gettimex64: Reads the current time from the hardware clock and optionally
* also the system clock.
* parameter ts: Holds the PHC timestamp.
* parameter sts: If not NULL, it holds a pair of timestamps from
* the system clock. The first reading is made right before
Annotation
- Immediate include surface: `linux/device.h`, `linux/pps_kernel.h`, `linux/ptp_clock.h`, `linux/timecounter.h`, `linux/timekeeping.h`, `linux/skbuff.h`.
- Detected declarations: `struct ptp_clock_request`, `struct system_device_crosststamp`, `struct ptp_system_timestamp`, `struct ptp_clock_info`, `struct ptp_clock`, `struct ptp_clock_event`, `enum ptp_clock_events`, `function scaled_ppm_to_ppb`, `function diff_by_scaled_ppm`, `function adjust_by_scaled_ppm`.
- 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.