github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_ptp.txt (about) 1 # Copyright 2019 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 include <uapi/asm/ioctl.h> 5 include <uapi/linux/fcntl.h> 6 include <uapi/linux/ptp_clock.h> 7 8 resource fd_ptp[fd] 9 10 type ptp_index int32 11 12 openat$ptp0(fd const[AT_FDCWD], file ptr[in, string["/dev/ptp0"]], flags flags[open_flags], mode const[0]) fd_ptp 13 openat$ptp1(fd const[AT_FDCWD], file ptr[in, string["/dev/ptp1"]], flags flags[open_flags], mode const[0]) fd_ptp 14 15 read$ptp(fd fd_ptp, data ptr[out, array[int8]], len bytesize[data]) 16 17 ioctl$PTP_CLOCK_GETCAPS(fd fd_ptp, cmd const[PTP_CLOCK_GETCAPS], arg ptr[out, array[int8, PTP_CLOCK_CAPS_SIZE]]) 18 ioctl$PTP_EXTTS_REQUEST(fd fd_ptp, cmd const[PTP_EXTTS_REQUEST], arg ptr[in, ptp_extts_request]) 19 ioctl$PTP_EXTTS_REQUEST2(fd fd_ptp, cmd const[PTP_EXTTS_REQUEST2], arg ptr[in, ptp_extts_request]) 20 ioctl$PTP_PEROUT_REQUEST(fd fd_ptp, cmd const[PTP_PEROUT_REQUEST], arg ptr[in, ptp_perout_request]) 21 ioctl$PTP_PEROUT_REQUEST2(fd fd_ptp, cmd const[PTP_PEROUT_REQUEST2], arg ptr[in, ptp_perout_request]) 22 ioctl$PTP_ENABLE_PPS(fd fd_ptp, cmd const[PTP_ENABLE_PPS], arg boolptr) 23 ioctl$PTP_SYS_OFFSET(fd fd_ptp, cmd const[PTP_SYS_OFFSET], arg ptr[in, ptp_sys_offset]) 24 ioctl$PTP_SYS_OFFSET_PRECISE(fd fd_ptp, cmd const[PTP_SYS_OFFSET_PRECISE], arg ptr[out, array[int8, PTP_SYS_OFFSET_PRECISE_SIZE]]) 25 ioctl$PTP_SYS_OFFSET_EXTENDED(fd fd_ptp, cmd const[PTP_SYS_OFFSET_EXTENDED], arg ptr[in, ptp_sys_offset_extended]) 26 ioctl$PTP_PIN_GETFUNC(fd fd_ptp, cmd const[PTP_PIN_GETFUNC], arg ptr[in, ptp_pin_desc]) 27 ioctl$PTP_PIN_GETFUNC2(fd fd_ptp, cmd const[PTP_PIN_GETFUNC2], arg ptr[in, ptp_pin_desc]) 28 ioctl$PTP_PIN_SETFUNC(fd fd_ptp, cmd const[PTP_PIN_SETFUNC], arg ptr[in, ptp_pin_desc]) 29 ioctl$PTP_PIN_SETFUNC2(fd fd_ptp, cmd const[PTP_PIN_SETFUNC2], arg ptr[in, ptp_pin_desc]) 30 31 ptp_extts_request { 32 index ptp_index 33 flags flags[ptp_extts_request_flags, int32] 34 rsv array[const[0, int32], 2] 35 } 36 37 ptp_perout_request { 38 start ptp_clock_time 39 period ptp_clock_time 40 index ptp_index 41 flags bool32 42 rsv array[const[0, int32], 4] 43 } 44 45 ptp_sys_offset { 46 n_samples int32[0:PTP_MAX_SAMPLES] 47 rsv array[const[0, int32], 3] 48 ts array[const[0, int64], 102] 49 } 50 51 ptp_sys_offset_extended { 52 n_samples int32[0:PTP_MAX_SAMPLES] 53 rsv array[const[0, int32], 3] 54 ts array[const[0, int64], 150] 55 } 56 57 ptp_pin_desc { 58 name array[const[0, int8], 64] 59 index int32 60 func flags[ptp_pin_pf, int32] 61 chan ptp_index 62 rsv array[const[0, int32], 5] 63 } 64 65 ptp_clock_time { 66 desc int64 67 nsec int32 68 reserved const[0, int32] 69 } 70 71 ptp_extts_request_flags = PTP_ENABLE_FEATURE, PTP_RISING_EDGE, PTP_FALLING_EDGE, PTP_STRICT_FLAGS 72 ptp_pin_pf = PTP_PF_NONE, PTP_PF_EXTTS, PTP_PF_PEROUT, PTP_PF_PHYSYNC 73 74 define PTP_CLOCK_CAPS_SIZE sizeof(struct ptp_clock_caps) 75 define PTP_SYS_OFFSET_PRECISE_SIZE sizeof(struct ptp_sys_offset_precise)