git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8082
6f19259b-4bc3-4df7-8a09-
765794883524
OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_UNDI;\r
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_UNDI);\r
OptEnt.Undi = (PXEBC_DHCP4_OPTION_UNDI *) OptList[Index]->Data;\r
OptList[Index]->OpCode = PXEBC_PXE_DHCP4_TAG_UNDI;\r
OptList[Index]->Length = sizeof (PXEBC_DHCP4_OPTION_UNDI);\r
OptEnt.Undi = (PXEBC_DHCP4_OPTION_UNDI *) OptList[Index]->Data;\r
- OptEnt.Undi->Type = Private->Nii->Type;\r
- OptEnt.Undi->MajorVer = Private->Nii->MajorVer;\r
- OptEnt.Undi->MinorVer = Private->Nii->MinorVer;\r
+ if (Private->Nii != NULL) {\r
+ OptEnt.Undi->Type = Private->Nii->Type;\r
+ OptEnt.Undi->MajorVer = Private->Nii->MajorVer;\r
+ OptEnt.Undi->MinorVer = Private->Nii->MinorVer;\r
+ } else {\r
+ OptEnt.Undi->Type = DEFAULT_UNDI_TYPE;\r
+ OptEnt.Undi->MajorVer = DEFAULT_UNDI_MAJOR;\r
+ OptEnt.Undi->MinorVer = DEFAULT_UNDI_MINOR;\r
+ }\r
\r
Index++;\r
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);\r
\r
Index++;\r
OptList[Index] = GET_NEXT_DHCP_OPTION (OptList[Index - 1]);\r
OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;\r
CopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));\r
CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));\r
OptEnt.Clid = (PXEBC_DHCP4_OPTION_CLID *) OptList[Index]->Data;\r
CopyMem (OptEnt.Clid, DEFAULT_CLASS_ID_DATA, sizeof (PXEBC_DHCP4_OPTION_CLID));\r
CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));\r
- CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));\r
- CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));\r
- CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));\r
+\r
+ if (Private->Nii != NULL) {\r
+ // \r
+ // If NII protocol exists, update DHCP option data\r
+ //\r
+ CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));\r
+ CvtNum (Private->Nii->MajorVer, OptEnt.Clid->UndiMajor, sizeof (OptEnt.Clid->UndiMajor));\r
+ CvtNum (Private->Nii->MinorVer, OptEnt.Clid->UndiMinor, sizeof (OptEnt.Clid->UndiMinor));\r
+ }\r
+\r
Index++;\r
\r
return Index;\r
Index++;\r
\r
return Index;\r
/** @file\r
Dhcp and Discover routines for PxeBc.\r
\r
/** @file\r
Dhcp and Discover routines for PxeBc.\r
\r
-Copyright (c) 2007, 2009, Intel Corporation.<BR>\r
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>\r
All rights reserved. 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
All rights reserved. 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
UINT16 Type;\r
} PXEBC_DHCP4_OPTION_ARCH;\r
\r
UINT16 Type;\r
} PXEBC_DHCP4_OPTION_ARCH;\r
\r
-#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:?????:????:??????"\r
+#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:xxxxx:UNDI:003000"\r
+#define DEFAULT_UNDI_TYPE 1\r
+#define DEFAULT_UNDI_MAJOR 3\r
+#define DEFAULT_UNDI_MINOR 0\r
\r
typedef struct {\r
UINT8 ClassIdentifier[10];\r
\r
typedef struct {\r
UINT8 ClassIdentifier[10];\r
- // Get the NII interface\r
+ // Get the NII interface if it exists.\r
//\r
Status = gBS->OpenProtocol (\r
ControllerHandle,\r
//\r
Status = gBS->OpenProtocol (\r
ControllerHandle,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
}\r
\r
Status = NetLibCreateServiceChild (\r
}\r
\r
Status = NetLibCreateServiceChild (\r
/** @file\r
PxeBc MTFTP functions.\r
\r
/** @file\r
PxeBc MTFTP functions.\r
\r
-Copyright (c) 2007, 2009, Intel Corporation.<BR>\r
+Copyright (c) 2007 - 2009, Intel Corporation.<BR>\r
All rights reserved. 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
All rights reserved. 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
\r
if (EFI_ERROR (Status)) {\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- if (Packet->OpCode == EFI_MTFTP4_OPCODE_ERROR) {\r
+ if (Status == EFI_TFTP_ERROR) {\r
Private->Mode.TftpErrorReceived = TRUE;\r
Private->Mode.TftpError.ErrorCode = (UINT8) Packet->Error.ErrorCode;\r
AsciiStrnCpy (\r
Private->Mode.TftpErrorReceived = TRUE;\r
Private->Mode.TftpError.ErrorCode = (UINT8) Packet->Error.ErrorCode;\r
AsciiStrnCpy (\r
#/** @file\r
# Component name for module UefiPxeBc\r
#\r
#/** @file\r
# Component name for module UefiPxeBc\r
#\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.\r
+# Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.\r
#\r
# All rights reserved. This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
# All rights reserved. This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiLoadFileProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r
gEfiDhcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiLoadFileProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r
gEfiDhcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
- gEfiNetworkInterfaceIdentifierProtocolGuid_31 # PROTOCOL ALWAYS_CONSUMED\r
+ gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## SOMETIMES_CONSUMES\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
\r
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
\r