@@ -55,9 +55,38 @@ pub struct TransactionTranslator {
5555
5656#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
5757#[ repr( C ) ]
58- pub struct PortStatus {
59- pub port_status : u16 ,
60- pub port_change_status : u16 ,
58+ pub struct UsbPortStatus {
59+ pub port_status : PortStatus ,
60+ pub port_change_status : PortChangeStatus ,
61+ }
62+
63+ bitflags ! {
64+ #[ repr( transparent) ]
65+ #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
66+ pub struct PortStatus : u16 {
67+ const CONNECTION = 0x0001 ;
68+ const ENABLE = 0x0002 ;
69+ const SUSPEND = 0x0004 ;
70+ const OVER_CURRENT = 0x0008 ;
71+ const RESET = 0x0010 ;
72+ const POWER = 0x0100 ;
73+ const LOW_SPEED = 0x0200 ;
74+ const HIGH_SPEED = 0x0400 ;
75+ const SUPER_SPEED = 0x0800 ;
76+ const OWNER = 0x2000 ;
77+ }
78+ }
79+
80+ bitflags ! {
81+ #[ repr( transparent) ]
82+ #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
83+ pub struct PortChangeStatus : u16 {
84+ const CONNECTION = 0x0001 ;
85+ const ENABLE = 0x0002 ;
86+ const SUSPEND = 0x0004 ;
87+ const OVER_CURRENT = 0x0008 ;
88+ const RESET = 0x0010 ;
89+ }
6190}
6291
6392newtype_enum ! {
@@ -170,7 +199,7 @@ pub struct Usb2HostControllerProtocol {
170199 pub get_root_hub_port_status : unsafe extern "efiapi" fn (
171200 this : * mut Self ,
172201 port_number : u8 ,
173- port_status : * mut PortStatus ,
202+ port_status : * mut UsbPortStatus ,
174203 ) -> Status ,
175204 pub set_root_hub_port_feature : unsafe extern "efiapi" fn (
176205 this : * mut Self ,
0 commit comments