summaryrefslogtreecommitdiffstats
path: root/OptionRomPkg
diff options
context:
space:
mode:
authorQian Ouyang <qian.ouyang@intel.com>2013-08-20 02:22:00 +0000
committerqianouyang <qianouyang@6f19259b-4bc3-4df7-8a09-765794883524>2013-08-20 02:22:00 +0000
commit61f2ab909d473aaf6faa278424287685a2c502fe (patch)
tree858beb0eefd0df1499877b4e63210caeec64c292 /OptionRomPkg
parent2e969d2e9e98820a136002699ff1d02ba2a2f551 (diff)
downloadedk2-61f2ab909d473aaf6faa278424287685a2c502fe.tar.gz
edk2-61f2ab909d473aaf6faa278424287685a2c502fe.tar.bz2
edk2-61f2ab909d473aaf6faa278424287685a2c502fe.zip
Update the structure of EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, PXE_HW_UNDI, PXE_SW_UNDI to support greater than 256NICs in UNDI (Request by UEFI2.4 Mantis991).
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
Diffstat (limited to 'OptionRomPkg')
-rw-r--r--OptionRomPkg/UndiRuntimeDxe/Decode.c25
-rw-r--r--OptionRomPkg/UndiRuntimeDxe/Init.c12
2 files changed, 21 insertions, 16 deletions
diff --git a/OptionRomPkg/UndiRuntimeDxe/Decode.c b/OptionRomPkg/UndiRuntimeDxe/Decode.c
index 0eabc2ad8f..eb0ee1d693 100644
--- a/OptionRomPkg/UndiRuntimeDxe/Decode.c
+++ b/OptionRomPkg/UndiRuntimeDxe/Decode.c
@@ -1,7 +1,7 @@
/** @file
Provides the basic UNID functions.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<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
@@ -1290,7 +1290,7 @@ UNDI_APIEntry_new (
CdbPtr = (PXE_CDB *) (UINTN) cdb;
- if (CdbPtr->IFnum >= pxe_31->IFcnt) {
+ if (CdbPtr->IFnum >= (pxe_31->IFcnt | pxe_31->IFcntExt << 8) ) {
CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;
CdbPtr->StatCode = PXE_STATCODE_INVALID_CDB;
return ;
@@ -1336,7 +1336,7 @@ UNDI_APIEntry_Common (
if ((CdbPtr->OpCode > PXE_OPCODE_LAST_VALID) ||
(CdbPtr->StatCode != PXE_STATCODE_INITIALIZE) ||
(CdbPtr->StatFlags != PXE_STATFLAGS_INITIALIZE) ||
- (CdbPtr->IFnum >= pxe_31->IFcnt) ) {
+ (CdbPtr->IFnum >= (pxe_31->IFcnt | pxe_31->IFcntExt << 8) ) {
goto badcdb;
}
@@ -1436,24 +1436,28 @@ PxeUpdate (
IN PXE_SW_UNDI *PxePtr
)
{
+ UINT16 NicNum;
+ NicNum = (PxePtr->IFcnt | PxePtr->IFcntEx << 8);
+
if (NicPtr == NULL) {
- if (PxePtr->IFcnt > 0) {
+ if (NicNum > 0) {
//
// number of NICs this undi supports
//
- PxePtr->IFcnt--;
+ NicNum --;
}
-
- PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
- return ;
+ goto done;
}
//
// number of NICs this undi supports
//
- PxePtr->IFcnt++;
+ NicNum++;
+
+done:
+ PxePtr->IFcnt = (UINT8)(NicNum & 0xFF);
+ PxePtr->IFcntEx = (UINT8) ((NicNum & 0xFF00) >> 8);
PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
-
return ;
}
@@ -1485,6 +1489,7 @@ PxeStructInit (
// number of NICs this undi supports
//
PxePtr->IFcnt = 0;
+ PxePtr->IFcntEx = 0;
PxePtr->Rev = PXE_ROMID_REV;
PxePtr->MajorVer = PXE_ROMID_MAJORVER;
PxePtr->MinorVer = PXE_ROMID_MINORVER;
diff --git a/OptionRomPkg/UndiRuntimeDxe/Init.c b/OptionRomPkg/UndiRuntimeDxe/Init.c
index 3d0a3de5cb..9410fe167a 100644
--- a/OptionRomPkg/UndiRuntimeDxe/Init.c
+++ b/OptionRomPkg/UndiRuntimeDxe/Init.c
@@ -1,7 +1,7 @@
/** @file
Initialization functions for EFI UNDI32 driver.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<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
@@ -64,7 +64,7 @@ UndiNotifyVirtual (
//
// UNDI32DeviceList is an array of pointers
//
- for (Index = 0; Index < pxe_31->IFcnt; Index++) {
+ for (Index = 0; Index < (pxe_31->IFcnt | pxe_31->IFcntExt << 8); Index++) {
UNDI32DeviceList[Index]->NIIProtocol_31.Id = (UINT64) (UINTN) Pxe31Pointer;
EfiConvertPointer (
EFI_OPTIONAL_PTR,
@@ -409,7 +409,7 @@ UndiDriverStart (
// the IfNum index for the current interface will be the total number
// of interfaces initialized so far
//
- UNDI32Device->NIIProtocol_31.IfNum = pxe_31->IFcnt;
+ UNDI32Device->NIIProtocol_31.IfNum = pxe_31->IFcnt | pxe_31->IFcntExt << 8;
PxeUpdate (&UNDI32Device->NicInfo, pxe_31);
@@ -470,7 +470,7 @@ UndiDriverStart (
goto UndiErrorDeleteDevicePath;
}
- Len = (pxe_31->IFcnt * sizeof (UndiDataPointer->NII_entry)) + sizeof (UndiDataPointer);
+ Len = ((pxe_31->IFcnt|pxe_31->IFcntExt << 8)* sizeof (UndiDataPointer->NII_entry)) + sizeof (UndiDataPointer);
Status = gBS->AllocatePool (EfiRuntimeServicesData, Len, (VOID **) &UndiDataPointer);
if (EFI_ERROR (Status)) {
@@ -949,10 +949,10 @@ InstallConfigTable (
UndiData = (UNDI_CONFIG_TABLE *)UndiDataPointer;
- UndiData->NumberOfInterfaces = pxe_31->IFcnt;
+ UndiData->NumberOfInterfaces = (pxe_31->IFcnt | pxe_31->IFcntExt << 8);
UndiData->nextlink = NULL;
- for (Index = 0; Index < pxe_31->IFcnt; Index++) {
+ for (Index = 0; Index < (pxe_31->IFcnt | pxe_31->IFcntExt << 8); Index++) {
UndiData->NII_entry[Index].NII_InterfacePointer = &UNDI32DeviceList[Index]->NIIProtocol_31;
UndiData->NII_entry[Index].DevicePathPointer = UNDI32DeviceList[Index]->Undi32DevPath;
}