blob: bb9d6d93fb2aef489f2b847e7248dc3f70c7effe [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 _PTP_CLOCK_H_
20#define _PTP_CLOCK_H_
21#include <linux/ioctl.h>
22#include <linux/types.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080024#define PTP_ENABLE_FEATURE (1 << 0)
25#define PTP_RISING_EDGE (1 << 1)
26#define PTP_FALLING_EDGE (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070027struct ptp_clock_time {
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 __s64 sec;
30 __u32 nsec;
31 __u32 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34struct ptp_clock_caps {
Tao Baod7db5942015-01-28 10:07:51 -080035 int max_adj;
36 int n_alarm;
37 int n_ext_ts;
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 int n_per_out;
40 int pps;
41 int n_pins;
42 int rsv[14];
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070044};
Ben Cheng655a7c02013-10-16 16:09:24 -070045struct ptp_extts_request {
Tao Baod7db5942015-01-28 10:07:51 -080046 unsigned int index;
47 unsigned int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 unsigned int rsv[2];
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
51struct ptp_perout_request {
Tao Baod7db5942015-01-28 10:07:51 -080052 struct ptp_clock_time start;
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 struct ptp_clock_time period;
55 unsigned int index;
56 unsigned int flags;
57 unsigned int rsv[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070059};
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define PTP_MAX_SAMPLES 25
61struct ptp_sys_offset {
Tao Baod7db5942015-01-28 10:07:51 -080062 unsigned int n_samples;
Ben Cheng655a7c02013-10-16 16:09:24 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 unsigned int rsv[3];
65 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070066};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070067enum ptp_pin_function {
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080069 PTP_PF_NONE,
70 PTP_PF_EXTTS,
71 PTP_PF_PEROUT,
72 PTP_PF_PHYSYNC,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74};
75struct ptp_pin_desc {
Tao Baod7db5942015-01-28 10:07:51 -080076 char name[64];
77 unsigned int index;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 unsigned int func;
80 unsigned int chan;
81 unsigned int rsv[5];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070082};
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define PTP_CLK_MAGIC '='
85#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
87#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
90#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070091#define PTP_PIN_GETFUNC _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
92#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94struct ptp_extts_event {
Tao Baod7db5942015-01-28 10:07:51 -080095 struct ptp_clock_time t;
96 unsigned int index;
97 unsigned int flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 unsigned int rsv[2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
101#endif