From 16351a8ff79f425bc8ae348d54fd279296665198 Mon Sep 17 00:00:00 2001 From: Jarl Evanson Date: Sun, 13 Apr 2025 15:27:01 -0500 Subject: [PATCH 1/2] uefi-raw: Add traits to UsbIoProtocol structs --- uefi-raw/src/protocol/usb/io.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uefi-raw/src/protocol/usb/io.rs b/uefi-raw/src/protocol/usb/io.rs index 834ae477d..0b937f26d 100644 --- a/uefi-raw/src/protocol/usb/io.rs +++ b/uefi-raw/src/protocol/usb/io.rs @@ -12,7 +12,7 @@ newtype_enum! { } } -#[derive(Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(C)] pub struct DeviceRequest { pub request_type: u8, @@ -22,7 +22,7 @@ pub struct DeviceRequest { pub length: u16, } -#[derive(Default, Debug)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[repr(transparent)] pub struct UsbTransferStatus(pub u32); @@ -33,7 +33,7 @@ pub type AsyncUsbTransferCallback = unsafe extern "efiapi" fn( status: UsbTransferStatus, ) -> Status; -#[derive(Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(C)] pub struct DeviceDescriptor { pub length: u8, @@ -52,7 +52,7 @@ pub struct DeviceDescriptor { pub num_configurations: u8, } -#[derive(Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(C)] pub struct ConfigDescriptor { pub length: u8, @@ -65,7 +65,7 @@ pub struct ConfigDescriptor { pub max_power: u8, } -#[derive(Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(C)] pub struct InterfaceDescriptor { pub length: u8, @@ -79,7 +79,7 @@ pub struct InterfaceDescriptor { pub interface: u8, } -#[derive(Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(C)] pub struct EndpointDescriptor { pub length: u8, From aea55193b2dc80fa787281d0116f45a21e30e668 Mon Sep 17 00:00:00 2001 From: Jarl Evanson Date: Sun, 13 Apr 2025 15:58:47 -0500 Subject: [PATCH 2/2] uefi: Fix UsbIoProtocol's bulk_transfer() --- uefi-raw/src/protocol/usb/io.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uefi-raw/src/protocol/usb/io.rs b/uefi-raw/src/protocol/usb/io.rs index 0b937f26d..f980cc351 100644 --- a/uefi-raw/src/protocol/usb/io.rs +++ b/uefi-raw/src/protocol/usb/io.rs @@ -106,8 +106,8 @@ pub struct UsbIoProtocol { this: *mut Self, device_endpoint: u8, data: *mut ffi::c_void, - data_length: usize, - timeout: u32, + data_length: *mut usize, + timeout: usize, status: *mut UsbTransferStatus, ) -> Status, pub async_interrupt_transfer: unsafe extern "efiapi" fn(