blob: 4bfe30d08642b8305176200ab1372eef7c30c288 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _PPS_H_
20#define _PPS_H_
21#include <linux/types.h>
22#define PPS_VERSION "5.3.6"
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define PPS_MAX_SOURCES 16
24#define PPS_API_VERS_1 1
25#define PPS_API_VERS PPS_API_VERS_1
26#define PPS_MAX_NAME_LEN 32
Ben Cheng655a7c02013-10-16 16:09:24 -070027struct pps_ktime {
Tao Baod7db5942015-01-28 10:07:51 -080028 __s64 sec;
29 __s32 nsec;
30 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070031};
Christopher Ferris525ce912017-07-26 13:12:53 -070032struct pps_ktime_compat {
33 __s64 sec;
34 __s32 nsec;
35 __u32 flags;
36} __attribute__((packed, aligned(4)));
Tao Baod7db5942015-01-28 10:07:51 -080037#define PPS_TIME_INVALID (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070038struct pps_kinfo {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 assert_sequence;
Tao Baod7db5942015-01-28 10:07:51 -080040 __u32 clear_sequence;
41 struct pps_ktime assert_tu;
42 struct pps_ktime clear_tu;
43 int current_mode;
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
Christopher Ferris525ce912017-07-26 13:12:53 -070045struct pps_kinfo_compat {
46 __u32 assert_sequence;
47 __u32 clear_sequence;
48 struct pps_ktime_compat assert_tu;
49 struct pps_ktime_compat clear_tu;
50 int current_mode;
51};
Ben Cheng655a7c02013-10-16 16:09:24 -070052struct pps_kparams {
Tao Baod7db5942015-01-28 10:07:51 -080053 int api_version;
54 int mode;
Tao Baod7db5942015-01-28 10:07:51 -080055 struct pps_ktime assert_off_tu;
56 struct pps_ktime clear_off_tu;
Ben Cheng655a7c02013-10-16 16:09:24 -070057};
58#define PPS_CAPTUREASSERT 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define PPS_CAPTURECLEAR 0x02
60#define PPS_CAPTUREBOTH 0x03
61#define PPS_OFFSETASSERT 0x10
62#define PPS_OFFSETCLEAR 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define PPS_CANWAIT 0x100
64#define PPS_CANPOLL 0x200
65#define PPS_ECHOASSERT 0x40
66#define PPS_ECHOCLEAR 0x80
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define PPS_TSFMT_TSPEC 0x1000
68#define PPS_TSFMT_NTPFP 0x2000
69#define PPS_KC_HARDPPS 0
70#define PPS_KC_HARDPPS_PLL 1
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define PPS_KC_HARDPPS_FLL 2
72struct pps_fdata {
Tao Baod7db5942015-01-28 10:07:51 -080073 struct pps_kinfo info;
74 struct pps_ktime timeout;
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
Christopher Ferris525ce912017-07-26 13:12:53 -070076struct pps_fdata_compat {
77 struct pps_kinfo_compat info;
78 struct pps_ktime_compat timeout;
79};
Ben Cheng655a7c02013-10-16 16:09:24 -070080struct pps_bind_args {
Tao Baod7db5942015-01-28 10:07:51 -080081 int tsformat;
82 int edge;
Tao Baod7db5942015-01-28 10:07:51 -080083 int consumer;
Ben Cheng655a7c02013-10-16 16:09:24 -070084};
85#include <linux/ioctl.h>
86#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *)
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *)
88#define PPS_GETCAP _IOR('p', 0xa3, int *)
89#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *)
90#define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *)
Ben Cheng655a7c02013-10-16 16:09:24 -070091#endif