*/
#include <common.h>
+#include <blk.h>
#include <efi_loader.h>
#define MAC_OUTPUT_LEN 22
static u16 *efi_str_to_u16(char *str)
{
efi_uintn_t len;
- u16 *out;
+ u16 *out, *dst;
efi_status_t ret;
- len = strlen(str) + 1;
- ret = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, len * sizeof(u16),
- (void **)&out);
+ len = sizeof(u16) * (utf8_utf16_strlen(str) + 1);
+ ret = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, len, (void **)&out);
if (ret != EFI_SUCCESS)
return NULL;
- ascii2unicode(out, str);
+ dst = out;
+ utf8_utf16_strcpy(&dst, str);
return out;
}
break;
}
+ case DEVICE_PATH_SUB_TYPE_MSG_SATA: {
+ struct efi_device_path_sata *sdp =
+ (struct efi_device_path_sata *) dp;
+
+ s += sprintf(s, "Sata(0x%x,0x%x,0x%x)",
+ sdp->hba_port,
+ sdp->port_multiplier_port,
+ sdp->logical_unit_number);
+ break;
+ }
+ case DEVICE_PATH_SUB_TYPE_MSG_NVME: {
+ struct efi_device_path_nvme *ndp =
+ (struct efi_device_path_nvme *)dp;
+ u32 ns_id;
+ int i;
+
+ memcpy(&ns_id, &ndp->ns_id, sizeof(ns_id));
+ s += sprintf(s, "NVMe(0x%x,", ns_id);
+ for (i = 0; i < sizeof(ndp->eui64); ++i)
+ s += sprintf(s, "%s%02x", i ? "-" : "",
+ ndp->eui64[i]);
+ s += sprintf(s, ")");
+
+ break;
+ }
case DEVICE_PATH_SUB_TYPE_MSG_SD:
case DEVICE_PATH_SUB_TYPE_MSG_MMC: {
const char *typename =