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
\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
- 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
/** @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
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
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
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
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
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
/** @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
\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
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
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 (PxePtr->IFcnt > 0) {\r
//\r
// number of NICs this undi supports\r
//\r
//\r
// number of NICs this undi supports\r
//\r
-\r
- PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
- return ;\r
}\r
\r
//\r
// number of NICs this undi supports\r
//\r
}\r
\r
//\r
// number of NICs this undi supports\r
//\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
// 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->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
/** @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
//\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
// 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
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
\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