@@ -19,6 +19,7 @@ pub type pthread_key_t = ::c_uint;
19
19
pub type pthread_once_t = :: c_int ;
20
20
pub type pthread_spinlock_t = :: c_int ;
21
21
pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t ;
22
+ pub type __kernel_clockid_t = :: c_int ;
22
23
23
24
pub type __u8 = :: c_uchar ;
24
25
pub type __u16 = :: c_ushort ;
@@ -829,6 +830,40 @@ s! {
829
830
pub resolve: :: __u64,
830
831
}
831
832
833
+ // linux/ptp_clock.h
834
+ pub struct ptp_clock_time {
835
+ pub sec: :: __s64,
836
+ pub nsec: :: __u32,
837
+ pub reserved: :: __u32,
838
+ }
839
+
840
+ pub struct ptp_extts_request {
841
+ pub index: :: c_uint,
842
+ pub flags: :: c_uint,
843
+ pub rsv: [ :: c_uint; 2 ] ,
844
+ }
845
+
846
+ pub struct ptp_sys_offset_extended {
847
+ pub n_samples: :: c_uint,
848
+ pub clockid: __kernel_clockid_t,
849
+ pub rsv: [ :: c_uint; 2 ] ,
850
+ pub ts: [ [ ptp_clock_time; 3 ] ; PTP_MAX_SAMPLES as usize ] ,
851
+ }
852
+
853
+ pub struct ptp_sys_offset_precise {
854
+ pub device: ptp_clock_time,
855
+ pub sys_realtime: ptp_clock_time,
856
+ pub sys_monoraw: ptp_clock_time,
857
+ pub rsv: [ :: c_uint; 4 ] ,
858
+ }
859
+
860
+ pub struct ptp_extts_event {
861
+ pub t: ptp_clock_time,
862
+ index: :: c_uint,
863
+ flags: :: c_uint,
864
+ rsv: [ :: c_uint; 2 ] ,
865
+ }
866
+
832
867
// linux/sctp.h
833
868
834
869
pub struct sctp_initmsg {
@@ -1142,6 +1177,23 @@ s! {
1142
1177
pub fd: :: c_int,
1143
1178
pub pid: :: c_int,
1144
1179
}
1180
+
1181
+ // linux/ptp_clock.h
1182
+
1183
+ pub struct ptp_sys_offset {
1184
+ pub n_samples: :: c_uint,
1185
+ pub rsv: [ :: c_uint; 3 ] ,
1186
+ // FIXME(garando): replace length with `2 * PTP_MAX_SAMPLES + 1` when supported
1187
+ pub ts: [ ptp_clock_time; 51 ] ,
1188
+ }
1189
+
1190
+ pub struct ptp_pin_desc {
1191
+ pub name: [ :: c_char; 64 ] ,
1192
+ pub index: :: c_uint,
1193
+ pub func: :: c_uint,
1194
+ pub chan: :: c_uint,
1195
+ pub rsv: [ :: c_uint; 5 ] ,
1196
+ }
1145
1197
}
1146
1198
1147
1199
cfg_if ! {
@@ -1574,6 +1626,28 @@ s_no_extra_traits! {
1574
1626
pub ifr_ifrn: __c_anonymous_iwreq,
1575
1627
pub u: iwreq_data,
1576
1628
}
1629
+
1630
+ // linux/ptp_clock.h
1631
+ #[ allow( missing_debug_implementations) ]
1632
+ pub union __c_anonymous_ptp_perout_request_1 {
1633
+ pub start: ptp_clock_time,
1634
+ pub phase: ptp_clock_time,
1635
+ }
1636
+
1637
+ #[ allow( missing_debug_implementations) ]
1638
+ pub union __c_anonymous_ptp_perout_request_2 {
1639
+ pub on: ptp_clock_time,
1640
+ pub rsv: [ :: c_uint; 4 ] ,
1641
+ }
1642
+
1643
+ #[ allow( missing_debug_implementations) ]
1644
+ pub struct ptp_perout_request {
1645
+ pub anonymous_1: __c_anonymous_ptp_perout_request_1,
1646
+ pub period: ptp_clock_time,
1647
+ pub index: :: c_uint,
1648
+ pub flags: :: c_uint,
1649
+ pub anonymous_2: __c_anonymous_ptp_perout_request_2,
1650
+ }
1577
1651
}
1578
1652
1579
1653
cfg_if ! {
@@ -4464,6 +4538,9 @@ pub const HWTSTAMP_FILTER_PTP_V2_SYNC: ::c_uint = 13;
4464
4538
pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ : :: c_uint = 14 ;
4465
4539
pub const HWTSTAMP_FILTER_NTP_ALL : :: c_uint = 15 ;
4466
4540
4541
+ // linux/ptp_clock.h
4542
+ pub const PTP_MAX_SAMPLES : :: c_uint = 25 ; // Maximum allowed offset measurement samples.
4543
+
4467
4544
// linux/tls.h
4468
4545
pub const TLS_TX : :: c_int = 1 ;
4469
4546
pub const TLS_RX : :: c_int = 2 ;
0 commit comments