summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2015-04-29 02:37:30 +0000
committererictian <erictian@Edk2>2015-04-29 02:37:30 +0000
commit5230616612bfdaf388aef75a6eb921f7ca6dafcb (patch)
tree510cde3e18d445c2fc70f61937949c1cb756f8e5 /MdePkg/Library
parentb483e74d5a972d1d3b3f422c50ef7af5d7ab9892 (diff)
downloadedk2-5230616612bfdaf388aef75a6eb921f7ca6dafcb.tar.gz
edk2-5230616612bfdaf388aef75a6eb921f7ca6dafcb.tar.bz2
edk2-5230616612bfdaf388aef75a6eb921f7ca6dafcb.zip
MdePkg: Add UFS (Universal Flash Storage) related definitions
These definitions are defined in UEFI2.5/PI1.4 spec. 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@17245 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c32
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathToText.c28
2 files changed, 60 insertions, 0 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index 6ec0a4c0bd..f688c1af74 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1810,6 +1810,37 @@ DevPathFromTextNVMe (
}
/**
+ Converts a text device path node to UFS device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to the newly-created UFS device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextUfs (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *PunStr;
+ CHAR16 *LunStr;
+ UFS_DEVICE_PATH *Ufs;
+
+ PunStr = GetNextParamStr (&TextDeviceNode);
+ LunStr = GetNextParamStr (&TextDeviceNode);
+ Ufs = (UFS_DEVICE_PATH *) CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_UFS_DP,
+ (UINT16) sizeof (UFS_DEVICE_PATH)
+ );
+
+ Ufs->Pun = (UINT8) Strtoi (PunStr);
+ Ufs->Lun = (UINT8) Strtoi (LunStr);
+
+ return (EFI_DEVICE_PATH_PROTOCOL *) Ufs;
+}
+
+/**
Converts a text device path node to Debug Port device path structure.
@param TextDeviceNode The input Text device path node.
@@ -3079,6 +3110,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"SAS", DevPathFromTextSAS },
{L"SasEx", DevPathFromTextSasEx },
{L"NVMe", DevPathFromTextNVMe },
+ {L"UFS", DevPathFromTextUfs },
{L"DebugPort", DevPathFromTextDebugPort },
{L"MAC", DevPathFromTextMAC },
{L"IPv4", DevPathFromTextIPv4 },
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
index 030001905b..2dbbddaf09 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
@@ -732,6 +732,33 @@ DevPathToTextNVMe (
}
/**
+ Converts a UFS device path structure to its string representative.
+
+ @param Str The string representative of input device.
+ @param DevPath The input device path structure.
+ @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
+ of the display node is used, where applicable. If DisplayOnly
+ is FALSE, then the longer text representation of the display node
+ is used.
+ @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
+ representation for a device node can be used, where applicable.
+
+**/
+VOID
+DevPathToTextUfs (
+ IN OUT POOL_PRINT *Str,
+ IN VOID *DevPath,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+ )
+{
+ UFS_DEVICE_PATH *Ufs;
+
+ Ufs = DevPath;
+ UefiDevicePathLibCatPrint (Str, L"UFS(0x%x,0x%x)", Ufs->Pun, Ufs->Lun);
+}
+
+/**
Converts a 1394 device path structure to its string representative.
@param Str The string representative of input device.
@@ -1869,6 +1896,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLib
{MESSAGING_DEVICE_PATH, MSG_FIBRECHANNELEX_DP, DevPathToTextFibreEx },
{MESSAGING_DEVICE_PATH, MSG_SASEX_DP, DevPathToTextSasEx },
{MESSAGING_DEVICE_PATH, MSG_NVME_NAMESPACE_DP, DevPathToTextNVMe },
+ {MESSAGING_DEVICE_PATH, MSG_UFS_DP, DevPathToTextUfs },
{MESSAGING_DEVICE_PATH, MSG_1394_DP, DevPathToText1394 },
{MESSAGING_DEVICE_PATH, MSG_USB_DP, DevPathToTextUsb },
{MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP, DevPathToTextUsbWWID },