]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update the structure of EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, PXE_HW_UNDI, PXE_S...
authorQian Ouyang <qian.ouyang@intel.com>
Tue, 20 Aug 2013 02:22:00 +0000 (02:22 +0000)
committerqianouyang <qianouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 Aug 2013 02:22:00 +0000 (02:22 +0000)
Signed-off-by: Qian Ouyang <qian.ouyang@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
             Siyuan Fu <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14569 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/SnpDxe/Snp.c
MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h
MdePkg/Include/Uefi/UefiPxe.h
OptionRomPkg/UndiRuntimeDxe/Decode.c
OptionRomPkg/UndiRuntimeDxe/Init.c

index 177d0a913dfecb5f6354c2170e526ba958b3c247..ed583b488832d0326e1c6e60a7d81c4bc5ec82d0 100644 (file)
@@ -410,8 +410,13 @@ SimpleNetworkDriverStart (
 \r
   Snp->TxRxBufferSize     = 0;\r
   Snp->TxRxBuffer         = NULL;\r
 \r
   Snp->TxRxBufferSize     = 0;\r
   Snp->TxRxBuffer         = NULL;\r
\r
+  if (Nii->Revision >= EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION) {\r
+       Snp->IfNum = Nii->IfNum;\r
 \r
 \r
-  Snp->IfNum              = Nii->IfNum;\r
+  } else {\r
+    Snp->IfNum = (UINT8) (Nii->IfNum & 0xFF);\r
+  }\r
 \r
   if ((Pxe->hw.Implementation & PXE_ROMID_IMP_HW_UNDI) != 0) {\r
     Snp->IsSwUndi             = FALSE;\r
 \r
   if ((Pxe->hw.Implementation & PXE_ROMID_IMP_HW_UNDI) != 0) {\r
     Snp->IsSwUndi             = FALSE;\r
index 417a6cdc2bfc56927bec5d66974d79763ca83cd0..88a1c428467c7cea72a5e213b9d72f40761ca9b0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI Network Interface Identifier Protocol.\r
 \r
 /** @file\r
   EFI Network Interface Identifier Protocol.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
 This program and the accompanying materials are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
@@ -34,7 +34,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } \\r
   }\r
 \r
     0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } \\r
   }\r
 \r
-#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION    0x00010000\r
+//\r
+// Revision defined in UEFI Specification 2.4\r
+//\r
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION    0x00020000\r
+\r
 \r
 ///\r
 /// Revision defined in EFI1.1.\r
 \r
 ///\r
 /// Revision defined in EFI1.1.\r
@@ -70,9 +74,9 @@ struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {
   UINT8     MajorVer;   ///< Major version number.\r
   UINT8     MinorVer;   ///< Minor version number.\r
   BOOLEAN   Ipv6Supported; ///< TRUE if the network interface supports IPv6; otherwise FALSE.\r
   UINT8     MajorVer;   ///< Major version number.\r
   UINT8     MinorVer;   ///< Minor version number.\r
   BOOLEAN   Ipv6Supported; ///< TRUE if the network interface supports IPv6; otherwise FALSE.\r
-  UINT8     IfNum;      ///< The network interface number that is being identified by this Network\r
-                        ///< Interface Identifier Protocol. This field must be less than or equal\r
-                        ///< to the IFcnt field in the !PXE structure.\r
+  UINT16    IfNum;      ///< The network interface number that is being identified by this Network \r
+                        ///< Interface Identifier Protocol. This field must be less than or \r
+                        ///< equal to the (IFcnt | IFcntExt <<8 ) fields in the !PXE structure.\r
 \r
 };\r
 \r
 \r
 };\r
 \r
index 165359b605e837247467419a934b2c4a698e1df2..2972ff7e31afed9c4a922f7d50e1a6eb0db588a6 100644 (file)
@@ -3,7 +3,7 @@
   structure prototypes, global variables and constants that\r
   are needed for porting PXE to EFI.\r
 \r
   structure prototypes, global variables and constants that\r
   are needed for porting PXE to EFI.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -719,10 +719,11 @@ typedef struct s_pxe_hw_undi {
   PXE_UINT8   Len;            ///< sizeof(PXE_HW_UNDI).\r
   PXE_UINT8   Fudge;          ///< makes 8-bit cksum equal zero.\r
   PXE_UINT8   Rev;            ///< PXE_ROMID_REV.\r
   PXE_UINT8   Len;            ///< sizeof(PXE_HW_UNDI).\r
   PXE_UINT8   Fudge;          ///< makes 8-bit cksum equal zero.\r
   PXE_UINT8   Rev;            ///< PXE_ROMID_REV.\r
-  PXE_UINT8   IFcnt;          ///< physical connector count.\r
+  PXE_UINT8   IFcnt;          ///< physical connector count lower byte.\r
   PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.\r
   PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.\r
   PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.\r
   PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.\r
-  PXE_UINT16  reserved;       ///< zero, not used.\r
+  PXE_UINT8   IFcntExt;       ///< physical connector count upper byte.\r
+  PXE_UINT8   reserved;       ///< zero, not used.\r
   PXE_UINT32  Implementation; ///< implementation flags.\r
   ///< reserved             ///< vendor use.\r
   ///< UINT32 Status;       ///< status port.\r
   PXE_UINT32  Implementation; ///< implementation flags.\r
   ///< reserved             ///< vendor use.\r
   ///< UINT32 Status;       ///< status port.\r
@@ -815,10 +816,11 @@ typedef struct s_pxe_sw_undi {
   PXE_UINT8   Len;            ///< sizeof(PXE_SW_UNDI).\r
   PXE_UINT8   Fudge;          ///< makes 8-bit cksum zero.\r
   PXE_UINT8   Rev;            ///< PXE_ROMID_REV.\r
   PXE_UINT8   Len;            ///< sizeof(PXE_SW_UNDI).\r
   PXE_UINT8   Fudge;          ///< makes 8-bit cksum zero.\r
   PXE_UINT8   Rev;            ///< PXE_ROMID_REV.\r
-  PXE_UINT8   IFcnt;          ///< physical connector count.\r
+  PXE_UINT8   IFcnt;          ///< physical connector count lower byte.\r
   PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.\r
   PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.\r
   PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.\r
   PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.\r
-  PXE_UINT16  reserved1;      ///< zero, not used.\r
+  PXE_UINT8   IFcntExt;       ///< physical connector count upper byte.\r
+  PXE_UINT8   reserved1;      ///< zero, not used.\r
   PXE_UINT32  Implementation; ///< Implementation flags.\r
   PXE_UINT64  EntryPoint;     ///< API entry point.\r
   PXE_UINT8   reserved2[3];   ///< zero, not used.\r
   PXE_UINT32  Implementation; ///< Implementation flags.\r
   PXE_UINT64  EntryPoint;     ///< API entry point.\r
   PXE_UINT8   reserved2[3];   ///< zero, not used.\r
index 0eabc2ad8fcd3f2df765dca8c10236c7a6ff5676..eb0ee1d69353ab00324b415e913daea59c0d11bc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides the basic UNID functions.\r
 \r
 /** @file\r
   Provides the basic UNID functions.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, 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
 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
@@ -1290,7 +1290,7 @@ UNDI_APIEntry_new (
 \r
   CdbPtr = (PXE_CDB *) (UINTN) cdb;\r
 \r
 \r
   CdbPtr = (PXE_CDB *) (UINTN) cdb;\r
 \r
-  if (CdbPtr->IFnum >= pxe_31->IFcnt) {\r
+  if (CdbPtr->IFnum >= (pxe_31->IFcnt | pxe_31->IFcntExt << 8) ) {\r
     CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;\r
     CdbPtr->StatCode  = PXE_STATCODE_INVALID_CDB;\r
     return ;\r
     CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;\r
     CdbPtr->StatCode  = PXE_STATCODE_INVALID_CDB;\r
     return ;\r
@@ -1336,7 +1336,7 @@ UNDI_APIEntry_Common (
   if ((CdbPtr->OpCode > PXE_OPCODE_LAST_VALID) ||\r
       (CdbPtr->StatCode != PXE_STATCODE_INITIALIZE) ||\r
       (CdbPtr->StatFlags != PXE_STATFLAGS_INITIALIZE) ||\r
   if ((CdbPtr->OpCode > PXE_OPCODE_LAST_VALID) ||\r
       (CdbPtr->StatCode != PXE_STATCODE_INITIALIZE) ||\r
       (CdbPtr->StatFlags != PXE_STATFLAGS_INITIALIZE) ||\r
-      (CdbPtr->IFnum >= pxe_31->IFcnt) ) {\r
+      (CdbPtr->IFnum >= (pxe_31->IFcnt | pxe_31->IFcntExt << 8) ) {\r
     goto badcdb;\r
 \r
   }\r
     goto badcdb;\r
 \r
   }\r
@@ -1436,24 +1436,28 @@ PxeUpdate (
   IN PXE_SW_UNDI        *PxePtr\r
   )\r
 {\r
   IN PXE_SW_UNDI        *PxePtr\r
   )\r
 {\r
+  UINT16 NicNum;\r
+  NicNum = (PxePtr->IFcnt | PxePtr->IFcntEx << 8);\r
+  \r
   if (NicPtr == NULL) {\r
   if (NicPtr == NULL) {\r
-    if (PxePtr->IFcnt > 0) {\r
+    if (NicNum > 0) {\r
       //\r
       // number of NICs this undi supports\r
       //\r
       //\r
       // number of NICs this undi supports\r
       //\r
-      PxePtr->IFcnt--;\r
+      NicNum --;\r
     }\r
     }\r
-\r
-    PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
-    return ;\r
+    goto done;\r
   }\r
 \r
   //\r
   // number of NICs this undi supports\r
   //\r
   }\r
 \r
   //\r
   // number of NICs this undi supports\r
   //\r
-  PxePtr->IFcnt++;\r
+  NicNum++;\r
+  \r
+done: \r
+  PxePtr->IFcnt = (UINT8)(NicNum & 0xFF);\r
+  PxePtr->IFcntEx = (UINT8) ((NicNum & 0xFF00) >> 8);\r
   PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
   PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
-\r
   return ;\r
 }\r
 \r
   return ;\r
 }\r
 \r
@@ -1485,6 +1489,7 @@ PxeStructInit (
   // number of NICs this undi supports\r
   //\r
   PxePtr->IFcnt = 0;\r
   // number of NICs this undi supports\r
   //\r
   PxePtr->IFcnt = 0;\r
+  PxePtr->IFcntEx = 0;\r
   PxePtr->Rev       = PXE_ROMID_REV;\r
   PxePtr->MajorVer  = PXE_ROMID_MAJORVER;\r
   PxePtr->MinorVer  = PXE_ROMID_MINORVER;\r
   PxePtr->Rev       = PXE_ROMID_REV;\r
   PxePtr->MajorVer  = PXE_ROMID_MAJORVER;\r
   PxePtr->MinorVer  = PXE_ROMID_MINORVER;\r
index 3d0a3de5cb3fe14577dbcc8239306d7737a0a090..9410fe167a48dcb508157452144e8a71f6392056 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Initialization functions for EFI UNDI32 driver.\r
 \r
 /** @file\r
   Initialization functions for EFI UNDI32 driver.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, 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
 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
@@ -64,7 +64,7 @@ UndiNotifyVirtual (
     //\r
     // UNDI32DeviceList is an array of pointers\r
     //\r
     //\r
     // UNDI32DeviceList is an array of pointers\r
     //\r
-    for (Index = 0; Index < pxe_31->IFcnt; Index++) {\r
+    for (Index = 0; Index < (pxe_31->IFcnt | pxe_31->IFcntExt << 8); Index++) {\r
       UNDI32DeviceList[Index]->NIIProtocol_31.Id = (UINT64) (UINTN) Pxe31Pointer;\r
       EfiConvertPointer (\r
         EFI_OPTIONAL_PTR,\r
       UNDI32DeviceList[Index]->NIIProtocol_31.Id = (UINT64) (UINTN) Pxe31Pointer;\r
       EfiConvertPointer (\r
         EFI_OPTIONAL_PTR,\r
@@ -409,7 +409,7 @@ UndiDriverStart (
   // the IfNum index for the current interface will be the total number\r
   // of interfaces initialized so far\r
   //\r
   // the IfNum index for the current interface will be the total number\r
   // of interfaces initialized so far\r
   //\r
-  UNDI32Device->NIIProtocol_31.IfNum  = pxe_31->IFcnt;\r
+  UNDI32Device->NIIProtocol_31.IfNum  = pxe_31->IFcnt | pxe_31->IFcntExt << 8;\r
 \r
   PxeUpdate (&UNDI32Device->NicInfo, pxe_31);\r
 \r
 \r
   PxeUpdate (&UNDI32Device->NicInfo, pxe_31);\r
 \r
@@ -470,7 +470,7 @@ UndiDriverStart (
     goto UndiErrorDeleteDevicePath;\r
   }\r
 \r
     goto UndiErrorDeleteDevicePath;\r
   }\r
 \r
-  Len = (pxe_31->IFcnt * sizeof (UndiDataPointer->NII_entry)) + sizeof (UndiDataPointer);\r
+  Len = ((pxe_31->IFcnt|pxe_31->IFcntExt << 8)* sizeof (UndiDataPointer->NII_entry)) + sizeof (UndiDataPointer);\r
   Status = gBS->AllocatePool (EfiRuntimeServicesData, Len, (VOID **) &UndiDataPointer);\r
 \r
   if (EFI_ERROR (Status)) {\r
   Status = gBS->AllocatePool (EfiRuntimeServicesData, Len, (VOID **) &UndiDataPointer);\r
 \r
   if (EFI_ERROR (Status)) {\r
@@ -949,10 +949,10 @@ InstallConfigTable (
 \r
   UndiData = (UNDI_CONFIG_TABLE *)UndiDataPointer;\r
 \r
 \r
   UndiData = (UNDI_CONFIG_TABLE *)UndiDataPointer;\r
 \r
-  UndiData->NumberOfInterfaces  = pxe_31->IFcnt;\r
+  UndiData->NumberOfInterfaces  = (pxe_31->IFcnt | pxe_31->IFcntExt << 8);\r
   UndiData->nextlink            = NULL;\r
 \r
   UndiData->nextlink            = NULL;\r
 \r
-  for (Index = 0; Index < pxe_31->IFcnt; Index++) {\r
+  for (Index = 0; Index < (pxe_31->IFcnt | pxe_31->IFcntExt << 8); Index++) {\r
     UndiData->NII_entry[Index].NII_InterfacePointer = &UNDI32DeviceList[Index]->NIIProtocol_31;\r
     UndiData->NII_entry[Index].DevicePathPointer    = UNDI32DeviceList[Index]->Undi32DevPath;\r
   }\r
     UndiData->NII_entry[Index].NII_InterfacePointer = &UNDI32DeviceList[Index]->NIIProtocol_31;\r
     UndiData->NII_entry[Index].DevicePathPointer    = UNDI32DeviceList[Index]->Undi32DevPath;\r
   }\r