Skip to content

Commit 3a407c7

Browse files
Merge pull request #1580 from seijikun/mr-raw-diskinfo
uefi-raw: Add DiskInfo protocol binding
2 parents 83f11ca + 803221f commit 3a407c7

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

uefi-raw/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Added `Boolean` type
55
- Added `protocol::network::pxe` module.
66
- Added conversions between `MacAddress` and the `[u8; 6]` type that's more commonly used to represent MAC addresses.
7+
- Added `DiskInfoProtocol`.
78

89

910
# uefi-raw - 0.10.0 (2025-02-07)

uefi-raw/src/protocol/disk.rs

+39
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,42 @@ impl DiskIo2Protocol {
6464
pub const GUID: Guid = guid!("151c8eae-7f2c-472c-9e54-9828194f6a88");
6565
pub const REVISION: u64 = 0x00020000;
6666
}
67+
68+
#[derive(Debug)]
69+
#[repr(C)]
70+
pub struct DiskInfoProtocol {
71+
pub interface: Guid,
72+
pub inquiry: unsafe extern "efiapi" fn(
73+
this: *const Self,
74+
inquiry_data: *mut c_void,
75+
inquiry_data_size: *mut u32,
76+
) -> Status,
77+
pub identify: unsafe extern "efiapi" fn(
78+
this: *const Self,
79+
identify_data: *mut c_void,
80+
identify_data_size: *mut u32,
81+
) -> Status,
82+
pub sense_data: unsafe extern "efiapi" fn(
83+
this: *const Self,
84+
sense_data: *mut c_void,
85+
sense_data_size: *mut u32,
86+
sense_data_number: *mut u8,
87+
) -> Status,
88+
pub which_ide: unsafe extern "efiapi" fn(
89+
this: *const Self,
90+
ide_channel: *mut u32,
91+
ide_device: *mut u32,
92+
) -> Status,
93+
}
94+
95+
impl DiskInfoProtocol {
96+
pub const GUID: Guid = guid!("d432a67f-14dc-484b-b3bb-3f0291849327");
97+
98+
pub const IDE_INTERFACE_GUID: Guid = guid!("5e948fe3-26d3-42b5-af17-610287188dec");
99+
pub const UFS_INTERFACE_GUID: Guid = guid!("4b3029cc-6b98-47fb-bc96-76dcb80441f0");
100+
pub const USB_INTERFACE_GUID: Guid = guid!("cb871572-c11a-47b5-b492-675eafa77727");
101+
pub const AHCI_INTERFACE_GUID: Guid = guid!("9e498932-4abc-45af-a34d-0247787be7c6");
102+
pub const NVME_INTERFACE_GUID: Guid = guid!("3ab14680-5d3f-4a4d-bcdc-cc380018c7f7");
103+
pub const SCSI_INTERFACE_GUID: Guid = guid!("08f74baa-ea36-41d9-9521-21a70f8780bc");
104+
pub const SD_MMC_INTERFACE_GUID: Guid = guid!("8deec992-d39c-4a5c-ab6b-986e14242b9d");
105+
}

0 commit comments

Comments
 (0)