summaryrefslogtreecommitdiff
path: root/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2015-05-08 14:18:42 +0000
committererictian <erictian@Edk2>2015-05-08 14:18:42 +0000
commitab8686b892137598948469db3c6bd1793dca0d0b (patch)
tree6f4827924a3bf8143c68cc038da4a55c201e0821 /MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
parentee171cce9b9ebdeeb25f4a0a8cef7e8823c8e9f5 (diff)
downloadedk2-platforms-ab8686b892137598948469db3c6bd1793dca0d0b.tar.xz
MdePkg: Add UEFI 2.5 SD (Secure Digital) Device Path Definitions
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17383 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c')
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index e3ab6e1e3d..3bccad9909 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1841,6 +1841,34 @@ DevPathFromTextUfs (
}
/**
+ Converts a text device path node to SD (Secure Digital) device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to the newly-created SD device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextSd (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *SlotNumberStr;
+ SD_DEVICE_PATH *Sd;
+
+ SlotNumberStr = GetNextParamStr (&TextDeviceNode);
+ Sd = (SD_DEVICE_PATH *) CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_SD_DP,
+ (UINT16) sizeof (SD_DEVICE_PATH)
+ );
+
+ Sd->SlotNumber = (UINT8) Strtoi (SlotNumberStr);
+
+ return (EFI_DEVICE_PATH_PROTOCOL *) Sd;
+}
+
+/**
Converts a text device path node to Debug Port device path structure.
@param TextDeviceNode The input Text device path node.
@@ -3188,6 +3216,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"SasEx", DevPathFromTextSasEx },
{L"NVMe", DevPathFromTextNVMe },
{L"UFS", DevPathFromTextUfs },
+ {L"SD", DevPathFromTextSd },
{L"DebugPort", DevPathFromTextDebugPort },
{L"MAC", DevPathFromTextMAC },
{L"IPv4", DevPathFromTextIPv4 },