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
3232 #define PTP_RISING_EDGE (1<<1)
3333 #define PTP_FALLING_EDGE (1<<2)
3434 #define PTP_STRICT_FLAGS (1<<3)
35+#define PTP_EXT_OFFSET (1<<4)
3536 #define PTP_EXTTS_EDGES (PTP_RISING_EDGE | PTP_FALLING_EDGE)
3637
3738 /*
@@ -40,7 +41,8 @@ · 2 unmodified lines
4041 #define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
4142 PTP_RISING_EDGE | \
4243 PTP_FALLING_EDGE | \
43− PTP_STRICT_FLAGS)
44+ PTP_STRICT_FLAGS | \
45+ PTP_EXT_OFFSET)
4446
4547 /*
4648 * flag fields valid for the original PTP_EXTTS_REQUEST ioctl.
@@ -50,6 +52,11 @@ · 3 unmodified lines
5052 PTP_RISING_EDGE | \
5153 PTP_FALLING_EDGE)
5254
55+/*
56+ * flag fields valid for the ptp_extts_event report.
57+ */
58+#define PTP_EXTTS_EVENT_VALID (PTP_ENABLE_FEATURE)
59+
5360 /*
5461 * Bits of the ptp_perout_request.flags field:
5562 */
@@ -228,9 +235,9 @@ struct ptp_pin_desc { · 172 unmodified lines
228235 #define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)
229236
230237 struct ptp_extts_event {
231− struct ptp_clock_time t; /* Time event occured. */
238+ struct ptp_clock_time t; /* Time event occurred. */
232239 unsigned int index; /* Which channel produced the event. */
233− unsigned int flags; /* Reserved for future use. */
240+ unsigned int flags; /* Event type. */
234241 unsigned int rsv[2]; /* Reserved for future use. */
235242 };
236243

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