9
0
Fork 0

efi: add function to determine type of device path

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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2014-12-08 14:42:28 +01:00 committed by Sascha Hauer
parent 38c6f5d351
commit da94ff1e37
2 changed files with 16 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);