Revision: 18787
          http://sourceforge.net/p/edk2/code/18787
Author:   vanjeff
Date:     2015-11-16 06:48:33 +0000 (Mon, 16 Nov 2015)
Log Message:
-----------
MdeModulePkg: Add SMBIOS 3.0 support in NetLibGetSystemGuid.

NetLibGetSystemGuid gets the UUID from SMBIOS table to use as the System GUID
(in DHCP and other network use cases). This change adds support to get the
UUID from either SMBIOS 2.x or 3.0, since SMBIOS 3.0 uses a different GUID in
the System Configuration Table.

(Sync patch r18559 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18559

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
    branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf

Modified: branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c 2015-11-16 
06:38:54 UTC (rev 18786)
+++ branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c 2015-11-16 
06:48:33 UTC (rev 18787)
@@ -2,6 +2,7 @@
   Network library.
 
 Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -3254,22 +3255,27 @@
   OUT EFI_GUID              *SystemGuid
   )
 {
-  EFI_STATUS                Status;
-  SMBIOS_TABLE_ENTRY_POINT  *SmbiosTable;
-  SMBIOS_STRUCTURE_POINTER  Smbios;
-  SMBIOS_STRUCTURE_POINTER  SmbiosEnd;
-  CHAR8                     *String;
+  EFI_STATUS                    Status;
+  SMBIOS_TABLE_ENTRY_POINT      *SmbiosTable;
+  SMBIOS_TABLE_3_0_ENTRY_POINT  *Smbios30Table;
+  SMBIOS_STRUCTURE_POINTER      Smbios;
+  SMBIOS_STRUCTURE_POINTER      SmbiosEnd;
+  CHAR8                         *String;
 
   SmbiosTable = NULL;
-  Status      = EfiGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID 
**) &SmbiosTable);
-
-  if (EFI_ERROR (Status) || SmbiosTable == NULL) {
-    return EFI_NOT_FOUND;
+  Status = EfiGetSystemConfigurationTable (&gEfiSmbios3TableGuid, (VOID **) 
&Smbios30Table);
+  if (!(EFI_ERROR (Status) || Smbios30Table == NULL)) {
+    Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) Smbios30Table->TableAddress;
+    SmbiosEnd.Raw = (UINT8 *) (UINTN) (Smbios30Table->TableAddress + 
Smbios30Table->TableMaximumSize);
+  } else {
+    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);
   }
 
-  Smbios.Hdr    = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;
-  SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + 
SmbiosTable->TableLength);
-
   do {
     if (Smbios.Hdr->Type == 1) {
       if (Smbios.Hdr->Length < 0x19) {

Modified: branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
===================================================================
--- branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf       
2015-11-16 06:38:54 UTC (rev 18786)
+++ branches/UDK2015/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf       
2015-11-16 06:48:33 UTC (rev 18787)
@@ -2,6 +2,7 @@
 #  This library instance provides the basic network services.
 #
 #  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -52,6 +53,7 @@
 
 [Guids]
   gEfiSmbiosTableGuid                           ## SOMETIMES_CONSUMES  ## 
SystemTable
+  gEfiSmbios3TableGuid                          ## SOMETIMES_CONSUMES  ## 
SystemTable
 
 
 [Protocols]


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to