]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
1.Fix a bug in Dhcp4Dxe driver to correct the ‘secs’ field in DHCP message.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcSupport.c
index 60cace885de1043b3cd377a373cdb225ce95db22..327e4a26d81cad633d30d7aa502d4a4e4ea6ea52 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for PxeBc.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2011, 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
@@ -16,127 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "PxeBcImpl.h"\r
 \r
 \r
-/**\r
-  This function returns SMBIOS string given the string number.\r
-\r
-  @param  Smbios              Pointer to SMBIOS structure\r
-  @param  StringNumber        String number to return. 0 is used to skip all\r
-                              strings and  point to the next SMBIOS structure.\r
-\r
-  @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == 0\r
-\r
-**/\r
-CHAR8 *\r
-GetSmbiosString (\r
-  IN  SMBIOS_STRUCTURE_POINTER  *Smbios,\r
-  IN  UINT16                    StringNumber\r
-  )\r
-{\r
-  UINT16  Index;\r
-  CHAR8   *String;\r
-\r
-  //\r
-  // Skip over formatted section\r
-  //\r
-  String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length);\r
-\r
-  //\r
-  // Look through unformated section\r
-  //\r
-  for (Index = 1; Index <= StringNumber || StringNumber == 0; Index++) {\r
-    if (StringNumber == Index) {\r
-      return String;\r
-    }\r
-    //\r
-    // Skip string\r
-    //\r
-    for (; *String != 0; String++)\r
-      ;\r
-    String++;\r
-\r
-    if (*String == 0) {\r
-      //\r
-      // If double NULL then we are done.\r
-      //  Return pointer to next structure in Smbios.\r
-      //  if you pass in a 0 you will always get here\r
-      //\r
-      Smbios->Raw = (UINT8 *)++String;\r
-      return NULL;\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-\r
-/**\r
-  This function gets system guid and serial number from the smbios table.\r
-\r
-  @param  SystemGuid          The pointer of returned system guid.\r
-  @param  SystemSerialNumber  The pointer of returned system serial number.\r
-\r
-  @retval EFI_SUCCESS         Successfully get the system guid and system serial\r
-                              number.\r
-  @retval EFI_NOT_FOUND       Not find the SMBIOS table.\r
-\r
-**/\r
-EFI_STATUS\r
-GetSmbiosSystemGuidAndSerialNumber (\r
-  IN  EFI_GUID  *SystemGuid,\r
-  OUT CHAR8     **SystemSerialNumber\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  SMBIOS_TABLE_ENTRY_POINT  *SmbiosTable;\r
-  SMBIOS_STRUCTURE_POINTER  Smbios;\r
-  SMBIOS_STRUCTURE_POINTER  SmbiosEnd;\r
-  UINT16                    Index;\r
-\r
-  Status = EfiGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  ASSERT (SmbiosTable != NULL);\r
-\r
-  Smbios.Hdr    = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;\r
-  SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength);\r
-\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 = GetSmbiosString (&Smbios, Smbios.Type1->SerialNumber);\r
-\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // Make Smbios point to the next record\r
-    //\r
-    GetSmbiosString (&Smbios, 0);\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 length of the structure.\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
 /**\r
   The common notify function associated with various PxeBc events.\r
 \r