MdePkg/DevicePath: Add EMMC device path definition

This device path node is introduced in UEFI2.6 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
Feng Tian
2016-03-22 23:15:53 +08:00
parent 03e1757840
commit 5c67fb2f4c
3 changed files with 72 additions and 0 deletions

View File

@@ -1902,6 +1902,34 @@ DevPathFromTextSd (
return (EFI_DEVICE_PATH_PROTOCOL *) Sd;
}
/**
Converts a text device path node to EMMC (Embedded MMC) device path structure.
@param TextDeviceNode The input Text device path node.
@return A pointer to the newly-created EMMC device path structure.
**/
EFI_DEVICE_PATH_PROTOCOL *
DevPathFromTextEmmc (
IN CHAR16 *TextDeviceNode
)
{
CHAR16 *SlotNumberStr;
EMMC_DEVICE_PATH *Emmc;
SlotNumberStr = GetNextParamStr (&TextDeviceNode);
Emmc = (EMMC_DEVICE_PATH *) CreateDeviceNode (
MESSAGING_DEVICE_PATH,
MSG_EMMC_DP,
(UINT16) sizeof (EMMC_DEVICE_PATH)
);
Emmc->SlotNumber = (UINT8) Strtoi (SlotNumberStr);
return (EFI_DEVICE_PATH_PROTOCOL *) Emmc;
}
/**
Converts a text device path node to Debug Port device path structure.
@@ -3501,6 +3529,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"NVMe", DevPathFromTextNVMe },
{L"UFS", DevPathFromTextUfs },
{L"SD", DevPathFromTextSd },
{L"Emmc", DevPathFromTextEmmc },
{L"DebugPort", DevPathFromTextDebugPort },
{L"MAC", DevPathFromTextMAC },
{L"IPv4", DevPathFromTextIPv4 },