@@ -284,6 +284,24 @@ s! {
284
284
pub u: [ u32 ; 7 ] ,
285
285
}
286
286
287
+ pub struct uinput_ff_upload {
288
+ pub request_id: :: __u32,
289
+ pub retval: :: __s32,
290
+ pub effect: ff_effect,
291
+ pub old: ff_effect,
292
+ }
293
+
294
+ pub struct uinput_ff_erase {
295
+ pub request_id: :: __u32,
296
+ pub retval: :: __s32,
297
+ pub effect_id: :: __u32,
298
+ }
299
+
300
+ pub struct uinput_abs_setup {
301
+ pub code: :: __u16,
302
+ pub absinfo: input_absinfo,
303
+ }
304
+
287
305
pub struct dl_phdr_info {
288
306
#[ cfg( target_pointer_width = "64" ) ]
289
307
pub dlpi_addr: Elf64_Addr ,
@@ -557,6 +575,22 @@ s_no_extra_traits! {
557
575
pub salg_name: [ :: c_uchar; 64 ] ,
558
576
}
559
577
578
+ pub struct uinput_setup {
579
+ pub id: input_id,
580
+ pub name: [ :: c_char; UINPUT_MAX_NAME_SIZE ] ,
581
+ pub ff_effects_max: :: __u32,
582
+ }
583
+
584
+ pub struct uinput_user_dev {
585
+ pub name: [ :: c_char; UINPUT_MAX_NAME_SIZE ] ,
586
+ pub id: input_id,
587
+ pub ff_effects_max: :: __u32,
588
+ pub absmax: [ :: __s32; ABS_CNT ] ,
589
+ pub absmin: [ :: __s32; ABS_CNT ] ,
590
+ pub absfuzz: [ :: __s32; ABS_CNT ] ,
591
+ pub absflat: [ :: __s32; ABS_CNT ] ,
592
+ }
593
+
560
594
/// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this
561
595
/// type are unsound and will be removed in the future.
562
596
#[ deprecated(
@@ -827,6 +861,72 @@ cfg_if! {
827
861
}
828
862
}
829
863
864
+ impl PartialEq for uinput_setup {
865
+ fn eq( & self , other: & uinput_setup) -> bool {
866
+ self . id == other. id
867
+ && self . name[ ..] == other. name[ ..]
868
+ && self . ff_effects_max == other. ff_effects_max
869
+ }
870
+ }
871
+ impl Eq for uinput_setup { }
872
+
873
+ impl :: fmt:: Debug for uinput_setup {
874
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
875
+ f. debug_struct( "uinput_setup" )
876
+ . field( "id" , & self . id)
877
+ . field( "name" , &&self . name[ ..] )
878
+ . field( "ff_effects_max" , & self . ff_effects_max)
879
+ . finish( )
880
+ }
881
+ }
882
+
883
+ impl :: hash:: Hash for uinput_setup {
884
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
885
+ self . id. hash( state) ;
886
+ self . name. hash( state) ;
887
+ self . ff_effects_max. hash( state) ;
888
+ }
889
+ }
890
+
891
+ impl PartialEq for uinput_user_dev {
892
+ fn eq( & self , other: & uinput_user_dev) -> bool {
893
+ self . name[ ..] == other. name[ ..]
894
+ && self . id == other. id
895
+ && self . ff_effects_max == other. ff_effects_max
896
+ && self . absmax[ ..] == other. absmax[ ..]
897
+ && self . absmin[ ..] == other. absmin[ ..]
898
+ && self . absfuzz[ ..] == other. absfuzz[ ..]
899
+ && self . absflat[ ..] == other. absflat[ ..]
900
+ }
901
+ }
902
+ impl Eq for uinput_user_dev { }
903
+
904
+ impl :: fmt:: Debug for uinput_user_dev {
905
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
906
+ f. debug_struct( "uinput_setup" )
907
+ . field( "name" , &&self . name[ ..] )
908
+ . field( "id" , & self . id)
909
+ . field( "ff_effects_max" , & self . ff_effects_max)
910
+ . field( "absmax" , &&self . absmax[ ..] )
911
+ . field( "absmin" , &&self . absmin[ ..] )
912
+ . field( "absfuzz" , &&self . absfuzz[ ..] )
913
+ . field( "absflat" , &&self . absflat[ ..] )
914
+ . finish( )
915
+ }
916
+ }
917
+
918
+ impl :: hash:: Hash for uinput_user_dev {
919
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
920
+ self . name. hash( state) ;
921
+ self . id. hash( state) ;
922
+ self . ff_effects_max. hash( state) ;
923
+ self . absmax. hash( state) ;
924
+ self . absmin. hash( state) ;
925
+ self . absfuzz. hash( state) ;
926
+ self . absflat. hash( state) ;
927
+ }
928
+ }
929
+
830
930
#[ allow( deprecated) ]
831
931
impl af_alg_iv {
832
932
fn as_slice( & self ) -> & [ u8 ] {
@@ -2471,6 +2571,38 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS
2471
2571
pub const IN_CLOEXEC : :: c_int = O_CLOEXEC ;
2472
2572
pub const IN_NONBLOCK : :: c_int = O_NONBLOCK ;
2473
2573
2574
+ // linux/input.h
2575
+ pub const FF_MAX : :: __u16 = 0x7f ;
2576
+ pub const FF_CNT : usize = FF_MAX as usize + 1 ;
2577
+
2578
+ // linux/input-event-codes.h
2579
+ pub const INPUT_PROP_MAX : :: __u16 = 0x1f ;
2580
+ pub const INPUT_PROP_CNT : usize = INPUT_PROP_MAX as usize + 1 ;
2581
+ pub const EV_MAX : :: __u16 = 0x1f ;
2582
+ pub const EV_CNT : usize = EV_MAX as usize + 1 ;
2583
+ pub const SYN_MAX : :: __u16 = 0xf ;
2584
+ pub const SYN_CNT : usize = SYN_MAX as usize + 1 ;
2585
+ pub const KEY_MAX : :: __u16 = 0x2ff ;
2586
+ pub const KEY_CNT : usize = KEY_MAX as usize + 1 ;
2587
+ pub const REL_MAX : :: __u16 = 0x0f ;
2588
+ pub const REL_CNT : usize = REL_MAX as usize + 1 ;
2589
+ pub const ABS_MAX : :: __u16 = 0x3f ;
2590
+ pub const ABS_CNT : usize = ABS_MAX as usize + 1 ;
2591
+ pub const SW_MAX : :: __u16 = 0x10 ;
2592
+ pub const SW_CNT : usize = SW_MAX as usize + 1 ;
2593
+ pub const MSC_MAX : :: __u16 = 0x07 ;
2594
+ pub const MSC_CNT : usize = MSC_MAX as usize + 1 ;
2595
+ pub const LED_MAX : :: __u16 = 0x0f ;
2596
+ pub const LED_CNT : usize = LED_MAX as usize + 1 ;
2597
+ pub const REP_MAX : :: __u16 = 0x01 ;
2598
+ pub const REP_CNT : usize = REP_MAX as usize + 1 ;
2599
+ pub const SND_MAX : :: __u16 = 0x07 ;
2600
+ pub const SND_CNT : usize = SND_MAX as usize + 1 ;
2601
+
2602
+ // linux/uinput.h
2603
+ pub const UINPUT_VERSION : :: c_uint = 5 ;
2604
+ pub const UINPUT_MAX_NAME_SIZE : usize = 80 ;
2605
+
2474
2606
// uapi/linux/fanotify.h
2475
2607
pub const FAN_ACCESS : u64 = 0x0000_0001 ;
2476
2608
pub const FAN_MODIFY : u64 = 0x0000_0002 ;
0 commit comments