mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 01/12] efi: add function to determine type of device path
@ 2014-12-08 13:42 Lucas Stach
  2014-12-08 13:42 ` [PATCH 02/12] efi: add proper reset hook Lucas Stach
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Lucas Stach @ 2014-12-08 13:42 UTC (permalink / raw)
  To: barebox

Thanks to the wonders of UEFI we have to walk down the
device path all the way until we arrive at the device
we got this path from...

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 common/efi-devicepath.c | 15 +++++++++++++++
 include/efi.h           |  1 +
 2 files changed, 16 insertions(+)

diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c
index 2b1d916768d0..a53c6d2e8b9b 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 4ad9f69237e7..de51e1a3c9b6 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);
 
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-12-09  9:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 13:42 [PATCH 01/12] efi: add function to determine type of device path Lucas Stach
2014-12-08 13:42 ` [PATCH 02/12] efi: add proper reset hook Lucas Stach
2014-12-08 13:42 ` [PATCH 03/12] efi: move exit to EFI into own command Lucas Stach
2014-12-08 13:42 ` [PATCH 04/12] efi: add Barebox GUID Lucas Stach
2014-12-08 13:42 ` [PATCH 05/12] fs: efivars: cosmetic changes Lucas Stach
2014-12-08 13:42 ` [PATCH 06/12] fs: efivar: switch to standard list implementation Lucas Stach
2014-12-08 13:42 ` [PATCH 07/12] fs: efivar: move variable discovery into probe Lucas Stach
2014-12-08 13:42 ` [PATCH 08/12] lib: add wchar strdup Lucas Stach
2014-12-08 13:42 ` [PATCH 09/12] fs: efivar: preserve more info in inode Lucas Stach
2014-12-08 13:42 ` [PATCH 10/12] fs: efivars: don't store attributes in file Lucas Stach
2014-12-08 13:42 ` [PATCH 11/12] fs: efivars: implement write support Lucas Stach
2014-12-08 13:42 ` [PATCH 12/12] efi: mount efivarfs by default if enabled Lucas Stach
2014-12-09  8:59 ` [PATCH 01/12] efi: add function to determine type of device path Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox