Path: blob/main/sys/contrib/edk2/Include/Protocol/DriverConfiguration2.h
96339 views
/** @file1UEFI Driver Configuration2 Protocol23Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>4SPDX-License-Identifier: BSD-2-Clause-Patent56**/78#ifndef __EFI_DRIVER_CONFIGURATION2_H__9#define __EFI_DRIVER_CONFIGURATION2_H__1011///12/// Global ID for the Driver Configuration Protocol defined in UEFI 2.013///14#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \15{ \160xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \17}1819typedef struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL EFI_DRIVER_CONFIGURATION2_PROTOCOL;2021typedef enum {22///23/// The controller is still in a usable state. No actions24/// are required before this controller can be used again.25///26EfiDriverConfigurationActionNone = 0,27///28/// The driver has detected that the controller is not in a29/// usable state, and it needs to be stopped.30///31EfiDriverConfigurationActionStopController = 1,32///33/// This controller needs to be stopped and restarted34/// before it can be used again.35///36EfiDriverConfigurationActionRestartController = 2,37///38/// A configuration change has been made that requires the platform to be restarted before39/// the controller can be used again.40///41EfiDriverConfigurationActionRestartPlatform = 3,42EfiDriverConfigurationActionMaximum43} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;4445#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS 0x0000000046#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x0000000147#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS 0x0000000248#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS 0x000000034950/**51Allows the user to set controller specific options for a controller that a52driver is currently managing.5354@param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.55@param ControllerHandle The handle of the controller to set options on.56@param ChildHandle The handle of the child controller to set options on. This57is an optional parameter that may be NULL. It will be NULL58for device drivers, and for bus drivers that wish to set59options for the bus controller. It will not be NULL for a60bus driver that wishes to set options for one of its child61controllers.62@param Language A Null-terminated ASCII string that contains one or more RFC 464663language codes. This is the list of language codes that this64protocol supports. The number of languages65supported by a driver is up to the driver writer.66@param ActionRequired A pointer to the action that the calling agent is required67to perform when this function returns. See "Related68Definitions" for a list of the actions that the calling69agent is required to perform prior to accessing70ControllerHandle again.7172@retval EFI_SUCCESS The driver specified by This successfully set the73configuration options for the controller specified74by ControllerHandle.75@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.76@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.77@retval EFI_INVALID_PARAMETER ActionRequired is NULL.78@retval EFI_UNSUPPORTED The driver specified by This does not support setting79configuration options for the controller specified by80ControllerHandle and ChildHandle.81@retval EFI_UNSUPPORTED The driver specified by This does not support the82language specified by Language.83@retval EFI_DEVICE_ERROR A device error occurred while attempting to set the84configuration options for the controller specified85by ControllerHandle and ChildHandle.86@retval EFI_OUT_RESOURCES There are not enough resources available to set the87configuration options for the controller specified88by ControllerHandle and ChildHandle.8990**/91typedef92EFI_STATUS93(EFIAPI *EFI_DRIVER_CONFIGURATION2_SET_OPTIONS)(94IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,95IN EFI_HANDLE ControllerHandle,96IN EFI_HANDLE ChildHandle OPTIONAL,97IN CHAR8 *Language,98OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired99);100101/**102Tests to see if a controller's current configuration options are valid.103104@param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.105@param ControllerHandle The handle of the controller to test if it's current106configuration options are valid.107@param ChildHandle The handle of the child controller to test if it's current108configuration options are valid. This is an optional109parameter that may be NULL. It will be NULL for device110drivers. It will also be NULL for bus drivers that wish111to test the configuration options for the bus controller.112It will not be NULL for a bus driver that wishes to test113configuration options for one of its child controllers.114115@retval EFI_SUCCESS The controller specified by ControllerHandle and116ChildHandle that is being managed by the driver117specified by This has a valid set of configuration118options.119@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.120@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.121@retval EFI_UNSUPPORTED The driver specified by This is not currently122managing the controller specified by ControllerHandle123and ChildHandle.124@retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and125ChildHandle that is being managed by the driver126specified by This has an invalid set of configuration127options.128129**/130typedef131EFI_STATUS132(EFIAPI *EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID)(133IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,134IN EFI_HANDLE ControllerHandle,135IN EFI_HANDLE ChildHandle OPTIONAL136);137138/**139Forces a driver to set the default configuration options for a controller.140141@param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.142@param ControllerHandle The handle of the controller to force default configuration options on.143@param ChildHandle The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.144@param DefaultType The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.145@param ActionRequired A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1 for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.146147@retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.148@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.149@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.150@retval EFI_INVALID_PARAMETER ActionRequired is NULL.151@retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.152@retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.153@retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.154@retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.155156**/157typedef158EFI_STATUS159(EFIAPI *EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS)(160IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,161IN EFI_HANDLE ControllerHandle,162IN EFI_HANDLE ChildHandle OPTIONAL,163IN UINT32 DefaultType,164OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired165);166167///168/// Used to set configuration options for a controller that an EFI Driver is managing.169///170struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL {171EFI_DRIVER_CONFIGURATION2_SET_OPTIONS SetOptions;172EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID OptionsValid;173EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS ForceDefaults;174///175/// A Null-terminated ASCII string that contains one or more RFC 4646176/// language codes. This is the list of language codes that this protocol supports.177///178CHAR8 *SupportedLanguages;179};180181extern EFI_GUID gEfiDriverConfiguration2ProtocolGuid;182183#endif184185186