summaryrefslogtreecommitdiff
path: root/include/linux/ptp_classify.h
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2011-04-22 12:03:08 +0200
committerJohn Stultz <john.stultz@linaro.org>2011-05-23 13:01:00 -0700
commitd94ba80ebbea17f036cecb104398fbcd788aa742 (patch)
tree7fe40228c5ea2bb77f2892b722d27155df8c1157 /include/linux/ptp_classify.h
parentcaebc160ce3f76761cc62ad96ef6d6f30f54e3dd (diff)
downloadlwn-d94ba80ebbea17f036cecb104398fbcd788aa742.tar.gz
lwn-d94ba80ebbea17f036cecb104398fbcd788aa742.zip
ptp: Added a brand new class driver for ptp clocks.
This patch adds an infrastructure for hardware clocks that implement IEEE 1588, the Precision Time Protocol (PTP). A class driver offers a registration method to particular hardware clock drivers. Each clock is presented as a standard POSIX clock. The ancillary clock features are exposed in two different ways, via the sysfs and by a character device. Signed-off-by: Richard Cochran <richard.cochran@omicron.at> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/ptp_classify.h')
-rw-r--r--include/linux/ptp_classify.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index 943a85ab0020..e07e2742a865 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -25,6 +25,7 @@
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
+#include <linux/ip.h>
#include <linux/filter.h>
#ifdef __KERNEL__
#include <linux/in.h>
@@ -58,6 +59,12 @@
#define OFF_NEXT 6
#define OFF_UDP_DST 2
+#define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */
+#define OFF_PTP_SEQUENCE_ID 30
+#define OFF_PTP_CONTROL 32 /* PTPv1 only */
+
+#define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
+
#define IP6_HLEN 40
#define UDP_HLEN 8