History

ptp: introduce PTP_CLOCK_EXTOFF event for the measured external offset

This change is for the PHC devices that can measure the phase offset between PHC signal and the external signal, such as the 1PPS signal of GNSS. Reporting PTP_CLOCK_EXTOFF to user space will be piggy-backed to the existing ptp_extts_event so that application such as ts2phc can poll the external offset the same way as extts. Hence, ts2phc can use the offset to achieve the alignment between PHC and the external signal by the help of either SW or HW filters.

Min Li committed 2 years ago

Commit ea1cc3e1 parent cf8e51e3 files · +28 −4Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/ptp_clock.h+10−3
@@ -32,6 +32,7 @@ · 31 unmodified lines
32#define PTP_RISING_EDGE (1<<1)32#define PTP_RISING_EDGE (1<<1)
33#define PTP_FALLING_EDGE (1<<2)33#define PTP_FALLING_EDGE (1<<2)
34#define PTP_STRICT_FLAGS (1<<3)34#define PTP_STRICT_FLAGS (1<<3)
35#define PTP_EXT_OFFSET (1<<4)
35#define PTP_EXTTS_EDGES (PTP_RISING_EDGE | PTP_FALLING_EDGE)36#define PTP_EXTTS_EDGES (PTP_RISING_EDGE | PTP_FALLING_EDGE)
36 37
37/*38/*
@@ -40,7 +41,8 @@ · 2 unmodified lines
40#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \41#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
41 PTP_RISING_EDGE | \42 PTP_RISING_EDGE | \
42 PTP_FALLING_EDGE | \43 PTP_FALLING_EDGE | \
43 PTP_STRICT_FLAGS)44 PTP_STRICT_FLAGS | \
45 PTP_EXT_OFFSET)
44 46
45/*47/*
46 * flag fields valid for the original PTP_EXTTS_REQUEST ioctl.48 * flag fields valid for the original PTP_EXTTS_REQUEST ioctl.
@@ -50,6 +52,11 @@ · 3 unmodified lines
50 PTP_RISING_EDGE | \52 PTP_RISING_EDGE | \
51 PTP_FALLING_EDGE)53 PTP_FALLING_EDGE)
52 54
55/*
56 * flag fields valid for the ptp_extts_event report.
57 */
58#define PTP_EXTTS_EVENT_VALID (PTP_ENABLE_FEATURE)
59
53/*60/*
54 * Bits of the ptp_perout_request.flags field:61 * Bits of the ptp_perout_request.flags field:
55 */62 */
@@ -228,9 +235,9 @@ struct ptp_pin_desc { · 172 unmodified lines
228#define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)235#define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)
229 236
230struct ptp_extts_event {237struct ptp_extts_event {
231 struct ptp_clock_time t; /* Time event occured. */238 struct ptp_clock_time t; /* Time event occurred. */
232 unsigned int index; /* Which channel produced the event. */239 unsigned int index; /* Which channel produced the event. */
233 unsigned int flags; /* Reserved for future use. */240 unsigned int flags; /* Event type. */
234 unsigned int rsv[2]; /* Reserved for future use. */241 unsigned int rsv[2]; /* Reserved for future use. */
235};242};
236 243

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t