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.

Dependency Surface

Detected Declarations

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

Implementation Notes