forked from richardcochran/linuxptp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
timemaster: Add support for virtual clocks.
Add "use_vclocks" option to enable synchronization with virtual clocks. This enables multiple ptp4l instances sharing an interface to use hardware timestamping. By default, vclocks are enabled if running on Linux 5.18 or later, which should have all features to make them work as well as physical clocks. When preparing the script, count how many vclocks are needed for each physical clock. Add a placeholder option in the form of "--phc_index %PHC0-0%" to the generated ptp4l commands that need hardware clock. The index of the virtual clock is unknown at this point. When running the script (not just printing), create the required number of virtual clocks by writing to /sys/.../n_vclocks and fix the --phc_index options to refer to the indices of the created vclocks. On exit, remove the virtual clocks to restore the original state. Signed-off-by: Miroslav Lichvar <[email protected]>
- Loading branch information
1 parent
e29a334
commit 4d9f449
Showing
2 changed files
with
199 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters