1 /**************************************************************************** 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 _NET_TIMESTAMPING_H 20 #define _NET_TIMESTAMPING_H 21 #include <linux/types.h> 22 #include <linux/socket.h> 23 enum { 24 SOF_TIMESTAMPING_TX_HARDWARE = (1 << 0), 25 SOF_TIMESTAMPING_TX_SOFTWARE = (1 << 1), 26 SOF_TIMESTAMPING_RX_HARDWARE = (1 << 2), 27 SOF_TIMESTAMPING_RX_SOFTWARE = (1 << 3), 28 SOF_TIMESTAMPING_SOFTWARE = (1 << 4), 29 SOF_TIMESTAMPING_SYS_HARDWARE = (1 << 5), 30 SOF_TIMESTAMPING_RAW_HARDWARE = (1 << 6), 31 SOF_TIMESTAMPING_OPT_ID = (1 << 7), 32 SOF_TIMESTAMPING_TX_SCHED = (1 << 8), 33 SOF_TIMESTAMPING_TX_ACK = (1 << 9), 34 SOF_TIMESTAMPING_OPT_CMSG = (1 << 10), 35 SOF_TIMESTAMPING_OPT_TSONLY = (1 << 11), 36 SOF_TIMESTAMPING_OPT_STATS = (1 << 12), 37 SOF_TIMESTAMPING_OPT_PKTINFO = (1 << 13), 38 SOF_TIMESTAMPING_OPT_TX_SWHW = (1 << 14), 39 SOF_TIMESTAMPING_BIND_PHC = (1 << 15), 40 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_BIND_PHC, 41 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | SOF_TIMESTAMPING_LAST 42 }; 43 #define SOF_TIMESTAMPING_TX_RECORD_MASK (SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_TX_SCHED | SOF_TIMESTAMPING_TX_ACK) 44 struct so_timestamping { 45 int flags; 46 int bind_phc; 47 }; 48 struct hwtstamp_config { 49 int flags; 50 int tx_type; 51 int rx_filter; 52 }; 53 enum hwtstamp_flags { 54 HWTSTAMP_FLAG_BONDED_PHC_INDEX = (1 << 0), 55 #define HWTSTAMP_FLAG_BONDED_PHC_INDEX HWTSTAMP_FLAG_BONDED_PHC_INDEX 56 HWTSTAMP_FLAG_LAST = HWTSTAMP_FLAG_BONDED_PHC_INDEX, 57 HWTSTAMP_FLAG_MASK = (HWTSTAMP_FLAG_LAST - 1) | HWTSTAMP_FLAG_LAST 58 }; 59 enum hwtstamp_tx_types { 60 HWTSTAMP_TX_OFF, 61 HWTSTAMP_TX_ON, 62 HWTSTAMP_TX_ONESTEP_SYNC, 63 HWTSTAMP_TX_ONESTEP_P2P, 64 __HWTSTAMP_TX_CNT 65 }; 66 enum hwtstamp_rx_filters { 67 HWTSTAMP_FILTER_NONE, 68 HWTSTAMP_FILTER_ALL, 69 HWTSTAMP_FILTER_SOME, 70 HWTSTAMP_FILTER_PTP_V1_L4_EVENT, 71 HWTSTAMP_FILTER_PTP_V1_L4_SYNC, 72 HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ, 73 HWTSTAMP_FILTER_PTP_V2_L4_EVENT, 74 HWTSTAMP_FILTER_PTP_V2_L4_SYNC, 75 HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ, 76 HWTSTAMP_FILTER_PTP_V2_L2_EVENT, 77 HWTSTAMP_FILTER_PTP_V2_L2_SYNC, 78 HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ, 79 HWTSTAMP_FILTER_PTP_V2_EVENT, 80 HWTSTAMP_FILTER_PTP_V2_SYNC, 81 HWTSTAMP_FILTER_PTP_V2_DELAY_REQ, 82 HWTSTAMP_FILTER_NTP_ALL, 83 __HWTSTAMP_FILTER_CNT 84 }; 85 struct scm_ts_pktinfo { 86 __u32 if_index; 87 __u32 pkt_length; 88 __u32 reserved[2]; 89 }; 90 enum txtime_flags { 91 SOF_TXTIME_DEADLINE_MODE = (1 << 0), 92 SOF_TXTIME_REPORT_ERRORS = (1 << 1), 93 SOF_TXTIME_FLAGS_LAST = SOF_TXTIME_REPORT_ERRORS, 94 SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_FLAGS_LAST - 1) | SOF_TXTIME_FLAGS_LAST 95 }; 96 struct sock_txtime { 97 __kernel_clockid_t clockid; 98 __u32 flags; 99 }; 100 #endif 101