• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef _PPS_H_
7 #define _PPS_H_
8 #include <linux/types.h>
9 #define PPS_VERSION		"5.3.6"
10 #define PPS_MAX_SOURCES		16
11 #define PPS_API_VERS_1		1
12 #define PPS_API_VERS		PPS_API_VERS_1
13 #define PPS_MAX_NAME_LEN	32
14 struct pps_ktime {
15 	__s64 sec;
16 	__s32 nsec;
17 	__u32 flags;
18 };
19 struct pps_ktime_compat {
20 	__s64 sec;
21 	__s32 nsec;
22 	__u32 flags;
23 } __attribute__((packed, aligned(4)));
24 #define PPS_TIME_INVALID	(1<<0)
25 struct pps_kinfo {
26 	__u32 assert_sequence;
27 	__u32 clear_sequence;
28 	struct pps_ktime assert_tu;
29 	struct pps_ktime clear_tu;
30 	int current_mode;
31 };
32 struct pps_kinfo_compat {
33 	__u32 assert_sequence;
34 	__u32 clear_sequence;
35 	struct pps_ktime_compat assert_tu;
36 	struct pps_ktime_compat clear_tu;
37 	int current_mode;
38 };
39 struct pps_kparams {
40 	int api_version;
41 	int mode;
42 	struct pps_ktime assert_off_tu;
43 	struct pps_ktime clear_off_tu;
44 };
45 #define PPS_CAPTUREASSERT	0x01
46 #define PPS_CAPTURECLEAR	0x02
47 #define PPS_CAPTUREBOTH		0x03
48 #define PPS_OFFSETASSERT	0x10
49 #define PPS_OFFSETCLEAR		0x20
50 #define PPS_CANWAIT		0x100
51 #define PPS_CANPOLL		0x200
52 #define PPS_ECHOASSERT		0x40
53 #define PPS_ECHOCLEAR		0x80
54 #define PPS_TSFMT_TSPEC		0x1000
55 #define PPS_TSFMT_NTPFP		0x2000
56 #define PPS_KC_HARDPPS		0
57 #define PPS_KC_HARDPPS_PLL	1
58 #define PPS_KC_HARDPPS_FLL	2
59 struct pps_fdata {
60 	struct pps_kinfo info;
61 	struct pps_ktime timeout;
62 };
63 struct pps_fdata_compat {
64 	struct pps_kinfo_compat info;
65 	struct pps_ktime_compat timeout;
66 };
67 struct pps_bind_args {
68 	int tsformat;
69 	int edge;
70 	int consumer;
71 };
72 #include <linux/ioctl.h>
73 #define PPS_GETPARAMS		_IOR('p', 0xa1, struct pps_kparams *)
74 #define PPS_SETPARAMS		_IOW('p', 0xa2, struct pps_kparams *)
75 #define PPS_GETCAP		_IOR('p', 0xa3, int *)
76 #define PPS_FETCH		_IOWR('p', 0xa4, struct pps_fdata *)
77 #define PPS_KC_BIND		_IOW('p', 0xa5, struct pps_bind_args *)
78 #endif
79