]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c
add comments to function declarations and definitions and updated to match coding...
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / Smbios.c
index 8d21967dcc4eaacdafcaccf7e0bc690a6f354e1b..8df7c8112394733fc7a4dc2e64214a6082e76556 100644 (file)
 #include <Guid/Smbios.h>\r
 #include "LibSmbios.h"\r
 \r
-EFI_STATUS\r
-LibGetSmbiosSystemGuidAndSerialNumber (\r
-  IN  EFI_GUID    *SystemGuid,\r
-  OUT CHAR8       **SystemSerialNumber\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  SMBIOS_STRUCTURE_TABLE    *SmbiosTable;\r
-  SMBIOS_STRUCTURE_POINTER  Smbios;\r
-  SMBIOS_STRUCTURE_POINTER  SmbiosEnd;\r
-  UINT16                    Index;\r
-\r
-  Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable);\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  Smbios.Hdr    = (SMBIOS_HEADER *) ((UINTN) (SmbiosTable->TableAddress));\r
-\r
-  SmbiosEnd.Raw = (UINT8 *) ((UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength));\r
-  for (Index = 0; Index < SmbiosTable->TableLength; Index++) {\r
-    if (Smbios.Hdr->Type == 1) {\r
-      if (Smbios.Hdr->Length < 0x19) {\r
-        //\r
-        // Older version did not support Guid and Serial number\r
-        //\r
-        continue;\r
-      }\r
-      //\r
-      // SMBIOS tables are byte packed so we need to do a byte copy to\r
-      //  prevend alignment faults on Itanium-based platform.\r
-      //\r
-      CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof (EFI_GUID));\r
-      *SystemSerialNumber = LibGetSmbiosString (&Smbios, Smbios.Type1->SerialNumber);\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // Make Smbios point to the next record\r
-    //\r
-    LibGetSmbiosString (&Smbios, (UINT16) (-1));\r
-\r
-    if (Smbios.Raw >= SmbiosEnd.Raw) {\r
-      //\r
-      // SMBIOS 2.1 incorrectly stated the length of SmbiosTable as 0x1e.\r
-      // given this we must double check against the lenght of\r
-      // the structure. My home PC has this bug.ruthard\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
+/**\r
+  Return SMBIOS string given the string number.\r
 \r
-  return EFI_SUCCESS;\r
-}\r
+  @param[in] Smbios         Pointer to SMBIOS structure.\r
+  @param[in] StringNumber   String number to return. -1 is used to skip all strings and\r
+                            point to the next SMBIOS structure.\r
 \r
-CHAR8 *\r
+  @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1\r
+**/\r
+CHAR8*\r
 LibGetSmbiosString (\r
   IN  SMBIOS_STRUCTURE_POINTER    *Smbios,\r
   IN  UINT16                      StringNumber\r
   )\r
-/*++\r
-Routine Description:\r
-  Return SMBIOS string given the string number.\r
-\r
-  Arguments:\r
-      Smbios       - Pointer to SMBIOS structure\r
-      StringNumber - String number to return. -1 is used to skip all strings and\r
-                     point to the next SMBIOS structure.\r
-\r
-  Returns:\r
-      Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1\r
-**/\r
 {\r
   UINT16  Index;\r
   CHAR8   *String;\r