Skip to content

Commit 9d66488

Browse files
committed
uefi-raw: Add DiskInfo protocol binding
1 parent 83f11ca commit 9d66488

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

uefi-raw/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +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-
7+
- Added `DiskInfoProtocol`.
88

99
# uefi-raw - 0.10.0 (2025-02-07)
1010

uefi-raw/src/protocol/disk.rs

Lines changed: 39 additions & 0 deletions
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+
pub const DISK_INFO_IDE_INTERFACE_GUID: Guid = guid!("5e948fe3-26d3-42b5-af17-610287188dec");
69+
pub const DISK_INFO_UFS_INTERFACE_GUID: Guid = guid!("4b3029cc-6b98-47fb-bc96-76dcb80441f0");
70+
pub const DISK_INFO_USB_INTERFACE_GUID: Guid = guid!("cb871572-c11a-47b5-b492-675eafa77727");
71+
pub const DISK_INFO_AHCI_INTERFACE_GUID: Guid = guid!("9e498932-4abc-45af-a34d-0247787be7c6");
72+
pub const DISK_INFO_NVME_INTERFACE_GUID: Guid = guid!("3ab14680-5d3f-4a4d-bcdc-cc380018c7f7");
73+
pub const DISK_INFO_SCSI_INTERFACE_GUID: Guid = guid!("08f74baa-ea36-41d9-9521-21a70f8780bc");
74+
pub const DISK_INFO_SD_MMC_INTERFACE_GUID: Guid = guid!("8deec992-d39c-4a5c-ab6b-986e14242b9d");
75+
76+
#[derive(Debug)]
77+
#[repr(C)]
78+
pub struct DiskInfoProtocol {
79+
pub interface: Guid,
80+
pub inquiry: unsafe extern "efiapi" fn(
81+
this: *const Self,
82+
inquiry_data: *mut c_void,
83+
inquiry_data_size: *mut u32,
84+
) -> Status,
85+
pub identify: unsafe extern "efiapi" fn(
86+
this: *const Self,
87+
identify_data: *mut c_void,
88+
identify_data_size: *mut u32,
89+
) -> Status,
90+
pub sense_data: unsafe extern "efiapi" fn(
91+
this: *const Self,
92+
sense_data: *mut c_void,
93+
sense_data_size: *mut u32,
94+
sense_data_number: *mut u8,
95+
) -> Status,
96+
pub which_ide: unsafe extern "efiapi" fn(
97+
this: *const Self,
98+
ide_channel: *mut u32,
99+
ide_device: *mut u32,
100+
) -> Status,
101+
}
102+
103+
impl DiskInfoProtocol {
104+
pub const GUID: Guid = guid!("d432a67f-14dc-484b-b3bb-3f0291849327");
105+
}

0 commit comments

Comments
 (0)