]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
MdePkg: Add BMC device path definition and its node/text conversion
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / DevicePathToText.c
index e82a70484c09e7a09cf5753a9456bd00c93b3827..8428c1cb7ec7c5d648169794a1cd8ee9145dadeb 100644 (file)
@@ -306,6 +306,38 @@ DevPathToTextController (
     );\r
 }\r
 \r
+/**\r
+  Converts a BMC device path structure to its string representative.\r
+\r
+  @param Str             The string representative of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
+VOID\r
+DevPathToTextBmc (\r
+  IN OUT POOL_PRINT  *Str,\r
+  IN VOID            *DevPath,\r
+  IN BOOLEAN         DisplayOnly,\r
+  IN BOOLEAN         AllowShortcuts\r
+  )\r
+{\r
+  BMC_DEVICE_PATH    *Bmc;\r
+\r
+  Bmc = DevPath;\r
+  UefiDevicePathLibCatPrint (\r
+    Str,\r
+    L"Bmc(0x%x,0x%lx)",\r
+    Bmc->InterfaceType,\r
+    ReadUnaligned64 ((UINT64 *) (&Bmc->BaseAddress))\r
+    );\r
+}\r
+\r
 /**\r
   Converts a ACPI device path structure to its string representative.\r
 \r
@@ -2089,6 +2121,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLib
   {HARDWARE_DEVICE_PATH,  HW_MEMMAP_DP,                     DevPathToTextMemMap         },\r
   {HARDWARE_DEVICE_PATH,  HW_VENDOR_DP,                     DevPathToTextVendor         },\r
   {HARDWARE_DEVICE_PATH,  HW_CONTROLLER_DP,                 DevPathToTextController     },\r
+  {HARDWARE_DEVICE_PATH,  HW_BMC_DP,                        DevPathToTextBmc            },\r
   {ACPI_DEVICE_PATH,      ACPI_DP,                          DevPathToTextAcpi           },\r
   {ACPI_DEVICE_PATH,      ACPI_EXTENDED_DP,                 DevPathToTextAcpiEx         },\r
   {ACPI_DEVICE_PATH,      ACPI_ADR_DP,                      DevPathToTextAcpiAdr        },\r