@@ -1195,6 +1195,19 @@ s! {
1195
1195
pub rsv: [ :: c_uint; 5 ] ,
1196
1196
}
1197
1197
1198
+ pub struct ptp_clock_caps {
1199
+ pub max_adj: :: c_int,
1200
+ pub n_alarm: :: c_int,
1201
+ pub n_ext_ts: :: c_int,
1202
+ pub n_per_out: :: c_int,
1203
+ pub pps: :: c_int,
1204
+ pub n_pins: :: c_int,
1205
+ pub cross_timestamping: :: c_int,
1206
+ pub adjust_phase: :: c_int,
1207
+ pub max_phase_adj: :: c_int,
1208
+ pub rsv: [ :: c_int; 11 ] ,
1209
+ }
1210
+
1198
1211
// linux/if_xdp.h
1199
1212
pub struct xsk_tx_metadata_completion {
1200
1213
pub tx_timestamp: :: __u64,
@@ -1206,81 +1219,6 @@ s! {
1206
1219
}
1207
1220
}
1208
1221
1209
- cfg_if ! {
1210
- if #[ cfg( all( target_arch = "loongarch64" , target_env = "musl" ) ) ] {
1211
- s! {
1212
- pub struct ptp_clock_caps {
1213
- pub max_adj: :: c_int,
1214
- pub n_alarm: :: c_int,
1215
- pub n_ext_ts: :: c_int,
1216
- pub n_per_out: :: c_int,
1217
- pub pps: :: c_int,
1218
- pub n_pins: :: c_int,
1219
- pub cross_timestamping: :: c_int,
1220
- pub adjust_phase: :: c_int,
1221
- pub rsv: [ :: c_int; 12 ] ,
1222
- }
1223
- }
1224
- } else if #[ cfg( all( target_arch = "loongarch64" , target_env = "gnu" ) ) ] {
1225
- s! {
1226
- pub struct ptp_clock_caps {
1227
- pub max_adj: :: c_int,
1228
- pub n_alarm: :: c_int,
1229
- pub n_ext_ts: :: c_int,
1230
- pub n_per_out: :: c_int,
1231
- pub pps: :: c_int,
1232
- pub n_pins: :: c_int,
1233
- pub cross_timestamping: :: c_int,
1234
- pub adjust_phase: :: c_int,
1235
- pub max_phase_adj: :: c_int,
1236
- pub rsv: [ :: c_int; 11 ] ,
1237
- }
1238
- }
1239
- } else if #[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ) ) ] {
1240
- s! {
1241
- pub struct ptp_clock_caps {
1242
- pub max_adj: :: c_int,
1243
- pub n_alarm: :: c_int,
1244
- pub n_ext_ts: :: c_int,
1245
- pub n_per_out: :: c_int,
1246
- pub pps: :: c_int,
1247
- pub n_pins: :: c_int,
1248
- pub cross_timestamping: :: c_int,
1249
- pub adjust_phase: :: c_int,
1250
- pub rsv: [ :: c_int; 12 ] ,
1251
- }
1252
- }
1253
- } else if #[ cfg( any( target_env = "musl" , target_env = "ohos" ) ) ] {
1254
- s! {
1255
- pub struct ptp_clock_caps {
1256
- pub max_adj: :: c_int,
1257
- pub n_alarm: :: c_int,
1258
- pub n_ext_ts: :: c_int,
1259
- pub n_per_out: :: c_int,
1260
- pub pps: :: c_int,
1261
- pub n_pins: :: c_int,
1262
- pub cross_timestamping: :: c_int,
1263
- pub rsv: [ :: c_int; 13 ] ,
1264
- }
1265
- }
1266
- } else {
1267
- s! {
1268
- pub struct ptp_clock_caps {
1269
- pub max_adj: :: c_int,
1270
- pub n_alarm: :: c_int,
1271
- pub n_ext_ts: :: c_int,
1272
- pub n_per_out: :: c_int,
1273
- pub pps: :: c_int,
1274
- pub n_pins: :: c_int,
1275
- pub cross_timestamping: :: c_int,
1276
- pub adjust_phase: :: c_int,
1277
- pub max_phase_adj: :: c_int,
1278
- pub rsv: [ :: c_int; 11 ] ,
1279
- }
1280
- }
1281
- }
1282
- }
1283
-
1284
1222
cfg_if ! {
1285
1223
if #[ cfg( not( target_arch = "sparc64" ) ) ] {
1286
1224
s! {
@@ -4641,8 +4579,7 @@ pub const PTP_MAX_SAMPLES: ::c_uint = 25; // Maximum allowed offset measurement
4641
4579
4642
4580
const PTP_CLK_MAGIC : u32 = b'=' as u32 ;
4643
4581
4644
- // FIXME: needs the ptp_clock_caps struct
4645
- // pub const PTP_CLOCK_GETCAPS: ::c_uint = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 1);
4582
+ pub const PTP_CLOCK_GETCAPS : :: c_uint = _IOR :: < ptp_clock_caps > ( PTP_CLK_MAGIC , 1 ) ;
4646
4583
pub const PTP_EXTTS_REQUEST : :: c_uint = _IOW :: < ptp_extts_request > ( PTP_CLK_MAGIC , 2 ) ;
4647
4584
pub const PTP_PEROUT_REQUEST : :: c_uint = _IOW :: < ptp_perout_request > ( PTP_CLK_MAGIC , 3 ) ;
4648
4585
pub const PTP_ENABLE_PPS : :: c_uint = _IOW :: < :: c_int > ( PTP_CLK_MAGIC , 4 ) ;
@@ -4652,8 +4589,7 @@ pub const PTP_PIN_SETFUNC: ::c_uint = _IOW::<ptp_pin_desc>(PTP_CLK_MAGIC, 7);
4652
4589
pub const PTP_SYS_OFFSET_PRECISE : :: c_uint = _IOWR :: < ptp_sys_offset_precise > ( PTP_CLK_MAGIC , 8 ) ;
4653
4590
pub const PTP_SYS_OFFSET_EXTENDED : :: c_uint = _IOWR :: < ptp_sys_offset_extended > ( PTP_CLK_MAGIC , 9 ) ;
4654
4591
4655
- // FIXME: needs the ptp_clock_caps struct
4656
- // pub const PTP_CLOCK_GETCAPS2: ::c_uint = _IOR::<ptp_clock_caps>(PTP_CLK_MAGIC, 10);
4592
+ pub const PTP_CLOCK_GETCAPS2 : :: c_uint = _IOR :: < ptp_clock_caps > ( PTP_CLK_MAGIC , 10 ) ;
4657
4593
pub const PTP_EXTTS_REQUEST2 : :: c_uint = _IOW :: < ptp_extts_request > ( PTP_CLK_MAGIC , 11 ) ;
4658
4594
pub const PTP_PEROUT_REQUEST2 : :: c_uint = _IOW :: < ptp_perout_request > ( PTP_CLK_MAGIC , 12 ) ;
4659
4595
pub const PTP_ENABLE_PPS2 : :: c_uint = _IOW :: < :: c_int > ( PTP_CLK_MAGIC , 13 ) ;
0 commit comments