TianoCore EDK2 master
Loading...
Searching...
No Matches
BootManagerPolicyDxe.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS ConnectAllAndCreateNetworkDeviceList (VOID)
 
EFI_STATUS ConnectNetwork (VOID)
 
EFI_STATUS EFIAPI BootManagerPolicyConnectDevicePath (IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_DEVICE_PATH *DevicePath, IN BOOLEAN Recursive)
 
EFI_STATUS EFIAPI BootManagerPolicyConnectDeviceClass (IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_GUID *Class)
 
EFI_STATUS EFIAPI BootManagerPolicyInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

CHAR16 mNetworkDeviceList [] = L"_NDL"
 
EFI_BOOT_MANAGER_POLICY_PROTOCOL mBootManagerPolicy
 

Detailed Description

This module produces Boot Manager Policy protocol.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BootManagerPolicyDxe.c.

Function Documentation

◆ BootManagerPolicyConnectDeviceClass()

EFI_STATUS EFIAPI BootManagerPolicyConnectDeviceClass ( IN EFI_BOOT_MANAGER_POLICY_PROTOCOL This,
IN EFI_GUID Class 
)

Connect a class of devices using the platform Boot Manager policy.

The ConnectDeviceClass() function allows the caller to request that the Boot Manager connect a class of devices.

If Class is EFI_BOOT_MANAGER_POLICY_CONSOLE_GUID then the Boot Manager will use platform policy to connect consoles. Some platforms may restrict the number of consoles connected as they attempt to fast boot, and calling ConnectDeviceClass() with a Class value of EFI_BOOT_MANAGER_POLICY_CONSOLE_GUID must connect the set of consoles that follow the Boot Manager platform policy, and the EFI_SIMPLE_TEXT_INPUT_PROTOCOL, EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL, and the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL are produced on the connected handles. The Boot Manager may restrict which consoles get connect due to platform policy, for example a security policy may require that a given console is not connected.

If Class is EFI_BOOT_MANAGER_POLICY_NETWORK_GUID then the Boot Manager will connect the protocols the platforms supports for UEFI general purpose network applications on one or more handles. If more than one network controller is available a platform will connect, one, many, or all of the networks based on platform policy. Connecting UEFI networking protocols, like EFI_DHCP4_PROTOCOL, does not establish connections on the network. The UEFI general purpose network application that called ConnectDeviceClass() may need to use the published protocols to establish the network connection. The Boot Manager can optionally have a policy to establish a network connection.

If Class is EFI_BOOT_MANAGER_POLICY_CONNECT_ALL_GUID then the Boot Manager will connect all UEFI drivers using the UEFI Boot Service EFI_BOOT_SERVICES.ConnectController(). If the Boot Manager has policy associated with connect all UEFI drivers this policy will be used.

A platform can also define platform specific Class values as a properly generated EFI_GUID would never conflict with this specification.

Parameters
[in]ThisA pointer to the EFI_BOOT_MANAGER_POLICY_PROTOCOL instance.
[in]ClassA pointer to an EFI_GUID that represents a class of devices that will be connected using the Boot Mangers platform policy.
Return values
EFI_SUCCESSAt least one devices of the Class was connected.
EFI_DEVICE_ERRORDevices were not connected due to an error.
EFI_NOT_FOUNDThe Class is not supported by the platform.
EFI_UNSUPPORTEDThe current TPL is not TPL_APPLICATION.

Definition at line 228 of file BootManagerPolicyDxe.c.

◆ BootManagerPolicyConnectDevicePath()

EFI_STATUS EFIAPI BootManagerPolicyConnectDevicePath ( IN EFI_BOOT_MANAGER_POLICY_PROTOCOL This,
IN EFI_DEVICE_PATH DevicePath,
IN BOOLEAN  Recursive 
)

Connect a device path following the platforms EFI Boot Manager policy.

The ConnectDevicePath() function allows the caller to connect a DevicePath using the same policy as the EFI Boot Manger.

Parameters
[in]ThisA pointer to the EFI_BOOT_MANAGER_POLICY_PROTOCOL instance.
[in]DevicePathPoints to the start of the EFI device path to connect. If DevicePath is NULL then all the controllers in the system will be connected using the platforms EFI Boot Manager policy.
[in]RecursiveIf TRUE, then ConnectController() is called recursively until the entire tree of controllers below the controller specified by DevicePath have been created. If FALSE, then the tree of controllers is only expanded one level. If DevicePath is NULL then Recursive is ignored.
Return values
EFI_SUCCESSThe DevicePath was connected.
EFI_NOT_FOUNDThe DevicePath was not found.
EFI_NOT_FOUNDNo driver was connected to DevicePath.
EFI_SECURITY_VIOLATIONThe user has no permission to start UEFI device drivers on the DevicePath.
EFI_UNSUPPORTEDThe current TPL is not TPL_APPLICATION.

Definition at line 153 of file BootManagerPolicyDxe.c.

◆ BootManagerPolicyInitialize()

EFI_STATUS EFIAPI BootManagerPolicyInitialize ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Install Boot Manager Policy Protocol.

Parameters
ImageHandleThe image handle.
SystemTableThe system table.
Return values
EFI_SUCEESSThe Boot Manager Policy protocol is successfully installed.
OtherReturn status from gBS->InstallMultipleProtocolInterfaces().

Definition at line 271 of file BootManagerPolicyDxe.c.

◆ ConnectAllAndCreateNetworkDeviceList()

EFI_STATUS ConnectAllAndCreateNetworkDeviceList ( VOID  )

Connect all the system drivers to controllers and create the network device list in NV storage.

Return values
EFI_SUCCESSNetwork devices are connected.
EFI_DEVICE_ERRORNo network device is connected.

Definition at line 31 of file BootManagerPolicyDxe.c.

◆ ConnectNetwork()

EFI_STATUS ConnectNetwork ( VOID  )

Connect the network devices.

Return values
EFI_SUCCESSAt least one network device was connected.
EFI_DEVICE_ERRORNetwork devices were not connected due to an error.

Definition at line 89 of file BootManagerPolicyDxe.c.

Variable Documentation

◆ mBootManagerPolicy

Initial value:
= {
EFI_BOOT_MANAGER_POLICY_PROTOCOL_REVISION,
}
EFI_STATUS EFIAPI BootManagerPolicyConnectDeviceClass(IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_GUID *Class)
EFI_STATUS EFIAPI BootManagerPolicyConnectDevicePath(IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_DEVICE_PATH *DevicePath, IN BOOLEAN Recursive)

Definition at line 253 of file BootManagerPolicyDxe.c.

◆ mNetworkDeviceList

CHAR16 mNetworkDeviceList[] = L"_NDL"

Definition at line 21 of file BootManagerPolicyDxe.c.