Jiri Benc
2013-04-18 12:32:59 UTC
PPS output from sfc driver has to be enabled by PTP_ENABLE_PPS ioctl. This
is also documented in Documentation/ptp/testptp.c in the kernel source. Call
the ioctl when both PHC device and PPS device are specified.
Signed-off-by: Jiri Benc <***@redhat.com>
---
I couldn't get PPS with sfc working without this patch. Am I missing
something?
---
phc2sys.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/phc2sys.c b/phc2sys.c
index 93495a4..f835e1d 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -652,6 +652,14 @@ int main(int argc, char *argv[])
usage(progname);
return -1;
}
+ if (pps_fd && src != CLOCK_INVALID) {
+ int enable = 1;
+
+ if (ioctl(CLOCKID_TO_FD(src), PTP_ENABLE_PPS, enable) < 0) {
+ fprintf(stderr, "failed to enable PPS on a PHC\n");
+ return -1;
+ }
+ }
if (dst_clock.stats_max_count > 0) {
dst_clock.offset_stats = stats_create();
is also documented in Documentation/ptp/testptp.c in the kernel source. Call
the ioctl when both PHC device and PPS device are specified.
Signed-off-by: Jiri Benc <***@redhat.com>
---
I couldn't get PPS with sfc working without this patch. Am I missing
something?
---
phc2sys.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/phc2sys.c b/phc2sys.c
index 93495a4..f835e1d 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -652,6 +652,14 @@ int main(int argc, char *argv[])
usage(progname);
return -1;
}
+ if (pps_fd && src != CLOCK_INVALID) {
+ int enable = 1;
+
+ if (ioctl(CLOCKID_TO_FD(src), PTP_ENABLE_PPS, enable) < 0) {
+ fprintf(stderr, "failed to enable PPS on a PHC\n");
+ return -1;
+ }
+ }
if (dst_clock.stats_max_count > 0) {
dst_clock.offset_stats = stats_create();
--
1.7.6.5
1.7.6.5