~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/ptp_clock.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/ptp_clock.h (Version linux-6.12-rc7) and /include/uapi/linux/ptp_clock.h (Version linux-5.1.21)


  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu      1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 /*                                                  2 /*
  3  * PTP 1588 clock support - user space interfa      3  * PTP 1588 clock support - user space interface
  4  *                                                  4  *
  5  * Copyright (C) 2010 OMICRON electronics GmbH      5  * Copyright (C) 2010 OMICRON electronics GmbH
  6  *                                                  6  *
  7  *  This program is free software; you can red      7  *  This program is free software; you can redistribute it and/or modify
  8  *  it under the terms of the GNU General Publ      8  *  it under the terms of the GNU General Public License as published by
  9  *  the Free Software Foundation; either versi      9  *  the Free Software Foundation; either version 2 of the License, or
 10  *  (at your option) any later version.            10  *  (at your option) any later version.
 11  *                                                 11  *
 12  *  This program is distributed in the hope th     12  *  This program is distributed in the hope that it will be useful,
 13  *  but WITHOUT ANY WARRANTY; without even the     13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  *  MERCHANTABILITY or FITNESS FOR A PARTICULA     14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15  *  GNU General Public License for more detail     15  *  GNU General Public License for more details.
 16  *                                                 16  *
 17  *  You should have received a copy of the GNU     17  *  You should have received a copy of the GNU General Public License
 18  *  along with this program; if not, write to      18  *  along with this program; if not, write to the Free Software
 19  *  Foundation, Inc., 675 Mass Ave, Cambridge,     19  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 20  */                                                20  */
 21                                                    21 
 22 #ifndef _PTP_CLOCK_H_                              22 #ifndef _PTP_CLOCK_H_
 23 #define _PTP_CLOCK_H_                              23 #define _PTP_CLOCK_H_
 24                                                    24 
 25 #include <linux/ioctl.h>                           25 #include <linux/ioctl.h>
 26 #include <linux/types.h>                           26 #include <linux/types.h>
 27                                                    27 
 28 /*                                             !!  28 /* PTP_xxx bits, for the flags field within the request structures. */
 29  * Bits of the ptp_extts_request.flags field:  << 
 30  */                                            << 
 31 #define PTP_ENABLE_FEATURE (1<<0)                  29 #define PTP_ENABLE_FEATURE (1<<0)
 32 #define PTP_RISING_EDGE    (1<<1)                  30 #define PTP_RISING_EDGE    (1<<1)
 33 #define PTP_FALLING_EDGE   (1<<2)                  31 #define PTP_FALLING_EDGE   (1<<2)
 34 #define PTP_STRICT_FLAGS   (1<<3)              << 
 35 #define PTP_EXT_OFFSET     (1<<4)              << 
 36 #define PTP_EXTTS_EDGES    (PTP_RISING_EDGE |  << 
 37                                                << 
 38 /*                                             << 
 39  * flag fields valid for the new PTP_EXTTS_REQ << 
 40  */                                            << 
 41 #define PTP_EXTTS_VALID_FLAGS   (PTP_ENABLE_FE << 
 42                                  PTP_RISING_ED << 
 43                                  PTP_FALLING_E << 
 44                                  PTP_STRICT_FL << 
 45                                  PTP_EXT_OFFSE << 
 46                                                << 
 47 /*                                             << 
 48  * flag fields valid for the original PTP_EXTT << 
 49  * DO NOT ADD NEW FLAGS HERE.                  << 
 50  */                                            << 
 51 #define PTP_EXTTS_V1_VALID_FLAGS        (PTP_E << 
 52                                          PTP_R << 
 53                                          PTP_F << 
 54                                                << 
 55 /*                                             << 
 56  * flag fields valid for the ptp_extts_event r << 
 57  */                                            << 
 58 #define PTP_EXTTS_EVENT_VALID   (PTP_ENABLE_FE << 
 59                                                << 
 60 /*                                             << 
 61  * Bits of the ptp_perout_request.flags field: << 
 62  */                                            << 
 63 #define PTP_PEROUT_ONE_SHOT             (1<<0) << 
 64 #define PTP_PEROUT_DUTY_CYCLE           (1<<1) << 
 65 #define PTP_PEROUT_PHASE                (1<<2) << 
 66                                                << 
 67 /*                                             << 
 68  * flag fields valid for the new PTP_PEROUT_RE << 
 69  */                                            << 
 70 #define PTP_PEROUT_VALID_FLAGS          (PTP_P << 
 71                                          PTP_P << 
 72                                          PTP_P << 
 73                                                << 
 74 /*                                             << 
 75  * No flags are valid for the original PTP_PER << 
 76  */                                            << 
 77 #define PTP_PEROUT_V1_VALID_FLAGS       (0)    << 
 78                                                    32 
 79 /*                                                 33 /*
 80  * struct ptp_clock_time - represents a time v     34  * struct ptp_clock_time - represents a time value
 81  *                                                 35  *
 82  * The sign of the seconds field applies to th     36  * The sign of the seconds field applies to the whole value. The
 83  * nanoseconds field is always unsigned. The r     37  * nanoseconds field is always unsigned. The reserved field is
 84  * included for sub-nanosecond resolution, sho     38  * included for sub-nanosecond resolution, should the demand for
 85  * this ever appear.                               39  * this ever appear.
 86  *                                                 40  *
 87  */                                                41  */
 88 struct ptp_clock_time {                            42 struct ptp_clock_time {
 89         __s64 sec;  /* seconds */                  43         __s64 sec;  /* seconds */
 90         __u32 nsec; /* nanoseconds */              44         __u32 nsec; /* nanoseconds */
 91         __u32 reserved;                            45         __u32 reserved;
 92 };                                                 46 };
 93                                                    47 
 94 struct ptp_clock_caps {                            48 struct ptp_clock_caps {
 95         int max_adj;   /* Maximum frequency ad     49         int max_adj;   /* Maximum frequency adjustment in parts per billon. */
 96         int n_alarm;   /* Number of programmab     50         int n_alarm;   /* Number of programmable alarms. */
 97         int n_ext_ts;  /* Number of external t     51         int n_ext_ts;  /* Number of external time stamp channels. */
 98         int n_per_out; /* Number of programmab     52         int n_per_out; /* Number of programmable periodic signals. */
 99         int pps;       /* Whether the clock su     53         int pps;       /* Whether the clock supports a PPS callback. */
100         int n_pins;    /* Number of input/outp     54         int n_pins;    /* Number of input/output pins. */
101         /* Whether the clock supports precise      55         /* Whether the clock supports precise system-device cross timestamps */
102         int cross_timestamping;                    56         int cross_timestamping;
103         /* Whether the clock supports adjust p !!  57         int rsv[13];   /* Reserved for future use. */
104         int adjust_phase;                      << 
105         int max_phase_adj; /* Maximum phase ad << 
106         int rsv[11];       /* Reserved for fut << 
107 };                                                 58 };
108                                                    59 
109 struct ptp_extts_request {                         60 struct ptp_extts_request {
110         unsigned int index;  /* Which channel      61         unsigned int index;  /* Which channel to configure. */
111         unsigned int flags;  /* Bit field for      62         unsigned int flags;  /* Bit field for PTP_xxx flags. */
112         unsigned int rsv[2]; /* Reserved for f     63         unsigned int rsv[2]; /* Reserved for future use. */
113 };                                                 64 };
114                                                    65 
115 struct ptp_perout_request {                        66 struct ptp_perout_request {
116         union {                                !!  67         struct ptp_clock_time start;  /* Absolute start time. */
117                 /*                             << 
118                  * Absolute start time.        << 
119                  * Valid only if (flags & PTP_ << 
120                  */                            << 
121                 struct ptp_clock_time start;   << 
122                 /*                             << 
123                  * Phase offset. The signal sh << 
124                  * unspecified integer multipl << 
125                  * The start time should be "a << 
126                  * Valid only if (flags & PTP_ << 
127                  */                            << 
128                 struct ptp_clock_time phase;   << 
129         };                                     << 
130         struct ptp_clock_time period; /* Desir     68         struct ptp_clock_time period; /* Desired period, zero means disable. */
131         unsigned int index;           /* Which     69         unsigned int index;           /* Which channel to configure. */
132         unsigned int flags;                    !!  70         unsigned int flags;           /* Reserved for future use. */
133         union {                                !!  71         unsigned int rsv[4];          /* Reserved for future use. */
134                 /*                             << 
135                  * The "on" time of the signal << 
136                  * Must be lower than the peri << 
137                  * Valid only if (flags & PTP_ << 
138                  */                            << 
139                 struct ptp_clock_time on;      << 
140                 /* Reserved for future use. */ << 
141                 unsigned int rsv[4];           << 
142         };                                     << 
143 };                                                 72 };
144                                                    73 
145 #define PTP_MAX_SAMPLES 25 /* Maximum allowed      74 #define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
146                                                    75 
147 struct ptp_sys_offset {                            76 struct ptp_sys_offset {
148         unsigned int n_samples; /* Desired num     77         unsigned int n_samples; /* Desired number of measurements. */
149         unsigned int rsv[3];    /* Reserved fo     78         unsigned int rsv[3];    /* Reserved for future use. */
150         /*                                         79         /*
151          * Array of interleaved system/phc tim     80          * Array of interleaved system/phc time stamps. The kernel
152          * will provide 2*n_samples + 1 time s     81          * will provide 2*n_samples + 1 time stamps, with the last
153          * one as a system time stamp.             82          * one as a system time stamp.
154          */                                        83          */
155         struct ptp_clock_time ts[2 * PTP_MAX_S     84         struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
156 };                                                 85 };
157                                                    86 
158 /*                                             << 
159  * ptp_sys_offset_extended - data structure fo << 
160  *                           PTP_SYS_OFFSET_EX << 
161  *                                             << 
162  * @n_samples:  Desired number of measurements << 
163  * @clockid:    clockid of a clock-base used f << 
164  * @rsv:        Reserved for future use.       << 
165  * @ts:         Array of samples in the form [ << 
166  *              kernel provides @n_samples.    << 
167  *                                             << 
168  * Starting from kernel 6.12 and onwards, the  << 
169  * is used for @clockid. That's backward compa << 
170  * expect all three reserved words (@rsv[3]) t << 
171  * word in the new structure) for CLOCK_REALTI << 
172  */                                            << 
173 struct ptp_sys_offset_extended {                   87 struct ptp_sys_offset_extended {
174         unsigned int n_samples;                !!  88         unsigned int n_samples; /* Desired number of measurements. */
175         __kernel_clockid_t clockid;            !!  89         unsigned int rsv[3];    /* Reserved for future use. */
176         unsigned int rsv[2];                   !!  90         /*
                                                   >>  91          * Array of [system, phc, system] time stamps. The kernel will provide
                                                   >>  92          * 3*n_samples time stamps.
                                                   >>  93          */
177         struct ptp_clock_time ts[PTP_MAX_SAMPL     94         struct ptp_clock_time ts[PTP_MAX_SAMPLES][3];
178 };                                                 95 };
179                                                    96 
180 struct ptp_sys_offset_precise {                    97 struct ptp_sys_offset_precise {
181         struct ptp_clock_time device;              98         struct ptp_clock_time device;
182         struct ptp_clock_time sys_realtime;        99         struct ptp_clock_time sys_realtime;
183         struct ptp_clock_time sys_monoraw;        100         struct ptp_clock_time sys_monoraw;
184         unsigned int rsv[4];    /* Reserved fo    101         unsigned int rsv[4];    /* Reserved for future use. */
185 };                                                102 };
186                                                   103 
187 enum ptp_pin_function {                           104 enum ptp_pin_function {
188         PTP_PF_NONE,                              105         PTP_PF_NONE,
189         PTP_PF_EXTTS,                             106         PTP_PF_EXTTS,
190         PTP_PF_PEROUT,                            107         PTP_PF_PEROUT,
191         PTP_PF_PHYSYNC,                           108         PTP_PF_PHYSYNC,
192 };                                                109 };
193                                                   110 
194 struct ptp_pin_desc {                             111 struct ptp_pin_desc {
195         /*                                        112         /*
196          * Hardware specific human readable pi    113          * Hardware specific human readable pin name. This field is
197          * set by the kernel during the PTP_PI    114          * set by the kernel during the PTP_PIN_GETFUNC ioctl and is
198          * ignored for the PTP_PIN_SETFUNC ioc    115          * ignored for the PTP_PIN_SETFUNC ioctl.
199          */                                       116          */
200         char name[64];                            117         char name[64];
201         /*                                        118         /*
202          * Pin index in the range of zero to p    119          * Pin index in the range of zero to ptp_clock_caps.n_pins - 1.
203          */                                       120          */
204         unsigned int index;                       121         unsigned int index;
205         /*                                        122         /*
206          * Which of the PTP_PF_xxx functions t    123          * Which of the PTP_PF_xxx functions to use on this pin.
207          */                                       124          */
208         unsigned int func;                        125         unsigned int func;
209         /*                                        126         /*
210          * The specific channel to use for thi    127          * The specific channel to use for this function.
211          * This corresponds to the 'index' fie    128          * This corresponds to the 'index' field of the
212          * PTP_EXTTS_REQUEST and PTP_PEROUT_RE    129          * PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls.
213          */                                       130          */
214         unsigned int chan;                        131         unsigned int chan;
215         /*                                        132         /*
216          * Reserved for future use.               133          * Reserved for future use.
217          */                                       134          */
218         unsigned int rsv[5];                      135         unsigned int rsv[5];
219 };                                                136 };
220                                                   137 
221 #define PTP_CLK_MAGIC '='                         138 #define PTP_CLK_MAGIC '='
222                                                   139 
223 #define PTP_CLOCK_GETCAPS  _IOR(PTP_CLK_MAGIC,    140 #define PTP_CLOCK_GETCAPS  _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
224 #define PTP_EXTTS_REQUEST  _IOW(PTP_CLK_MAGIC,    141 #define PTP_EXTTS_REQUEST  _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
225 #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC,    142 #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
226 #define PTP_ENABLE_PPS     _IOW(PTP_CLK_MAGIC,    143 #define PTP_ENABLE_PPS     _IOW(PTP_CLK_MAGIC, 4, int)
227 #define PTP_SYS_OFFSET     _IOW(PTP_CLK_MAGIC,    144 #define PTP_SYS_OFFSET     _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
228 #define PTP_PIN_GETFUNC    _IOWR(PTP_CLK_MAGIC    145 #define PTP_PIN_GETFUNC    _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
229 #define PTP_PIN_SETFUNC    _IOW(PTP_CLK_MAGIC,    146 #define PTP_PIN_SETFUNC    _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
230 #define PTP_SYS_OFFSET_PRECISE \                  147 #define PTP_SYS_OFFSET_PRECISE \
231         _IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys    148         _IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)
232 #define PTP_SYS_OFFSET_EXTENDED \                 149 #define PTP_SYS_OFFSET_EXTENDED \
233         _IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys    150         _IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
234                                                   151 
235 #define PTP_CLOCK_GETCAPS2  _IOR(PTP_CLK_MAGIC << 
236 #define PTP_EXTTS_REQUEST2  _IOW(PTP_CLK_MAGIC << 
237 #define PTP_PEROUT_REQUEST2 _IOW(PTP_CLK_MAGIC << 
238 #define PTP_ENABLE_PPS2     _IOW(PTP_CLK_MAGIC << 
239 #define PTP_SYS_OFFSET2     _IOW(PTP_CLK_MAGIC << 
240 #define PTP_PIN_GETFUNC2    _IOWR(PTP_CLK_MAGI << 
241 #define PTP_PIN_SETFUNC2    _IOW(PTP_CLK_MAGIC << 
242 #define PTP_SYS_OFFSET_PRECISE2 \              << 
243         _IOWR(PTP_CLK_MAGIC, 17, struct ptp_sy << 
244 #define PTP_SYS_OFFSET_EXTENDED2 \             << 
245         _IOWR(PTP_CLK_MAGIC, 18, struct ptp_sy << 
246 #define PTP_MASK_CLEAR_ALL  _IO(PTP_CLK_MAGIC, << 
247 #define PTP_MASK_EN_SINGLE  _IOW(PTP_CLK_MAGIC << 
248                                                << 
249 struct ptp_extts_event {                          152 struct ptp_extts_event {
250         struct ptp_clock_time t; /* Time event !! 153         struct ptp_clock_time t; /* Time event occured. */
251         unsigned int index;      /* Which chan    154         unsigned int index;      /* Which channel produced the event. */
252         unsigned int flags;      /* Event type !! 155         unsigned int flags;      /* Reserved for future use. */
253         unsigned int rsv[2];     /* Reserved f    156         unsigned int rsv[2];     /* Reserved for future use. */
254 };                                                157 };
255                                                   158 
256 #endif                                            159 #endif
257                                                   160 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php