summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/efi-devicepath.c15
-rw-r--r--include/efi.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c
index 2b1d916768..a53c6d2e8b 100644
--- a/common/efi-devicepath.c
+++ b/common/efi-devicepath.c
@@ -1368,3 +1368,18 @@ char *device_path_to_str(struct efi_device_path *dev_path)
return str.str;
}
+
+u8 device_path_to_type(struct efi_device_path *dev_path)
+{
+ struct efi_device_path *dev_path_next;
+
+ dev_path = unpack_device_path(dev_path);
+ dev_path_next = next_device_path_node(dev_path);
+
+ while (!is_device_path_end(dev_path_next)) {
+ dev_path = dev_path_next;
+ dev_path_next = next_device_path_node(dev_path);
+ }
+
+ return device_path_type(dev_path);
+}
diff --git a/include/efi.h b/include/efi.h
index 4ad9f69237..de51e1a3c9 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -615,6 +615,7 @@ static inline int efi_compare_guid(efi_guid_t *a, efi_guid_t *b)
}
char *device_path_to_str(struct efi_device_path *dev_path);
+u8 device_path_to_type(struct efi_device_path *dev_path);
const char *efi_guid_string(efi_guid_t *g);