1972bf40bSBjoern A. Zeeb /*- 2972bf40bSBjoern A. Zeeb * Copyright (c) 2023 The FreeBSD Foundation 3972bf40bSBjoern A. Zeeb * 4972bf40bSBjoern A. Zeeb * This software was developed by Björn Zeeb under sponsorship from 5972bf40bSBjoern A. Zeeb * the FreeBSD Foundation. 6972bf40bSBjoern A. Zeeb * 7972bf40bSBjoern A. Zeeb * Redistribution and use in source and binary forms, with or without 8972bf40bSBjoern A. Zeeb * modification, are permitted provided that the following conditions 9972bf40bSBjoern A. Zeeb * are met: 10972bf40bSBjoern A. Zeeb * 1. Redistributions of source code must retain the above copyright 11972bf40bSBjoern A. Zeeb * notice, this list of conditions and the following disclaimer. 12972bf40bSBjoern A. Zeeb * 2. Redistributions in binary form must reproduce the above copyright 13972bf40bSBjoern A. Zeeb * notice, this list of conditions and the following disclaimer in the 14972bf40bSBjoern A. Zeeb * documentation and/or other materials provided with the distribution. 15972bf40bSBjoern A. Zeeb * 16972bf40bSBjoern A. Zeeb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17972bf40bSBjoern A. Zeeb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18972bf40bSBjoern A. Zeeb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19972bf40bSBjoern A. Zeeb * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20972bf40bSBjoern A. Zeeb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21972bf40bSBjoern A. Zeeb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22972bf40bSBjoern A. Zeeb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23972bf40bSBjoern A. Zeeb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24972bf40bSBjoern A. Zeeb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25972bf40bSBjoern A. Zeeb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26972bf40bSBjoern A. Zeeb * SUCH DAMAGE. 27972bf40bSBjoern A. Zeeb * 28972bf40bSBjoern A. Zeeb * $FreeBSD$ 29972bf40bSBjoern A. Zeeb */ 30972bf40bSBjoern A. Zeeb 31972bf40bSBjoern A. Zeeb #ifndef _LINUXKPI_LINUX_PTP_CLOCK_KERNEL_H 32972bf40bSBjoern A. Zeeb #define _LINUXKPI_LINUX_PTP_CLOCK_KERNEL_H 33972bf40bSBjoern A. Zeeb 34972bf40bSBjoern A. Zeeb #include <linux/types.h> 35972bf40bSBjoern A. Zeeb #include <linux/device.h> 36972bf40bSBjoern A. Zeeb #include <linux/kernel.h> /* pr_debug */ 37972bf40bSBjoern A. Zeeb #include <linux/ktime.h> /* system_device_crosststamp */ 38972bf40bSBjoern A. Zeeb 39972bf40bSBjoern A. Zeeb /* This very likely belongs elsewhere. */ 40972bf40bSBjoern A. Zeeb struct system_device_crosststamp { 41972bf40bSBjoern A. Zeeb ktime_t device; 42972bf40bSBjoern A. Zeeb ktime_t sys_realtime; 43972bf40bSBjoern A. Zeeb ktime_t sys_monotonic_raw; /* name guessed based on comment */ 44972bf40bSBjoern A. Zeeb }; 45972bf40bSBjoern A. Zeeb 46972bf40bSBjoern A. Zeeb struct ptp_clock_info { 47972bf40bSBjoern A. Zeeb char name[32]; 48972bf40bSBjoern A. Zeeb int max_adj; 49972bf40bSBjoern A. Zeeb void *owner; /* THIS_MODULE */ 50972bf40bSBjoern A. Zeeb int (*adjfine)(struct ptp_clock_info *, long); 51972bf40bSBjoern A. Zeeb int (*adjtime)(struct ptp_clock_info *, s64); 52972bf40bSBjoern A. Zeeb int (*getcrosststamp)(struct ptp_clock_info *, struct system_device_crosststamp *); 53972bf40bSBjoern A. Zeeb int (*gettime64)(struct ptp_clock_info *, struct timespec *); 54972bf40bSBjoern A. Zeeb }; 55972bf40bSBjoern A. Zeeb 56972bf40bSBjoern A. Zeeb static inline struct ptp_clock * 57972bf40bSBjoern A. Zeeb ptp_clock_register(struct ptp_clock_info *ptpci, struct device *dev) 58972bf40bSBjoern A. Zeeb { 59972bf40bSBjoern A. Zeeb 60972bf40bSBjoern A. Zeeb pr_debug("%s: TODO\n", __func__); 61972bf40bSBjoern A. Zeeb return (NULL); 62972bf40bSBjoern A. Zeeb } 63972bf40bSBjoern A. Zeeb 64972bf40bSBjoern A. Zeeb static inline void 65972bf40bSBjoern A. Zeeb ptp_clock_unregister(struct ptp_clock *ptpc) 66972bf40bSBjoern A. Zeeb { 67972bf40bSBjoern A. Zeeb pr_debug("%s: TODO\n", __func__); 68972bf40bSBjoern A. Zeeb } 69972bf40bSBjoern A. Zeeb 70972bf40bSBjoern A. Zeeb static inline int 71972bf40bSBjoern A. Zeeb ptp_clock_index(struct ptp_clock *ptpc) 72972bf40bSBjoern A. Zeeb { 73972bf40bSBjoern A. Zeeb pr_debug("%s: TODO\n", __func__); 74972bf40bSBjoern A. Zeeb return (0); 75972bf40bSBjoern A. Zeeb } 76972bf40bSBjoern A. Zeeb 77972bf40bSBjoern A. Zeeb #endif /* _LINUXKPI_LINUX_PTP_CLOCK_KERNEL_H */ 78