@@ -804,6 +804,57 @@ s! {
804
804
pub val: :: c_int,
805
805
}
806
806
807
+ // linux/ptp_clock.h
808
+ pub struct ptp_clock_time {
809
+ pub sec: :: __s64,
810
+ pub nsec: :: __u32,
811
+ pub reserved: :: __u32,
812
+ }
813
+
814
+ pub struct ptp_clock_caps {
815
+ pub max_adj: :: c_int,
816
+ pub n_alarm: :: c_int,
817
+ pub n_ext_ts: :: c_int,
818
+ pub n_per_out: :: c_int,
819
+ pub pps: :: c_int,
820
+ pub n_pins: :: c_int,
821
+ pub cross_timestamping: :: c_int,
822
+ #[ cfg( target_env = "gnu" ) ]
823
+ pub adjust_phase: :: c_int,
824
+ #[ cfg( target_env = "gnu" ) ]
825
+ pub max_phase_adj: :: c_int,
826
+ #[ cfg( target_env = "gnu" ) ]
827
+ pub rsv: [ :: c_int; 11 ] ,
828
+ #[ cfg( any( target_env = "musl" , target_env = "ohos" ) ) ]
829
+ pub rsv: [ :: c_int; 13 ] ,
830
+ }
831
+
832
+ pub struct ptp_extts_request {
833
+ pub index: :: c_uint,
834
+ pub flags: :: c_uint,
835
+ pub rsv: [ :: c_uint; 2 ] ,
836
+ }
837
+
838
+ pub struct ptp_sys_offset_extended {
839
+ pub n_samples: :: c_uint,
840
+ pub rsv: [ :: c_uint; 3 ] ,
841
+ pub ts: [ [ ptp_clock_time; 3 ] ; 25 ] ,
842
+ }
843
+
844
+ pub struct ptp_sys_offset_precise {
845
+ pub device: ptp_clock_time,
846
+ pub sys_realtime: ptp_clock_time,
847
+ pub sys_monoraw: ptp_clock_time,
848
+ pub rsv: [ :: c_uint; 4 ] ,
849
+ }
850
+
851
+ pub struct ptp_extts_event {
852
+ pub t: ptp_clock_time,
853
+ index: :: c_uint,
854
+ flags: :: c_uint,
855
+ rsv: [ :: c_uint; 2 ] ,
856
+ }
857
+
807
858
// linux/sctp.h
808
859
809
860
pub struct sctp_initmsg {
@@ -1200,6 +1251,21 @@ s_no_extra_traits! {
1200
1251
pub offset_to_priv: :: __u32,
1201
1252
pub hdr: :: tpacket_bd_header_u,
1202
1253
}
1254
+
1255
+ // linux/ptp_clock.h
1256
+ pub struct ptp_sys_offset {
1257
+ pub n_samples: :: c_uint,
1258
+ pub rsv: [ :: c_uint; 3 ] ,
1259
+ pub ts: [ ptp_clock_time; 51 ] ,
1260
+ }
1261
+
1262
+ pub struct ptp_pin_desc {
1263
+ pub name: [ :: c_char; 64 ] ,
1264
+ pub index: :: c_uint,
1265
+ pub func: :: c_uint,
1266
+ pub chan: :: c_uint,
1267
+ pub rsv: [ :: c_uint; 5 ] ,
1268
+ }
1203
1269
}
1204
1270
1205
1271
s_no_extra_traits ! {
@@ -1266,6 +1332,34 @@ s_no_extra_traits! {
1266
1332
}
1267
1333
}
1268
1334
1335
+ cfg_if ! {
1336
+ if #[ cfg( libc_union) ] {
1337
+ s_no_extra_traits! {
1338
+ // linux/ptp_clock.h
1339
+ #[ allow( missing_debug_implementations) ]
1340
+ pub union __c_anonymous_ptp_perout_request_1 {
1341
+ pub start: ptp_clock_time,
1342
+ pub phase: ptp_clock_time,
1343
+ }
1344
+
1345
+ #[ allow( missing_debug_implementations) ]
1346
+ pub union __c_anonymous_ptp_perout_request_2 {
1347
+ pub on: ptp_clock_time,
1348
+ pub rsv: [ :: c_uint; 4 ] ,
1349
+ }
1350
+
1351
+ #[ allow( missing_debug_implementations) ]
1352
+ pub struct ptp_perout_request {
1353
+ pub anonymous_1: __c_anonymous_ptp_perout_request_1,
1354
+ pub period: ptp_clock_time,
1355
+ pub index: :: c_uint,
1356
+ pub flags: :: c_uint,
1357
+ pub anonymous_2: __c_anonymous_ptp_perout_request_2,
1358
+ }
1359
+ }
1360
+ }
1361
+ }
1362
+
1269
1363
cfg_if ! {
1270
1364
if #[ cfg( feature = "extra_traits" ) ] {
1271
1365
impl PartialEq for sockaddr_nl {
@@ -1751,6 +1845,62 @@ cfg_if! {
1751
1845
. finish( )
1752
1846
}
1753
1847
}
1848
+
1849
+ impl PartialEq for ptp_sys_offset {
1850
+ fn eq( & self , other: & ptp_sys_offset) -> bool {
1851
+ self . n_samples == other. n_samples &&
1852
+ self . rsv == other. rsv &&
1853
+ self . ts[ ..] == other. ts[ ..]
1854
+ }
1855
+ }
1856
+ impl Eq for ptp_sys_offset { }
1857
+ impl :: fmt:: Debug for ptp_sys_offset {
1858
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1859
+ f. debug_struct( "ptp_sys_offset" )
1860
+ . field( "n_samples" , & self . n_samples)
1861
+ . field( "rsv" , & self . rsv)
1862
+ . field( "ts" , &&self . ts[ ..] )
1863
+ . finish( )
1864
+ }
1865
+ }
1866
+ impl :: hash:: Hash for ptp_sys_offset {
1867
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1868
+ self . n_samples. hash( state) ;
1869
+ self . rsv. hash( state) ;
1870
+ self . ts[ ..] . hash( state) ;
1871
+ }
1872
+ }
1873
+
1874
+ impl PartialEq for ptp_pin_desc {
1875
+ fn eq( & self , other: & ptp_pin_desc) -> bool {
1876
+ self . name[ ..] == other. name[ ..] &&
1877
+ self . index == other. index &&
1878
+ self . func == other. func &&
1879
+ self . chan == other. chan &&
1880
+ self . rsv == other. rsv
1881
+ }
1882
+ }
1883
+ impl Eq for ptp_pin_desc { }
1884
+ impl :: fmt:: Debug for ptp_pin_desc {
1885
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1886
+ f. debug_struct( "ptp_pin_desc" )
1887
+ . field( "name" , &&self . name[ ..] )
1888
+ . field( "index" , & self . index)
1889
+ . field( "func" , & self . func)
1890
+ . field( "chan" , & self . chan)
1891
+ . field( "rsv" , & self . rsv)
1892
+ . finish( )
1893
+ }
1894
+ }
1895
+ impl :: hash:: Hash for ptp_pin_desc {
1896
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1897
+ self . name[ ..] . hash( state) ;
1898
+ self . index. hash( state) ;
1899
+ self . func. hash( state) ;
1900
+ self . chan. hash( state) ;
1901
+ self . rsv. hash( state) ;
1902
+ }
1903
+ }
1754
1904
}
1755
1905
}
1756
1906
@@ -4092,6 +4242,58 @@ pub const HWTSTAMP_FILTER_PTP_V2_SYNC: ::c_uint = 13;
4092
4242
pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ : :: c_uint = 14 ;
4093
4243
pub const HWTSTAMP_FILTER_NTP_ALL : :: c_uint = 15 ;
4094
4244
4245
+ // linux/ptp_clock.h
4246
+ pub const PTP_MAX_SAMPLES : :: c_uint = 25 ;
4247
+
4248
+ cfg_if ! {
4249
+ if #[ cfg( any( target_arch = "powerpc" , target_arch = "powerpc64" , target_arch = "sparc64" ) ) ] {
4250
+ pub const PTP_CLOCK_GETCAPS : :: c_uint = 0x40503d01 ;
4251
+ pub const PTP_EXTTS_REQUEST : :: c_uint = 0x80103d02 ;
4252
+ pub const PTP_PEROUT_REQUEST : :: c_uint = 0x80383d03 ;
4253
+ pub const PTP_ENABLE_PPS : :: c_uint = 0x80043d04 ;
4254
+ pub const PTP_SYS_OFFSET : :: c_uint = 0x83403d05 ;
4255
+ pub const PTP_PIN_GETFUNC : :: c_uint = 0xc0603d06 ;
4256
+ pub const PTP_PIN_SETFUNC : :: c_uint = 0x80603d07 ;
4257
+ pub const PTP_SYS_OFFSET_PRECISE : :: c_uint = 0xc0403d08 ;
4258
+ pub const PTP_SYS_OFFSET_EXTENDED : :: c_uint = 0xc4c03d09 ;
4259
+
4260
+ pub const PTP_CLOCK_GETCAPS2 : :: c_uint = 0x40503d0a ;
4261
+ pub const PTP_EXTTS_REQUEST2 : :: c_uint = 0x80103d0b ;
4262
+ pub const PTP_PEROUT_REQUEST2 : :: c_uint = 0x80383d0c ;
4263
+ pub const PTP_ENABLE_PPS2 : :: c_uint = 0x80043d0d ;
4264
+ pub const PTP_SYS_OFFSET2 : :: c_uint = 0x83403d0e ;
4265
+ pub const PTP_PIN_GETFUNC2 : :: c_uint = 0xc0603d0f ;
4266
+ pub const PTP_PIN_SETFUNC2 : :: c_uint = 0x80603d10 ;
4267
+ pub const PTP_SYS_OFFSET_PRECISE2 : :: c_uint = 0xc0403d11 ;
4268
+ pub const PTP_SYS_OFFSET_EXTENDED2 : :: c_uint = 0xc4c03d12 ;
4269
+ } else {
4270
+ pub const PTP_CLOCK_GETCAPS : :: c_uint = 0x80503d01 ;
4271
+ pub const PTP_EXTTS_REQUEST : :: c_uint = 0x40103d02 ;
4272
+ pub const PTP_PEROUT_REQUEST : :: c_uint = 0x40383d03 ;
4273
+ pub const PTP_ENABLE_PPS : :: c_uint = 0x40043d04 ;
4274
+ pub const PTP_SYS_OFFSET : :: c_uint = 0x43403d05 ;
4275
+ pub const PTP_PIN_GETFUNC : :: c_uint = 0xc0603d06 ;
4276
+ pub const PTP_PIN_SETFUNC : :: c_uint = 0x40603d07 ;
4277
+ pub const PTP_SYS_OFFSET_PRECISE : :: c_uint = 0xc0403d08 ;
4278
+ pub const PTP_SYS_OFFSET_EXTENDED : :: c_uint = 0xc4c03d09 ;
4279
+
4280
+ pub const PTP_CLOCK_GETCAPS2 : :: c_uint = 0x80503d0a ;
4281
+ pub const PTP_EXTTS_REQUEST2 : :: c_uint = 0x40103d0b ;
4282
+ pub const PTP_PEROUT_REQUEST2 : :: c_uint = 0x40383d0c ;
4283
+ pub const PTP_ENABLE_PPS2 : :: c_uint = 0x40043d0d ;
4284
+ pub const PTP_SYS_OFFSET2 : :: c_uint = 0x43403d0e ;
4285
+ pub const PTP_PIN_GETFUNC2 : :: c_uint = 0xc0603d0f ;
4286
+ pub const PTP_PIN_SETFUNC2 : :: c_uint = 0x40603d10 ;
4287
+ pub const PTP_SYS_OFFSET_PRECISE2 : :: c_uint = 0xc0403d11 ;
4288
+ pub const PTP_SYS_OFFSET_EXTENDED2 : :: c_uint = 0xc4c03d12 ;
4289
+ }
4290
+ }
4291
+
4292
+ pub const PTP_PF_NONE : :: c_uint = 0 ;
4293
+ pub const PTP_PF_EXTTS : :: c_uint = 1 ;
4294
+ pub const PTP_PF_PEROUT : :: c_uint = 2 ;
4295
+ pub const PTP_PF_PHYSYNC : :: c_uint = 3 ;
4296
+
4095
4297
// linux/tls.h
4096
4298
pub const TLS_TX : :: c_int = 1 ;
4097
4299
pub const TLS_RX : :: c_int = 2 ;
0 commit comments