@@ -80,6 +80,7 @@ mod device_path_gen;
80
80
pub use device_path_gen:: {
81
81
acpi, bios_boot_spec, end, hardware, media, messaging, DevicePathNodeEnum ,
82
82
} ;
83
+ pub use uefi_raw:: protocol:: device_path:: { DeviceSubType , DeviceType } ;
83
84
84
85
use crate :: proto:: { unsafe_protocol, ProtocolPointer } ;
85
86
use core:: ffi:: c_void;
@@ -631,163 +632,6 @@ impl<'a> Iterator for DevicePathNodeIterator<'a> {
631
632
}
632
633
}
633
634
634
- newtype_enum ! {
635
- /// Type identifier for a DevicePath
636
- pub enum DeviceType : u8 => {
637
- /// Hardware Device Path.
638
- ///
639
- /// This Device Path defines how a device is attached to the resource domain of a system, where resource domain is
640
- /// simply the shared memory, memory mapped I/ O, and I/O space of the system.
641
- HARDWARE = 0x01 ,
642
- /// ACPI Device Path.
643
- ///
644
- /// This Device Path is used to describe devices whose enumeration is not described in an industry-standard fashion.
645
- /// These devices must be described using ACPI AML in the ACPI namespace; this Device Path is a linkage to the ACPI
646
- /// namespace.
647
- ACPI = 0x02 ,
648
- /// Messaging Device Path.
649
- ///
650
- /// This Device Path is used to describe the connection of devices outside the resource domain of the system. This
651
- /// Device Path can describe physical messaging information such as a SCSI ID, or abstract information such as
652
- /// networking protocol IP addresses.
653
- MESSAGING = 0x03 ,
654
- /// Media Device Path.
655
- ///
656
- /// This Device Path is used to describe the portion of a medium that is being abstracted by a boot service.
657
- /// For example, a Media Device Path could define which partition on a hard drive was being used.
658
- MEDIA = 0x04 ,
659
- /// BIOS Boot Specification Device Path.
660
- ///
661
- /// This Device Path is used to point to boot legacy operating systems; it is based on the BIOS Boot Specification
662
- /// Version 1.01.
663
- BIOS_BOOT_SPEC = 0x05 ,
664
- /// End of Hardware Device Path.
665
- ///
666
- /// Depending on the Sub-Type, this Device Path node is used to indicate the end of the Device Path instance or
667
- /// Device Path structure.
668
- END = 0x7F ,
669
- } }
670
-
671
- /// Sub-type identifier for a DevicePath
672
- #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
673
- pub struct DeviceSubType ( pub u8 ) ;
674
-
675
- impl DeviceSubType {
676
- /// PCI Device Path.
677
- pub const HARDWARE_PCI : Self = Self ( 1 ) ;
678
- /// PCCARD Device Path.
679
- pub const HARDWARE_PCCARD : Self = Self ( 2 ) ;
680
- /// Memory-mapped Device Path.
681
- pub const HARDWARE_MEMORY_MAPPED : Self = Self ( 3 ) ;
682
- /// Vendor-Defined Device Path.
683
- pub const HARDWARE_VENDOR : Self = Self ( 4 ) ;
684
- /// Controller Device Path.
685
- pub const HARDWARE_CONTROLLER : Self = Self ( 5 ) ;
686
- /// BMC Device Path.
687
- pub const HARDWARE_BMC : Self = Self ( 6 ) ;
688
-
689
- /// ACPI Device Path.
690
- pub const ACPI : Self = Self ( 1 ) ;
691
- /// Expanded ACPI Device Path.
692
- pub const ACPI_EXPANDED : Self = Self ( 2 ) ;
693
- /// ACPI _ADR Device Path.
694
- pub const ACPI_ADR : Self = Self ( 3 ) ;
695
- /// NVDIMM Device Path.
696
- pub const ACPI_NVDIMM : Self = Self ( 4 ) ;
697
-
698
- /// ATAPI Device Path.
699
- pub const MESSAGING_ATAPI : Self = Self ( 1 ) ;
700
- /// SCSI Device Path.
701
- pub const MESSAGING_SCSI : Self = Self ( 2 ) ;
702
- /// Fibre Channel Device Path.
703
- pub const MESSAGING_FIBRE_CHANNEL : Self = Self ( 3 ) ;
704
- /// 1394 Device Path.
705
- pub const MESSAGING_1394 : Self = Self ( 4 ) ;
706
- /// USB Device Path.
707
- pub const MESSAGING_USB : Self = Self ( 5 ) ;
708
- /// I2O Device Path.
709
- pub const MESSAGING_I2O : Self = Self ( 6 ) ;
710
- /// Infiniband Device Path.
711
- pub const MESSAGING_INFINIBAND : Self = Self ( 9 ) ;
712
- /// Vendor-Defined Device Path.
713
- pub const MESSAGING_VENDOR : Self = Self ( 10 ) ;
714
- /// MAC Address Device Path.
715
- pub const MESSAGING_MAC_ADDRESS : Self = Self ( 11 ) ;
716
- /// IPV4 Device Path.
717
- pub const MESSAGING_IPV4 : Self = Self ( 12 ) ;
718
- /// IPV6 Device Path.
719
- pub const MESSAGING_IPV6 : Self = Self ( 13 ) ;
720
- /// UART Device Path.
721
- pub const MESSAGING_UART : Self = Self ( 14 ) ;
722
- /// USB Class Device Path.
723
- pub const MESSAGING_USB_CLASS : Self = Self ( 15 ) ;
724
- /// USB WWID Device Path.
725
- pub const MESSAGING_USB_WWID : Self = Self ( 16 ) ;
726
- /// Device Logical Unit.
727
- pub const MESSAGING_DEVICE_LOGICAL_UNIT : Self = Self ( 17 ) ;
728
- /// SATA Device Path.
729
- pub const MESSAGING_SATA : Self = Self ( 18 ) ;
730
- /// iSCSI Device Path node (base information).
731
- pub const MESSAGING_ISCSI : Self = Self ( 19 ) ;
732
- /// VLAN Device Path node.
733
- pub const MESSAGING_VLAN : Self = Self ( 20 ) ;
734
- /// Fibre Channel Ex Device Path.
735
- pub const MESSAGING_FIBRE_CHANNEL_EX : Self = Self ( 21 ) ;
736
- /// Serial Attached SCSI (SAS) Ex Device Path.
737
- pub const MESSAGING_SCSI_SAS_EX : Self = Self ( 22 ) ;
738
- /// NVM Express Namespace Device Path.
739
- pub const MESSAGING_NVME_NAMESPACE : Self = Self ( 23 ) ;
740
- /// Uniform Resource Identifiers (URI) Device Path.
741
- pub const MESSAGING_URI : Self = Self ( 24 ) ;
742
- /// UFS Device Path.
743
- pub const MESSAGING_UFS : Self = Self ( 25 ) ;
744
- /// SD (Secure Digital) Device Path.
745
- pub const MESSAGING_SD : Self = Self ( 26 ) ;
746
- /// Bluetooth Device Path.
747
- pub const MESSAGING_BLUETOOTH : Self = Self ( 27 ) ;
748
- /// Wi-Fi Device Path.
749
- pub const MESSAGING_WIFI : Self = Self ( 28 ) ;
750
- /// eMMC (Embedded Multi-Media Card) Device Path.
751
- pub const MESSAGING_EMMC : Self = Self ( 29 ) ;
752
- /// BluetoothLE Device Path.
753
- pub const MESSAGING_BLUETOOTH_LE : Self = Self ( 30 ) ;
754
- /// DNS Device Path.
755
- pub const MESSAGING_DNS : Self = Self ( 31 ) ;
756
- /// NVDIMM Namespace Device Path.
757
- pub const MESSAGING_NVDIMM_NAMESPACE : Self = Self ( 32 ) ;
758
- /// REST Service Device Path.
759
- pub const MESSAGING_REST_SERVICE : Self = Self ( 33 ) ;
760
- /// NVME over Fabric (NVMe-oF) Namespace Device Path.
761
- pub const MESSAGING_NVME_OF_NAMESPACE : Self = Self ( 34 ) ;
762
-
763
- /// Hard Drive Media Device Path.
764
- pub const MEDIA_HARD_DRIVE : Self = Self ( 1 ) ;
765
- /// CD-ROM Media Device Path.
766
- pub const MEDIA_CD_ROM : Self = Self ( 2 ) ;
767
- /// Vendor-Defined Media Device Path.
768
- pub const MEDIA_VENDOR : Self = Self ( 3 ) ;
769
- /// File Path Media Device Path.
770
- pub const MEDIA_FILE_PATH : Self = Self ( 4 ) ;
771
- /// Media Protocol Device Path.
772
- pub const MEDIA_PROTOCOL : Self = Self ( 5 ) ;
773
- /// PIWG Firmware File.
774
- pub const MEDIA_PIWG_FIRMWARE_FILE : Self = Self ( 6 ) ;
775
- /// PIWG Firmware Volume.
776
- pub const MEDIA_PIWG_FIRMWARE_VOLUME : Self = Self ( 7 ) ;
777
- /// Relative Offset Range.
778
- pub const MEDIA_RELATIVE_OFFSET_RANGE : Self = Self ( 8 ) ;
779
- /// RAM Disk Device Path.
780
- pub const MEDIA_RAM_DISK : Self = Self ( 9 ) ;
781
-
782
- /// BIOS Boot Specification Device Path.
783
- pub const BIOS_BOOT_SPECIFICATION : Self = Self ( 1 ) ;
784
-
785
- /// End this instance of a Device Path and start a new one.
786
- pub const END_INSTANCE : Self = Self ( 0x01 ) ;
787
- /// End entire Device Path.
788
- pub const END_ENTIRE : Self = Self ( 0xff ) ;
789
- }
790
-
791
635
/// Error returned when attempting to convert from a `&[u8]` to a
792
636
/// [`DevicePath`] type.
793
637
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
0 commit comments