EFI_HANDLE *BlockIoHandles;\r
EFI_BLOCK_IO_PROTOCOL *BlkIo;\r
UINTN Index;\r
- UINTN NumberNetworkHandles;\r
- EFI_HANDLE *NetworkHandles;\r
+ UINTN NumOfLoadFileHandles;\r
+ EFI_HANDLE *LoadFileHandles;\r
UINTN FvHandleCount;\r
EFI_HANDLE *FvHandleBuffer;\r
EFI_FV_FILETYPE Type;\r
//\r
// Parse Network Boot Device\r
//\r
- NumberNetworkHandles = 0;\r
+ NumOfLoadFileHandles = 0;\r
//\r
- // Search MNP Service Binding protocol for UEFI network stack\r
+ // Search Load File protocol for PXE boot option.\r
//\r
gBS->LocateHandleBuffer (\r
ByProtocol,\r
- &gEfiManagedNetworkServiceBindingProtocolGuid,\r
+ &gEfiLoadFileProtocolGuid,\r
NULL,\r
- &NumberNetworkHandles,\r
- &NetworkHandles\r
+ &NumOfLoadFileHandles,\r
+ &LoadFileHandles\r
);\r
- if (NumberNetworkHandles == 0) {\r
- //\r
- // MNP Service Binding protocol not found, search SNP for EFI network stack\r
- //\r
- gBS->LocateHandleBuffer (\r
- ByProtocol,\r
- &gEfiSimpleNetworkProtocolGuid,\r
- NULL,\r
- &NumberNetworkHandles,\r
- &NetworkHandles\r
- );\r
- }\r
\r
- for (Index = 0; Index < NumberNetworkHandles; Index++) {\r
+ for (Index = 0; Index < NumOfLoadFileHandles; Index++) {\r
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", Index);\r
- BdsLibBuildOptionFromHandle (NetworkHandles[Index], BdsBootOptionList, Buffer);\r
+ BdsLibBuildOptionFromHandle (LoadFileHandles[Index], BdsBootOptionList, Buffer);\r
}\r
\r
- if (NumberNetworkHandles != 0) {\r
- FreePool (NetworkHandles);\r
+ if (NumOfLoadFileHandles != 0) {\r
+ FreePool (LoadFileHandles);\r
}\r
\r
//\r
\r
UpdatedDevicePath = DevicePath;\r
//\r
- // Locate MNP Service Binding protocol for UEFI network stack first\r
+ // Locate Load File Protocol for PXE boot option first\r
//\r
- Status = gBS->LocateDevicePath (&gEfiManagedNetworkServiceBindingProtocolGuid, &UpdatedDevicePath, &Handle);\r
- if (EFI_ERROR (Status)) {\r
- //\r
- // MNP Service Binding protocol not found, search SNP for EFI network stack\r
- //\r
- UpdatedDevicePath = DevicePath;\r
- Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &UpdatedDevicePath, &Handle);\r
- }\r
+ Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &UpdatedDevicePath, &Handle);\r
if (EFI_ERROR (Status)) {\r
//\r
// Device not present so see if we need to connect it\r
//\r
// This one should work after we did the connect\r
//\r
- Status = gBS->LocateDevicePath (&gEfiManagedNetworkServiceBindingProtocolGuid, &UpdatedDevicePath, &Handle);\r
- if (EFI_ERROR (Status)) {\r
- UpdatedDevicePath = DevicePath;\r
- Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &UpdatedDevicePath, &Handle);\r
- }\r
+ Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &UpdatedDevicePath, &Handle);\r
}\r
}\r
\r
\r
case MSG_MAC_ADDR_DP:\r
case MSG_VLAN_DP:\r
+ case MSG_IPv4_DP:\r
+ case MSG_IPv6_DP:\r
BootType = BDS_EFI_MESSAGE_MAC_BOOT;\r
break;\r
\r
EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;\r
EFI_DEVICE_PATH_PROTOCOL *LastDeviceNode;\r
EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
- EFI_LOAD_FILE_PROTOCOL *LoadFile;\r
\r
TempDevicePath = DevPath;\r
LastDeviceNode = DevPath;\r
\r
//\r
- // Check if it's a valid boot option for network boot device\r
- // Check if there is MNP Service Binding Protocol or SimpleNetworkProtocol\r
- // installed. If yes, that means there is the network card there.\r
+ // Check if it's a valid boot option for network boot device.\r
+ // Check if there is EfiLoadFileProtocol installed. \r
+ // If yes, that means there is a boot option for network.\r
//\r
Status = gBS->LocateDevicePath (\r
- &gEfiManagedNetworkServiceBindingProtocolGuid,\r
+ &gEfiLoadFileProtocolGuid,\r
&TempDevicePath,\r
&Handle\r
);\r
- if (EFI_ERROR (Status)) {\r
- TempDevicePath = DevPath;\r
- Status = gBS->LocateDevicePath (\r
- &gEfiSimpleNetworkProtocolGuid,\r
- &TempDevicePath,\r
- &Handle\r
- );\r
- }\r
if (EFI_ERROR (Status)) {\r
//\r
// Device not present so see if we need to connect it\r
TempDevicePath = DevPath;\r
BdsLibConnectDevicePath (TempDevicePath);\r
Status = gBS->LocateDevicePath (\r
- &gEfiManagedNetworkServiceBindingProtocolGuid,\r
+ &gEfiLoadFileProtocolGuid,\r
&TempDevicePath,\r
&Handle\r
);\r
- if (EFI_ERROR (Status)) {\r
- TempDevicePath = DevPath;\r
- Status = gBS->LocateDevicePath (\r
- &gEfiSimpleNetworkProtocolGuid,\r
- &TempDevicePath,\r
- &Handle\r
- );\r
- }\r
}\r
\r
if (!EFI_ERROR (Status)) {\r
- //\r
- // Check whether LoadFile protocol is installed\r
- //\r
- Status = gBS->HandleProtocol (Handle, &gEfiLoadFileProtocolGuid, (VOID **)&LoadFile);\r
- if (!EFI_ERROR (Status)) {\r
- if (!IsDevicePathEnd (TempDevicePath)) {\r
- //\r
- // LoadFile protocol is not installed on handle with exactly the same DevPath\r
- //\r
- return FALSE;\r
- }\r
+ if (!IsDevicePathEnd (TempDevicePath)) {\r
+ //\r
+ // LoadFile protocol is not installed on handle with exactly the same DevPath\r
+ //\r
+ return FALSE;\r
+ }\r
\r
- if (CheckMedia) {\r
- //\r
- // Test if it is ready to boot now\r
- //\r
- if (BdsLibNetworkBootWithMediaPresent(DevPath)) {\r
- return TRUE;\r
- }\r
- } else {\r
+ if (CheckMedia) {\r
+ //\r
+ // Test if it is ready to boot now\r
+ //\r
+ if (BdsLibNetworkBootWithMediaPresent(DevPath)) {\r
return TRUE;\r
}\r
- }\r
+ } else {\r
+ return TRUE;\r
+ } \r
}\r
\r
//\r