1.Change the behavior of BdsBoot, to enumerate Boot Options by EfiLoadFileProtocol, other than EfiManagedNetworkServiceBindingProtocol.

2.Add MSG_IPv4_DP and MSG_IPv6_DP into boot type of BDS_EFI_MESSAGE_MAC_BOOT.

3.Change the file header format of inf file and remove the MNP dependency.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9799 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
tye1 2010-01-25 03:05:41 +00:00
parent e4ef0031cd
commit a7a523e07b
3 changed files with 39 additions and 85 deletions

View File

@ -991,8 +991,8 @@ BdsLibEnumerateAllBootOption (
EFI_HANDLE *BlockIoHandles; EFI_HANDLE *BlockIoHandles;
EFI_BLOCK_IO_PROTOCOL *BlkIo; EFI_BLOCK_IO_PROTOCOL *BlkIo;
UINTN Index; UINTN Index;
UINTN NumberNetworkHandles; UINTN NumOfLoadFileHandles;
EFI_HANDLE *NetworkHandles; EFI_HANDLE *LoadFileHandles;
UINTN FvHandleCount; UINTN FvHandleCount;
EFI_HANDLE *FvHandleBuffer; EFI_HANDLE *FvHandleBuffer;
EFI_FV_FILETYPE Type; EFI_FV_FILETYPE Type;
@ -1171,37 +1171,25 @@ BdsLibEnumerateAllBootOption (
// //
// Parse Network Boot Device // Parse Network Boot Device
// //
NumberNetworkHandles = 0; NumOfLoadFileHandles = 0;
// //
// Search MNP Service Binding protocol for UEFI network stack // Search Load File protocol for PXE boot option.
// //
gBS->LocateHandleBuffer ( gBS->LocateHandleBuffer (
ByProtocol, ByProtocol,
&gEfiManagedNetworkServiceBindingProtocolGuid, &gEfiLoadFileProtocolGuid,
NULL, NULL,
&NumberNetworkHandles, &NumOfLoadFileHandles,
&NetworkHandles &LoadFileHandles
); );
if (NumberNetworkHandles == 0) {
//
// MNP Service Binding protocol not found, search SNP for EFI network stack
//
gBS->LocateHandleBuffer (
ByProtocol,
&gEfiSimpleNetworkProtocolGuid,
NULL,
&NumberNetworkHandles,
&NetworkHandles
);
}
for (Index = 0; Index < NumberNetworkHandles; Index++) { for (Index = 0; Index < NumOfLoadFileHandles; Index++) {
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", Index); UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", Index);
BdsLibBuildOptionFromHandle (NetworkHandles[Index], BdsBootOptionList, Buffer); BdsLibBuildOptionFromHandle (LoadFileHandles[Index], BdsBootOptionList, Buffer);
} }
if (NumberNetworkHandles != 0) { if (NumOfLoadFileHandles != 0) {
FreePool (NetworkHandles); FreePool (LoadFileHandles);
} }
// //
@ -1556,16 +1544,9 @@ BdsLibNetworkBootWithMediaPresent (
UpdatedDevicePath = DevicePath; UpdatedDevicePath = DevicePath;
// //
// Locate MNP Service Binding protocol for UEFI network stack first // Locate Load File Protocol for PXE boot option first
// //
Status = gBS->LocateDevicePath (&gEfiManagedNetworkServiceBindingProtocolGuid, &UpdatedDevicePath, &Handle); Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &UpdatedDevicePath, &Handle);
if (EFI_ERROR (Status)) {
//
// MNP Service Binding protocol not found, search SNP for EFI network stack
//
UpdatedDevicePath = DevicePath;
Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &UpdatedDevicePath, &Handle);
}
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
// //
// Device not present so see if we need to connect it // Device not present so see if we need to connect it
@ -1575,11 +1556,7 @@ BdsLibNetworkBootWithMediaPresent (
// //
// This one should work after we did the connect // This one should work after we did the connect
// //
Status = gBS->LocateDevicePath (&gEfiManagedNetworkServiceBindingProtocolGuid, &UpdatedDevicePath, &Handle); Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &UpdatedDevicePath, &Handle);
if (EFI_ERROR (Status)) {
UpdatedDevicePath = DevicePath;
Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &UpdatedDevicePath, &Handle);
}
} }
} }
@ -1727,6 +1704,8 @@ BdsGetBootTypeFromDevicePath (
case MSG_MAC_ADDR_DP: case MSG_MAC_ADDR_DP:
case MSG_VLAN_DP: case MSG_VLAN_DP:
case MSG_IPv4_DP:
case MSG_IPv6_DP:
BootType = BDS_EFI_MESSAGE_MAC_BOOT; BootType = BDS_EFI_MESSAGE_MAC_BOOT;
break; break;
@ -1794,29 +1773,20 @@ BdsLibIsValidEFIBootOptDevicePathExt (
EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
EFI_DEVICE_PATH_PROTOCOL *LastDeviceNode; EFI_DEVICE_PATH_PROTOCOL *LastDeviceNode;
EFI_BLOCK_IO_PROTOCOL *BlockIo; EFI_BLOCK_IO_PROTOCOL *BlockIo;
EFI_LOAD_FILE_PROTOCOL *LoadFile;
TempDevicePath = DevPath; TempDevicePath = DevPath;
LastDeviceNode = DevPath; LastDeviceNode = DevPath;
// //
// Check if it's a valid boot option for network boot device // Check if it's a valid boot option for network boot device.
// Check if there is MNP Service Binding Protocol or SimpleNetworkProtocol // Check if there is EfiLoadFileProtocol installed.
// installed. If yes, that means there is the network card there. // If yes, that means there is a boot option for network.
// //
Status = gBS->LocateDevicePath ( Status = gBS->LocateDevicePath (
&gEfiManagedNetworkServiceBindingProtocolGuid, &gEfiLoadFileProtocolGuid,
&TempDevicePath, &TempDevicePath,
&Handle &Handle
); );
if (EFI_ERROR (Status)) {
TempDevicePath = DevPath;
Status = gBS->LocateDevicePath (
&gEfiSimpleNetworkProtocolGuid,
&TempDevicePath,
&Handle
);
}
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
// //
// Device not present so see if we need to connect it // Device not present so see if we need to connect it
@ -1824,25 +1794,12 @@ BdsLibIsValidEFIBootOptDevicePathExt (
TempDevicePath = DevPath; TempDevicePath = DevPath;
BdsLibConnectDevicePath (TempDevicePath); BdsLibConnectDevicePath (TempDevicePath);
Status = gBS->LocateDevicePath ( Status = gBS->LocateDevicePath (
&gEfiManagedNetworkServiceBindingProtocolGuid, &gEfiLoadFileProtocolGuid,
&TempDevicePath, &TempDevicePath,
&Handle &Handle
); );
if (EFI_ERROR (Status)) {
TempDevicePath = DevPath;
Status = gBS->LocateDevicePath (
&gEfiSimpleNetworkProtocolGuid,
&TempDevicePath,
&Handle
);
}
} }
if (!EFI_ERROR (Status)) {
//
// Check whether LoadFile protocol is installed
//
Status = gBS->HandleProtocol (Handle, &gEfiLoadFileProtocolGuid, (VOID **)&LoadFile);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
if (!IsDevicePathEnd (TempDevicePath)) { if (!IsDevicePathEnd (TempDevicePath)) {
// //
@ -1862,7 +1819,6 @@ BdsLibIsValidEFIBootOptDevicePathExt (
return TRUE; return TRUE;
} }
} }
}
// //
// If the boot option point to a file, it is a valid EFI boot option, // If the boot option point to a file, it is a valid EFI boot option,

View File

@ -1,11 +1,11 @@
#/** @file ## @file
# #
# General BDS defines and produce general interfaces for platform BDS driver including: # General BDS defines and produce general interfaces for platform BDS driver including:
# 1) BDS boot policy interface; # 1) BDS boot policy interface;
# 2) BDS boot device connect interface; # 2) BDS boot device connect interface;
# 3) BDS Misc interfaces for mainting boot variable, ouput string, etc. # 3) BDS Misc interfaces for mainting boot variable, ouput string, etc.
# #
# Copyright (c) 2007 - 2009, Intel Corporation. <BR> # Copyright (c) 2007 - 2010, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
@ -14,7 +14,7 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
#**/ ##
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
@ -90,7 +90,6 @@
[Protocols] [Protocols]
gEfiSimpleFileSystemProtocolGuid # PROTOCOL CONSUMES gEfiSimpleFileSystemProtocolGuid # PROTOCOL CONSUMES
gEfiManagedNetworkServiceBindingProtocolGuid # PROTOCOL CONSUMES
gEfiLoadFileProtocolGuid # PROTOCOL CONSUMES gEfiLoadFileProtocolGuid # PROTOCOL CONSUMES
gEfiSimpleTextOutProtocolGuid # PROTOCOL CONSUMES gEfiSimpleTextOutProtocolGuid # PROTOCOL CONSUMES
gEfiPciIoProtocolGuid # PROTOCOL CONSUMES gEfiPciIoProtocolGuid # PROTOCOL CONSUMES

View File

@ -1,7 +1,7 @@
/** @file /** @file
BDS library definition, include the file and data structure BDS library definition, include the file and data structure
Copyright (c) 2004 - 2009, Intel Corporation. <BR> Copyright (c) 2004 - 2010, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/LoadedImage.h> #include <Protocol/LoadedImage.h>
#include <Protocol/Cpu.h> #include <Protocol/Cpu.h>
#include <Protocol/SimpleFileSystem.h> #include <Protocol/SimpleFileSystem.h>
#include <Protocol/ManagedNetwork.h>
#include <Protocol/LoadFile.h> #include <Protocol/LoadFile.h>
#include <Protocol/DebugPort.h> #include <Protocol/DebugPort.h>
#include <Protocol/DevicePath.h> #include <Protocol/DevicePath.h>