diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-14 08:52:06 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-14 08:52:06 +0000 |
commit | 169a34619b6d583d9f2934a6a3e9caf6e5c6e355 (patch) | |
tree | 591f27370749dc849e7c2d9ed05e640dc7e6391f /MdeModulePkg/Universal/Network | |
parent | 05c7cb5d8e3346ce1d9d9d0328f6204b61c77b75 (diff) | |
download | edk2-169a34619b6d583d9f2934a6a3e9caf6e5c6e355.zip edk2-169a34619b6d583d9f2934a6a3e9caf6e5c6e355.tar.gz edk2-169a34619b6d583d9f2934a6a3e9caf6e5c6e355.tar.bz2 |
Use default UNDI information if NII protocol not exists.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8082 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
5 files changed, 30 insertions, 14 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index 920506b..95f6e9d 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -1019,9 +1019,15 @@ PxeBcBuildDhcpOptions ( OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_UNDI;
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_UNDI);
OptEnt.Undi = (PXEBC_DHCP4_OPTION_UNDI *) OptList[Index]->Data;
- OptEnt.Undi->Type = Private->Nii->Type;
- OptEnt.Undi->MajorVer = Private->Nii->MajorVer;
- OptEnt.Undi->MinorVer = Private->Nii->MinorVer;
+ if (Private->Nii != NULL) {
+ OptEnt.Undi->Type = Private->Nii->Type;
+ OptEnt.Undi->MajorVer = Private->Nii->MajorVer;
+ OptEnt.Undi->MinorVer = Private->Nii->MinorVer;
+ } else {
+ OptEnt.Undi->Type = DEFAULT_UNDI_TYPE;
+ OptEnt.Undi->MajorVer = DEFAULT_UNDI_MAJOR;
+ OptEnt.Undi->MinorVer = DEFAULT_UNDI_MINOR;
+ }
Index++;
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);
@@ -1045,9 +1051,16 @@ PxeBcBuildDhcpOptions ( OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;
CopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));
CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));
- CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
- CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));
- CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));
+
+ if (Private->Nii != NULL) {
+ //
+ // If NII protocol exists, update DHCP option data
+ //
+ CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));
+ CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));
+ CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));
+ }
+
Index++;
return Index;
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h index 6ad03a8..d1e6ca2 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h @@ -1,7 +1,7 @@ /** @file
Dhcp and Discover routines for PxeBc.
-Copyright (c) 2007, 2009, Intel Corporation.<BR>
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>
All rights reserved. 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
@@ -193,7 +193,10 @@ typedef struct { UINT16 Type;
} PXEBC_DHCP4_OPTION_ARCH;
-#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:?????:????:??????"
+#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:xxxxx:UNDI:003000"
+#define DEFAULT_UNDI_TYPE 1
+#define DEFAULT_UNDI_MAJOR 3
+#define DEFAULT_UNDI_MINOR 0
typedef struct {
UINT8 ClassIdentifier[10];
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c index 102f685..a4951c8 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c @@ -174,7 +174,7 @@ PxeBcDriverBindingStart ( }
//
- // Get the NII interface
+ // Get the NII interface if it exists.
//
Status = gBS->OpenProtocol (
ControllerHandle,
@@ -185,7 +185,7 @@ PxeBcDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
- goto ON_ERROR;
+ Private->Nii = NULL;
}
Status = NetLibCreateServiceChild (
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c index e81d069..d6d4cd5 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c @@ -1,7 +1,7 @@ /** @file
PxeBc MTFTP functions.
-Copyright (c) 2007, 2009, Intel Corporation.<BR>
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>
All rights reserved. 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
@@ -158,7 +158,7 @@ PxeBcTftpGetFileSize ( );
if (EFI_ERROR (Status)) {
- if (Packet->OpCode == EFI_MTFTP4_OPCODE_ERROR) {
+ if (Status == EFI_TFTP_ERROR) {
Private->Mode.TftpErrorReceived = TRUE;
Private->Mode.TftpError.ErrorCode = (UINT8) Packet->Error.ErrorCode;
AsciiStrnCpy (
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf index 1350df4..f1c2e1c 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf @@ -1,7 +1,7 @@ #/** @file
# Component name for module UefiPxeBc
#
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -92,7 +92,7 @@ gEfiLoadFileProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiDhcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiNetworkInterfaceIdentifierProtocolGuid_31 # PROTOCOL ALWAYS_CONSUMED
+ gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## SOMETIMES_CONSUMES
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|