diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 8ff7108cd..bc3f286a1 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -5,6 +5,7 @@ - Added `protocol::network::pxe` module. - Added conversions between `MacAddress` and the `[u8; 6]` type that's more commonly used to represent MAC addresses. - Added `DiskInfoProtocol`. +- Added `ExtScsiPassThruProtocol`. # uefi-raw - 0.10.0 (2025-02-07) diff --git a/uefi-raw/src/protocol/scsi.rs b/uefi-raw/src/protocol/scsi.rs index 923259cf7..d3c1537e4 100644 --- a/uefi-raw/src/protocol/scsi.rs +++ b/uefi-raw/src/protocol/scsi.rs @@ -1,8 +1,11 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 +use super::device_path::DevicePathProtocol; use crate::{guid, Event, Guid, Status}; use core::ffi::c_void; +pub const SCSI_TARGET_MAX_BYTES: usize = 0x10; + newtype_enum! { /// Corresponds to the `EFI_SCSI_IO_TYPE_*` defines. #[derive(Default)] @@ -111,3 +114,47 @@ pub struct ScsiIoProtocol { impl ScsiIoProtocol { pub const GUID: Guid = guid!("932f47e6-2362-4002-803e-3cd54b138f85"); } + +#[derive(Clone, Debug)] +#[repr(C)] +pub struct ExtScsiPassThruMode { + pub adapter_id: u32, + pub attributes: u32, + pub io_align: u32, +} + +#[derive(Debug)] +#[repr(C)] +pub struct ExtScsiPassThruProtocol { + pub passthru_mode: *const ExtScsiPassThruMode, + pub pass_thru: unsafe extern "efiapi" fn( + this: *const Self, + target: *const u8, + lun: u64, + packet: *mut ScsiIoScsiRequestPacket, + event: Event, + ) -> Status, + pub get_next_target_lun: + unsafe extern "efiapi" fn(this: *const Self, target: *mut *mut u8, lun: *mut u64) -> Status, + pub build_device_path: unsafe extern "efiapi" fn( + this: *const Self, + target: *const u8, + lun: u64, + device_path: *mut *const DevicePathProtocol, + ) -> Status, + pub get_target_lun: unsafe extern "efiapi" fn( + this: *const Self, + device_path: *const DevicePathProtocol, + target: *mut *const u8, + lun: *mut u64, + ) -> Status, + pub reset_channel: unsafe extern "efiapi" fn(this: *mut Self) -> Status, + pub reset_target_lun: + unsafe extern "efiapi" fn(this: *mut Self, target: *const u8, lun: u64) -> Status, + pub get_next_target: + unsafe extern "efiapi" fn(this: *const Self, target: *mut *mut u8) -> Status, +} + +impl ExtScsiPassThruProtocol { + pub const GUID: Guid = guid!("143b7632-b81b-4cb7-abd3-b625a5b9bffe"); +}