summaryrefslogtreecommitdiff
path: root/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c122
1 files changed, 0 insertions, 122 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
index 28383b32aa..30418c3b6a 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
@@ -16,128 +16,6 @@
#include "PxeBcImpl.h"
-
-/**
- This function returns SMBIOS string given the string number.
-
- @param[in] Smbios The pointer to the SMBIOS structure
- @param[in] StringNumber String number to return. 0 is used to skip all
- strings and point to the next SMBIOS structure.
-
- @return String The pointer to the next SMBIOS structure if
- StringNumber == 0.
-
-**/
-CHAR8 *
-PxeBcGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
- )
-{
- UINT16 Index;
- CHAR8 *String;
-
- //
- // Skip over formatted section.
- //
- String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length);
-
- //
- // Look through unformated section.
- //
- for (Index = 1; Index <= StringNumber || StringNumber == 0; Index++) {
- if (StringNumber == Index) {
- return String;
- }
-
- //
- // Skip zero string.
- //
- while (*String != 0) {
- String++;
- }
- String++;
-
- if (*String == 0) {
- //
- // If double NULL then we are done.
- // Return pointer to next structure in Smbios.
- // if you pass in a 0 you will always get here
- //
- Smbios->Raw = (UINT8 *)++String;
- return NULL;
- }
- }
-
- return NULL;
-}
-
-
-/**
- This function obtains the system guid and the serial number from the smbios table.
-
- @param[out] SystemGuid The pointer of the returned system guid.
-
- @retval EFI_SUCCESS Successfully obtained the system guid.
- @retval EFI_NOT_FOUND Did not find the SMBIOS table.
-
-**/
-EFI_STATUS
-PxeBcGetSystemGuid (
- OUT EFI_GUID *SystemGuid
- )
-{
- EFI_STATUS Status;
- SMBIOS_TABLE_ENTRY_POINT *SmbiosTable;
- SMBIOS_STRUCTURE_POINTER Smbios;
- SMBIOS_STRUCTURE_POINTER SmbiosEnd;
- UINT16 Index;
-
- SmbiosTable = NULL;
- Status = EfiGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable);
-
- if (EFI_ERROR (Status) || SmbiosTable == NULL) {
- return EFI_NOT_FOUND;
- }
-
- Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;
- SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength);
-
- for (Index = 0; Index < SmbiosTable->TableLength; Index++) {
- if (Smbios.Hdr->Type == 1) {
- if (Smbios.Hdr->Length < 0x19) {
- //
- // Older version did not support Guid and Serial number
- //
- continue;
- }
- //
- // SMBIOS tables are byte packed so we need to do a byte copy to
- // prevend alignment faults on Itanium-based platform.
- //
- CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof (EFI_GUID));
- PxeBcGetSmbiosString (&Smbios, Smbios.Type1->SerialNumber);
-
- return EFI_SUCCESS;
- }
- //
- // Make Smbios point to the next record
- //
- PxeBcGetSmbiosString (&Smbios, 0);
-
- if (Smbios.Raw >= SmbiosEnd.Raw) {
- //
- // SMBIOS 2.1 incorrectly stated the length of SmbiosTable as 0x1e.
- // given this we must double check against the length of the structure.
- //
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-
/**
Flush the previous configration using the new station Ip address.