]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
[mirror_edk2.git] / UnixPkg / MiscSubClassPlatformDxe / MiscSystemManufacturerFunction.c
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
deleted file mode 100644 (file)
index 3582447..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 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
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSystemManufacturerFunction.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemManufacturer (Type 1).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)\r
-{\r
-  CHAR8                             *OptionalStrStart;\r
-  UINTN                             ManuStrLen;\r
-  UINTN                             VerStrLen;\r
-  UINTN                             PdNameStrLen;\r
-  UINTN                             SerialNumStrLen;\r
-  EFI_STATUS                        Status;\r
-  EFI_STRING                        Manufacturer;\r
-  EFI_STRING                        ProductName;\r
-  EFI_STRING                        Version;\r
-  EFI_STRING                        SerialNumber;\r
-  STRING_REF                        TokenToGet;\r
-  EFI_SMBIOS_HANDLE                 SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE1                *SmbiosRecord;\r
-  EFI_MISC_SYSTEM_MANUFACTURER      *ForType1InputData;\r
-\r
-  ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);\r
-  ProductName = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  PdNameStrLen = StrLen(ProductName);\r
-  if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Manufacturer = 1;\r
-  //\r
-  // ProductName will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->ProductName = 2;  \r
-  //\r
-  // Version will be the 3rd optional string following the formatted structure.  \r
-  //\r
-  SmbiosRecord->Version = 3;  \r
-  //\r
-  // Version will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 4;\r
-  CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,16);\r
-  SmbiosRecord->WakeUpType = (UINT8)ForType1InputData->SystemWakeupType;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
-/* eof - MiscSystemManufacturerFunction.c */\r