Revision: 17383
          http://sourceforge.net/p/edk2/code/17383
Author:   erictian
Date:     2015-05-08 14:18:42 +0000 (Fri, 08 May 2015)
Log Message:
-----------
MdePkg: Add UEFI 2.5 SD (Secure Digital) Device Path Definitions

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdePkg/Include/Protocol/DevicePath.h
    trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
    trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c

Modified: trunk/edk2/MdePkg/Include/Protocol/DevicePath.h
===================================================================
--- trunk/edk2/MdePkg/Include/Protocol/DevicePath.h     2015-05-08 12:08:24 UTC 
(rev 17382)
+++ trunk/edk2/MdePkg/Include/Protocol/DevicePath.h     2015-05-08 14:18:42 UTC 
(rev 17383)
@@ -824,6 +824,15 @@
 } UFS_DEVICE_PATH;
 
 ///
+/// SD (Secure Digital) Device Path SubType.
+///
+#define MSG_SD_DP                 0x1A
+typedef struct {
+  EFI_DEVICE_PATH_PROTOCOL        Header;
+  UINT8                           SlotNumber;
+} SD_DEVICE_PATH;
+
+///
 /// iSCSI Device Path SubType
 ///
 #define MSG_ISCSI_DP              0x13
@@ -1137,6 +1146,7 @@
   URI_DEVICE_PATH                            Uri;
   BLUETOOTH_DEVICE_PATH                      Bluetooth;
   UFS_DEVICE_PATH                            Ufs;
+  SD_DEVICE_PATH                             Sd;
   HARDDRIVE_DEVICE_PATH                      HardDrive;
   CDROM_DEVICE_PATH                          CD;
 
@@ -1190,6 +1200,7 @@
   URI_DEVICE_PATH                            *Uri;
   BLUETOOTH_DEVICE_PATH                      *Bluetooth;
   UFS_DEVICE_PATH                            *Ufs;
+  SD_DEVICE_PATH                             *Sd;
   HARDDRIVE_DEVICE_PATH                      *HardDrive;
   CDROM_DEVICE_PATH                          *CD;
 

Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c    
2015-05-08 12:08:24 UTC (rev 17382)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c    
2015-05-08 14:18:42 UTC (rev 17383)
@@ -1841,6 +1841,34 @@
 }
 
 /**
+  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 @@
   {L"SasEx",                   DevPathFromTextSasEx                   },
   {L"NVMe",                    DevPathFromTextNVMe                    },
   {L"UFS",                     DevPathFromTextUfs                     },
+  {L"SD",                      DevPathFromTextSd                      },
   {L"DebugPort",               DevPathFromTextDebugPort               },
   {L"MAC",                     DevPathFromTextMAC                     },
   {L"IPv4",                    DevPathFromTextIPv4                    },

Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c      
2015-05-08 12:08:24 UTC (rev 17382)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c      
2015-05-08 14:18:42 UTC (rev 17383)
@@ -759,6 +759,37 @@
 }
 
 /**
+  Converts a SD (Secure Digital) 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
+DevPathToTextSd (
+  IN OUT POOL_PRINT  *Str,
+  IN VOID            *DevPath,
+  IN BOOLEAN         DisplayOnly,
+  IN BOOLEAN         AllowShortcuts
+  )
+{
+  SD_DEVICE_PATH             *Sd;
+
+  Sd = DevPath;
+  UefiDevicePathLibCatPrint (
+    Str,
+    L"SD(0x%x)",
+    Sd->SlotNumber
+    );
+}
+
+/**
   Converts a 1394 device path structure to its string representative.
 
   @param Str             The string representative of input device.
@@ -1972,6 +2003,7 @@
   {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_SD_DP,                        DevPathToTextSd    
         },
   {MESSAGING_DEVICE_PATH, MSG_1394_DP,                      DevPathToText1394  
         },
   {MESSAGING_DEVICE_PATH, MSG_USB_DP,                       DevPathToTextUsb   
         },
   {MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP,                  
DevPathToTextUsbWWID        },


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to