summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-03-04 20:00:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-03-05 16:28:06 +0100
commit58f24203d77d5b1d513ed8a0cd7558e444ecb6af (patch)
tree20317438dfcb263bf759e73aaa57f4f8fcd37d5a /include
parent80f5353a74cff378befa24a82eb3e506b574eae0 (diff)
downloadbarebox-58f24203d77d5b1d513ed8a0cd7558e444ecb6af.tar.gz
barebox-58f24203d77d5b1d513ed8a0cd7558e444ecb6af.tar.xz
efi: devicepath: namespace definitions
Using a DEVICE_PATH_ prefix everywhere will make it clear what the definitions is about and in part align us with the naming in U-Boot. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-104-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/efi/device-path.h162
1 files changed, 81 insertions, 81 deletions
diff --git a/include/efi/device-path.h b/include/efi/device-path.h
index 91c8ce57c6..8d64ac4900 100644
--- a/include/efi/device-path.h
+++ b/include/efi/device-path.h
@@ -7,42 +7,42 @@
* Hardware Device Path (UEFI 2.4 specification, version 2.4 § 9.3.2.)
*/
-#define HARDWARE_DEVICE_PATH 0x01
+#define DEVICE_PATH_TYPE_HARDWARE_DEVICE 0x01
-#define HW_PCI_DP 0x01
-struct pci_device_path {
+#define DEVICE_PATH_SUB_TYPE_PCI 0x01
+struct efi_device_path_pci {
struct efi_device_path header;
u8 Function;
u8 Device;
};
-#define HW_PCCARD_DP 0x02
-struct pccard_device_path {
+#define DEVICE_PATH_SUB_TYPE_PCCARD 0x02
+struct efi_device_path_pccard {
struct efi_device_path header;
u8 function_number;
};
-#define HW_MEMMAP_DP 0x03
-struct memmap_device_path {
+#define DEVICE_PATH_SUB_TYPE_MEMORY 0x03
+struct efi_device_path_memory {
struct efi_device_path header;
u32 memory_type;
efi_physical_addr_t starting_address;
efi_physical_addr_t ending_address;
};
-#define HW_VENDOR_DP 0x04
-struct vendor_device_path {
+#define DEVICE_PATH_SUB_TYPE_VENDOR 0x04
+struct efi_device_path_vendor {
struct efi_device_path header;
efi_guid_t Guid;
};
-struct unknown_device_vendor_device_path {
- struct vendor_device_path device_path;
+struct efi_device_path_unknown_device_vendor {
+ struct efi_device_path_vendor device_path;
u8 legacy_drive_letter;
};
-#define HW_CONTROLLER_DP 0x05
-struct controller_device_path {
+#define DEVICE_PATH_SUB_TYPE_CONTROLLER 0x05
+struct efi_device_path_controller {
struct efi_device_path header;
u32 Controller;
};
@@ -50,17 +50,17 @@ struct controller_device_path {
/*
* ACPI Device Path (UEFI 2.4 specification, version 2.4 § 9.3.3 and 9.3.4.)
*/
-#define ACPI_DEVICE_PATH 0x02
+#define DEVICE_PATH_TYPE_ACPI_DEVICE 0x02
-#define ACPI_DP 0x01
-struct acpi_hid_device_path {
+#define DEVICE_PATH_SUB_TYPE_ACPI_DEVICE 0x01
+struct efi_device_path_acpi_hid {
struct efi_device_path header;
u32 HID;
u32 UID;
};
-#define EXPANDED_ACPI_DP 0x02
-struct expanded_acpi_hid_device_path {
+#define DEVICE_PATH_SUB_TYPE_EXPANDED_ACPI_DEVICE 0x02
+struct efi_device_path_expanded_acpi {
struct efi_device_path header;
u32 HID;
u32 UID;
@@ -68,8 +68,8 @@ struct expanded_acpi_hid_device_path {
u8 hid_str[1];
};
-#define ACPI_ADR_DP 3
-struct acpi_adr_device_path {
+#define DEVICE_PATH_SUB_TYPE_ACPI_ADR_DEVICE 3
+struct efi_device_path_acpi_adr {
struct efi_device_path header;
u32 ADR;
};
@@ -91,25 +91,25 @@ struct acpi_adr_device_path {
/*
* Messaging Device Path (UEFI 2.4 specification, version 2.4 § 9.3.5.)
*/
-#define MESSAGING_DEVICE_PATH 0x03
+#define DEVICE_PATH_TYPE_MESSAGING_DEVICE 0x03
-#define MSG_ATAPI_DP 0x01
-struct atapi_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_ATAPI 0x01
+struct efi_device_path_atapi {
struct efi_device_path header;
u8 primary_secondary;
u8 slave_master;
u16 Lun;
};
-#define MSG_SCSI_DP 0x02
-struct scsi_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_SCSI 0x02
+struct efi_device_path_scsi {
struct efi_device_path header;
u16 Pun;
u16 Lun;
};
-#define MSG_FIBRECHANNEL_DP 0x03
-struct fibrechannel_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_FIBRECHANNEL 0x03
+struct efi_device_path_fibrechannel {
struct efi_device_path header;
u32 Reserved;
u64 WWN;
@@ -120,23 +120,23 @@ struct fibrechannel_device_path {
* Fibre Channel Ex sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.5.6.
*/
-#define MSG_FIBRECHANNELEX_DP 21
-struct fibrechannelex_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_FIBRECHANNEL_EX 21
+struct efi_device_path_fibrechannelex {
struct efi_device_path header;
u32 Reserved;
u8 WWN[8]; /* World Wide Name */
u8 Lun[8]; /* Logical unit, T-10 SCSI Architecture Model 4 specification */
};
-#define MSG_1394_DP 0x04
-struct f1394_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_1394 0x04
+struct efi_device_path_f1394 {
struct efi_device_path header;
u32 Reserved;
u64 Guid;
};
-#define MSG_USB_DP 0x05
-struct usb_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_USB 0x05
+struct efi_device_path_usb {
struct efi_device_path header;
u8 Port;
u8 Endpoint;
@@ -146,8 +146,8 @@ struct usb_device_path {
* SATA Device Path sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.5.6.
*/
-#define MSG_SATA_DP 18
-struct sata_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_SATA 18
+struct efi_device_path_sata {
struct efi_device_path header;
u16 HBAPort_number;
u16 port_multiplier_port_number;
@@ -158,8 +158,8 @@ struct sata_device_path {
* USB WWID Device Path sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.5.7.
*/
-#define MSG_USB_WWID_DP 16
-struct usb_wwid_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_USB_WWID 16
+struct efi_device_path_usb_wwid {
struct efi_device_path header;
u16 interface_number;
u16 vendor_id;
@@ -171,14 +171,14 @@ struct usb_wwid_device_path {
* Device Logical Unit sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.5.8.
*/
-#define MSG_DEVICE_LOGICAL_UNIT_DP 17
-struct device_logical_unit_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_DEVICE_LOGICAL_UNIT 17
+struct efi_device_path_logical_unit {
struct efi_device_path header;
u8 Lun; /* Logical Unit Number */
};
-#define MSG_USB_CLASS_DP 0x0f
-struct usb_class_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS 0x0f
+struct efi_device_path_usb_class {
struct efi_device_path header;
u16 vendor_id;
u16 product_id;
@@ -187,21 +187,21 @@ struct usb_class_device_path {
u8 device_protocol;
};
-#define MSG_I2_o_DP 0x06
-struct i2_o_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_I2_o 0x06
+struct efi_device_path_i2_o {
struct efi_device_path header;
u32 Tid;
};
-#define MSG_MAC_ADDR_DP 0x0b
-struct mac_addr_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b
+struct efi_device_path_mac_addr {
struct efi_device_path header;
struct efi_mac_address mac_address;
u8 if_type;
};
-#define MSG_IPv4_DP 0x0c
-struct ipv4_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_IPv4 0x0c
+struct efi_device_path_ipv4 {
struct efi_device_path header;
struct efi_ipv4_address local_ip_address;
struct efi_ipv4_address remote_ip_address;
@@ -214,8 +214,8 @@ struct ipv4_device_path {
struct efi_ipv4_address subnet_mask;
};
-#define MSG_IPv6_DP 0x0d
-struct ipv6_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_IPv6 0x0d
+struct efi_device_path_ipv6 {
struct efi_device_path header;
struct efi_ipv6_address local_ip_address;
struct efi_ipv6_address remote_ip_address;
@@ -232,14 +232,14 @@ struct ipv6_device_path {
* Device Logical Unit sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.5.8.
*/
-#define MSG_VLAN_DP 20
-struct vlan_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_VLAN 20
+struct efi_device_path_vlan {
struct efi_device_path header;
u16 vlan_id;
};
-#define MSG_INFINIBAND_DP 0x09
-struct infiniband_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_INFINIBAND 0x09
+struct efi_device_path_infiniband {
struct efi_device_path header;
u32 resource_flags;
efi_guid_t port_gid;
@@ -248,8 +248,8 @@ struct infiniband_device_path {
u64 device_id;
};
-#define MSG_UART_DP 0x0e
-struct uart_device_path {
+#define DEVICE_PATH_SUB_TYPE_MSG_UART 0x0e
+struct efi_device_path_uart {
struct efi_device_path header;
u32 Reserved;
u64 baud_rate;
@@ -258,7 +258,7 @@ struct uart_device_path {
u8 stop_bits;
};
-#define MSG_VENDOR_DP 0x0a
+#define DEVICE_PATH_SUB_TYPE_MSG_VENDOR 0x0a
/* Use VENDOR_DEVICE_PATH struct */
#define DEVICE_PATH_MESSAGING_PC_ANSI \
@@ -288,10 +288,10 @@ struct uart_device_path {
/*
* Media Device Path (UEFI 2.4 specification, version 2.4 § 9.3.6.)
*/
-#define MEDIA_DEVICE_PATH 0x04
+#define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
-#define MEDIA_HARDDRIVE_DP 0x01
-struct harddrive_device_path {
+#define DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH 0x01
+struct efi_device_path_hard_drive_path {
struct efi_device_path header;
u32 partition_number;
u64 partition_start;
@@ -307,27 +307,27 @@ struct harddrive_device_path {
#define SIGNATURE_TYPE_MBR 0x01
#define SIGNATURE_TYPE_GUID 0x02
-#define MEDIA_CDROM_DP 0x02
-struct cdrom_device_path {
+#define DEVICE_PATH_SUB_TYPE_CDROM_PATH 0x02
+struct efi_device_path_cdrom_path {
struct efi_device_path header;
u32 boot_entry;
u64 partition_start;
u64 partition_size;
};
-#define MEDIA_VENDOR_DP 0x03
+#define DEVICE_PATH_SUB_TYPE_VENDOR_PATH 0x03
/* Use VENDOR_DEVICE_PATH struct */
-#define MEDIA_FILEPATH_DP 0x04
-struct filepath_device_path {
+#define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04
+struct efi_device_path_file_path {
struct efi_device_path header;
s16 path_name[1];
};
#define SIZE_OF_FILEPATH_DEVICE_PATH offsetof(FILEPATH_DEVICE_PATH,path_name)
-#define MEDIA_PROTOCOL_DP 0x05
-struct media_protocol_device_path {
+#define DEVICE_PATH_SUB_TYPE_MEDIA_PROTOCOL 0x05
+struct efi_device_path_media_protocol {
struct efi_device_path header;
efi_guid_t Protocol;
};
@@ -336,8 +336,8 @@ struct media_protocol_device_path {
* PIWG Firmware File sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.6.6.
*/
-#define MEDIA_PIWG_FW_FILE_DP 6
-struct media_fw_vol_filepath_device_path {
+#define DEVICE_PATH_SUB_TYPE_PIWG_FW_FILE 6
+struct efi_device_path_media_fw_vol_file_path {
struct efi_device_path header;
efi_guid_t fv_file_name;
};
@@ -346,8 +346,8 @@ struct media_fw_vol_filepath_device_path {
* PIWG Firmware Volume Device Path sub_type.
* UEFI 2.0 specification version 2.4 § 9.3.6.7.
*/
-#define MEDIA_PIWG_FW_VOL_DP 7
-struct media_fw_vol_device_path {
+#define DEVICE_PATH_SUB_TYPE_PIWG_FW_VOL 7
+struct efi_device_media_piwg_fw_vol {
struct efi_device_path header;
efi_guid_t fv_name;
};
@@ -356,8 +356,8 @@ struct media_fw_vol_device_path {
* Media relative offset range device path.
* UEFI 2.0 specification version 2.4 § 9.3.6.8.
*/
-#define MEDIA_RELATIVE_OFFSET_RANGE_DP 8
-struct media_relative_offset_range_device_path {
+#define DEVICE_PATH_SUB_TYPE_MEDIA_RELATIVE_OFFSET_RANGE 8
+struct efi_device_media_relative_offset_range {
struct efi_device_path header;
u32 Reserved;
u64 starting_offset;
@@ -367,10 +367,10 @@ struct media_relative_offset_range_device_path {
/*
* BIOS Boot Specification Device Path (UEFI 2.4 specification, version 2.4 § 9.3.7.)
*/
-#define BBS_DEVICE_PATH 0x05
+#define DEVICE_PATH_TYPE_BBS_DEVICE 0x05
-#define BBS_BBS_DP 0x01
-struct bbs_bbs_device_path {
+#define DEVICE_PATH_SUB_TYPE_BBS_BBS 0x01
+struct efi_device_path_bbs_bbs {
struct efi_device_path header;
u16 device_type;
u16 status_flag;
@@ -388,13 +388,13 @@ struct bbs_bbs_device_path {
#define BBS_TYPE_UNKNOWN 0xff
-#define EFI_DP_TYPE_MASK 0x7f
-#define EFI_DP_TYPE_UNPACKED 0x80
+#define DEVICE_PATH_TYPE_MASK 0x7f
+#define DEVICE_PATH_TYPE_UNPACKED 0x80
-#define END_DEVICE_PATH_TYPE 0x7f
+#define DEVICE_PATH_TYPE_END 0x7f
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
-#define END_DEVICE_PATH_LENGTH (sizeof(struct efi_device_path))
+#define DEVICE_PATH_SUB_TYPE_END 0xff
+#define DEVICE_PATH_SUB_TYPE_INSTANCE_END 0x01
+#define DEVICE_PATH_END_LENGTH (sizeof(struct efi_device_path))
#endif /* __EFI_DEVICE_PATH_H */