]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
MdePkg BaseMemoryLibRepStr: Convert Ia32/ScanMem8.asm to NASM
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / DevicePathFromText.c
index 6a9b389ca5c5392b3d621170632f5ff760b99d09..c167b4ce031eb37ee34f53617b1851089544087c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DevicePathFromText protocol as defined in the UEFI 2.0 specification.\r
 \r
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1902,6 +1902,34 @@ DevPathFromTextSd (
   return (EFI_DEVICE_PATH_PROTOCOL *) Sd;\r
 }\r
 \r
+/**\r
+  Converts a text device path node to EMMC (Embedded MMC) device path structure.\r
+\r
+  @param TextDeviceNode  The input Text device path node.\r
+\r
+  @return A pointer to the newly-created EMMC device path structure.\r
+\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+DevPathFromTextEmmc (\r
+  IN CHAR16 *TextDeviceNode\r
+  )\r
+{\r
+  CHAR16            *SlotNumberStr;\r
+  EMMC_DEVICE_PATH  *Emmc;\r
+\r
+  SlotNumberStr = GetNextParamStr (&TextDeviceNode);\r
+  Emmc          = (EMMC_DEVICE_PATH *) CreateDeviceNode (\r
+                                       MESSAGING_DEVICE_PATH,\r
+                                       MSG_EMMC_DP,\r
+                                       (UINT16) sizeof (EMMC_DEVICE_PATH)\r
+                                       );\r
+\r
+  Emmc->SlotNumber = (UINT8) Strtoi (SlotNumberStr);\r
+\r
+  return (EFI_DEVICE_PATH_PROTOCOL *) Emmc;\r
+}\r
+\r
 /**\r
   Converts a text device path node to Debug Port device path structure.\r
 \r
@@ -2845,7 +2873,7 @@ DevPathFromTextWiFi (
       DataLen     = 32;\r
     }\r
 \r
-    UnicodeStrToAsciiStr (SSIdStr, AsciiStr);\r
+    UnicodeStrToAsciiStrS (SSIdStr, AsciiStr, sizeof (AsciiStr));\r
     CopyMem (WiFiDp->SSId, AsciiStr, DataLen);\r
   }\r
 \r
@@ -3501,6 +3529,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
   {L"NVMe",                    DevPathFromTextNVMe                    },\r
   {L"UFS",                     DevPathFromTextUfs                     },\r
   {L"SD",                      DevPathFromTextSd                      },\r
+  {L"Emmc",                    DevPathFromTextEmmc                    },\r
   {L"DebugPort",               DevPathFromTextDebugPort               },\r
   {L"MAC",                     DevPathFromTextMAC                     },\r
   {L"IPv4",                    DevPathFromTextIPv4                    },\r