Skip to content

uefi-raw: Fix EFI_USB_IO_PROTOCOL implementation #1626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions uefi-raw/src/protocol/usb/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ newtype_enum! {
}
}

#[derive(Debug)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(C)]
pub struct DeviceRequest {
pub request_type: u8,
Expand All @@ -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);

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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(
Expand Down