Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _PPS_H_ |
| 8 | #define _PPS_H_ |
| 9 | #include <linux/types.h> |
| 10 | #define PPS_VERSION "5.3.6" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #define PPS_MAX_SOURCES 16 |
| 12 | #define PPS_API_VERS_1 1 |
| 13 | #define PPS_API_VERS PPS_API_VERS_1 |
| 14 | #define PPS_MAX_NAME_LEN 32 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 15 | struct pps_ktime { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 16 | __s64 sec; |
| 17 | __s32 nsec; |
| 18 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 19 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 20 | struct pps_ktime_compat { |
| 21 | __s64 sec; |
| 22 | __s32 nsec; |
| 23 | __u32 flags; |
| 24 | } __attribute__((packed, aligned(4))); |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 25 | #define PPS_TIME_INVALID (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 26 | struct pps_kinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u32 assert_sequence; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 28 | __u32 clear_sequence; |
| 29 | struct pps_ktime assert_tu; |
| 30 | struct pps_ktime clear_tu; |
| 31 | int current_mode; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 33 | struct pps_kinfo_compat { |
| 34 | __u32 assert_sequence; |
| 35 | __u32 clear_sequence; |
| 36 | struct pps_ktime_compat assert_tu; |
| 37 | struct pps_ktime_compat clear_tu; |
| 38 | int current_mode; |
| 39 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | struct pps_kparams { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | int api_version; |
| 42 | int mode; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | struct pps_ktime assert_off_tu; |
| 44 | struct pps_ktime clear_off_tu; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | }; |
| 46 | #define PPS_CAPTUREASSERT 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define PPS_CAPTURECLEAR 0x02 |
| 48 | #define PPS_CAPTUREBOTH 0x03 |
| 49 | #define PPS_OFFSETASSERT 0x10 |
| 50 | #define PPS_OFFSETCLEAR 0x20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define PPS_CANWAIT 0x100 |
| 52 | #define PPS_CANPOLL 0x200 |
| 53 | #define PPS_ECHOASSERT 0x40 |
| 54 | #define PPS_ECHOCLEAR 0x80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define PPS_TSFMT_TSPEC 0x1000 |
| 56 | #define PPS_TSFMT_NTPFP 0x2000 |
| 57 | #define PPS_KC_HARDPPS 0 |
| 58 | #define PPS_KC_HARDPPS_PLL 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define PPS_KC_HARDPPS_FLL 2 |
| 60 | struct pps_fdata { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | struct pps_kinfo info; |
| 62 | struct pps_ktime timeout; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 64 | struct pps_fdata_compat { |
| 65 | struct pps_kinfo_compat info; |
| 66 | struct pps_ktime_compat timeout; |
| 67 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | struct pps_bind_args { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 69 | int tsformat; |
| 70 | int edge; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | int consumer; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | }; |
| 73 | #include <linux/ioctl.h> |
| 74 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) |
| 76 | #define PPS_GETCAP _IOR('p', 0xa3, int *) |
| 77 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) |
| 78 | #define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | #endif |