| 1 |
//! Device Path Protocol |
| 2 |
//! |
| 3 |
//! The device path protocol defines how to obtain generic path/location information |
| 4 |
//! concerning the phisycal or logical device. |
| 5 |
|
| 6 |
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields( |
| 7 |
0x09576e91, |
| 8 |
0x6d3f, |
| 9 |
0x11d2, |
| 10 |
0x8e, |
| 11 |
0x39, |
| 12 |
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b], |
| 13 |
); |
| 14 |
|
| 15 |
pub const TYPE_HARDWARE: u8 = 0x01; |
| 16 |
pub const TYPE_ACPI: u8 = 0x02; |
| 17 |
pub const TYPE_MESSAGING: u8 = 0x03; |
| 18 |
pub const TYPE_MEDIA: u8 = 0x04; |
| 19 |
pub const TYPE_BIOS: u8 = 0x05; |
| 20 |
pub const TYPE_END: u8 = 0x7f; |
| 21 |
|
| 22 |
#[repr(C)] |
| 23 |
#[derive(Clone, Copy, Debug)] |
| 24 |
pub struct Protocol { |
| 25 |
pub r#type: u8, |
| 26 |
pub sub_type: u8, |
| 27 |
pub length: [u8; 2], |
| 28 |
} |
| 29 |
|
| 30 |
#[repr(C)] |
| 31 |
#[derive(Clone, Copy, Debug)] |
| 32 |
pub struct End { |
| 33 |
pub header: Protocol, |
| 34 |
} |
| 35 |
|
| 36 |
impl End { |
| 37 |
pub const SUBTYPE_INSTANCE: u8 = 0x01; |
| 38 |
pub const SUBTYPE_ENTIRE: u8 = 0xff; |
| 39 |
} |
| 40 |
|
| 41 |
#[repr(C)] |
| 42 |
#[derive(Clone, Copy, Debug)] |
| 43 |
pub struct Hardware { |
| 44 |
pub header: Protocol, |
| 45 |
} |
| 46 |
|
| 47 |
impl Hardware { |
| 48 |
pub const SUBTYPE_PCI: u8 = 0x01; |
| 49 |
pub const SUBTYPE_PCCARD: u8 = 0x02; |
| 50 |
pub const SUBTYPE_MMAP: u8 = 0x03; |
| 51 |
pub const SUBTYPE_VENDOR: u8 = 0x04; |
| 52 |
pub const SUBTYPE_CONTROLLER: u8 = 0x05; |
| 53 |
pub const SUBTYPE_BMC: u8 = 0x06; |
| 54 |
} |
| 55 |
|
| 56 |
#[repr(C, packed)] |
| 57 |
#[derive(Clone, Copy, Debug)] |
| 58 |
pub struct HardDriveMedia { |
| 59 |
pub header: Protocol, |
| 60 |
pub partition_number: u32, |
| 61 |
pub partition_start: u64, |
| 62 |
pub partition_size: u64, |
| 63 |
pub partition_signature: [u8; 16], |
| 64 |
pub partition_format: u8, |
| 65 |
pub signature_type: u8, |
| 66 |
} |
| 67 |
|
| 68 |
pub struct Media { |
| 69 |
pub header: Protocol, |
| 70 |
} |
| 71 |
|
| 72 |
impl Media { |
| 73 |
pub const SUBTYPE_HARDDRIVE: u8 = 0x01; |
| 74 |
pub const SUBTYPE_CDROM: u8 = 0x02; |
| 75 |
pub const SUBTYPE_VENDOR: u8 = 0x03; |
| 76 |
pub const SUBTYPE_FILE_PATH: u8 = 0x04; |
| 77 |
pub const SUBTYPE_MEDIA_PROTOCOL: u8 = 0x05; |
| 78 |
pub const SUBTYPE_PIWG_FIRMWARE_FILE: u8 = 0x06; |
| 79 |
pub const SUBTYPE_PIWG_FIRMWARE_VOLUME: u8 = 0x07; |
| 80 |
pub const SUBTYPE_RELATIVE_OFFSET_RANGE: u8 = 0x08; |
| 81 |
pub const SUBTYPE_RAM_DISK: u8 = 0x09; |
| 82 |
} |