From 52409fae3e4b8d16b68b61902fc09075cd97b75d Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Sun, 2 Jul 2017 16:41:37 +0200 Subject: Backports generated from 4.11 kernel Initial commit. Signed-off-by: Dominik Sliwa --- backport-include/linux/ptp_clock_kernel.h | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 backport-include/linux/ptp_clock_kernel.h (limited to 'backport-include/linux/ptp_clock_kernel.h') diff --git a/backport-include/linux/ptp_clock_kernel.h b/backport-include/linux/ptp_clock_kernel.h new file mode 100644 index 0000000..e4483c0 --- /dev/null +++ b/backport-include/linux/ptp_clock_kernel.h @@ -0,0 +1,40 @@ +#ifndef __BACKPORT_PTP_CLOCK_KERNEL_H +#define __BACKPORT_PTP_CLOCK_KERNEL_H + +#include +#include_next + +#if LINUX_VERSION_IS_LESS(3,5,0) +#include + +#define PTP_MAX_TIMESTAMPS 128 +#define PTP_BUF_TIMESTAMPS 30 + +struct timestamp_event_queue { + struct ptp_extts_event buf[PTP_MAX_TIMESTAMPS]; + int head; + int tail; + spinlock_t lock; +}; + +struct ptp_clock { + struct posix_clock clock; + struct device *dev; + struct ptp_clock_info *info; + dev_t devid; + int index; /* index into clocks.map */ + struct pps_device *pps_source; + struct timestamp_event_queue tsevq; /* simple fifo for time stamps */ + struct mutex tsevq_mux; /* one process at a time reading the fifo */ + wait_queue_head_t tsev_wq; + int defunct; /* tells readers to go away when clock is being removed */ +}; + +extern int ptp_clock_index(struct ptp_clock *ptp); +#endif /* LINUX_VERSION_IS_LESS(3,5,0) */ + +#if LINUX_VERSION_IS_LESS(3,7,0) && !defined(CONFIG_SUSE_KERNEL) +#define ptp_clock_register(info,parent) ptp_clock_register(info) +#endif /* LINUX_VERSION_IS_LESS(3,7,0) */ + +#endif /* __BACKPORT_PTP_CLOCK_KERNEL_H */ -- cgit v1.2.3