1 /** @file 2 EFI Driver Configuration Protocol 3 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 **/ 8 9 #ifndef __EFI_DRIVER_CONFIGURATION_H__ 10 #define __EFI_DRIVER_CONFIGURATION_H__ 11 12 #include <Protocol/DriverConfiguration2.h> 13 14 /// 15 /// Global ID for the Driver Configuration Protocol defined in EFI 1.1 16 /// 17 #define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \ 18 { \ 19 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ 20 } 21 22 typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL EFI_DRIVER_CONFIGURATION_PROTOCOL; 23 24 /** 25 Allows the user to set controller specific options for a controller that a 26 driver is currently managing. 27 28 @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance. 29 @param ControllerHandle The handle of the controller to set options on. 30 @param ChildHandle The handle of the child controller to set options on. This 31 is an optional parameter that may be NULL. It will be NULL 32 for device drivers, and for bus drivers that wish to set 33 options for the bus controller. It will not be NULL for a 34 bus driver that wishes to set options for one of its child 35 controllers. 36 @param Language A pointer to a three character ISO 639-2 language identifier. 37 This is the language of the user interface that should be 38 presented to the user, and it must match one of the languages 39 specified in SupportedLanguages. The number of languages 40 supported by a driver is up to the driver writer. 41 @param ActionRequired A pointer to the action that the calling agent is required 42 to perform when this function returns. See "Related 43 Definitions" for a list of the actions that the calling 44 agent is required to perform prior to accessing 45 ControllerHandle again. 46 47 @retval EFI_SUCCESS The driver specified by This successfully set the 48 configuration options for the controller specified 49 by ControllerHandle.. 50 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. 51 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE. 52 @retval EFI_INVALID_PARAMETER ActionRequired is NULL. 53 @retval EFI_UNSUPPORTED The driver specified by This does not support setting 54 configuration options for the controller specified by 55 ControllerHandle and ChildHandle. 56 @retval EFI_UNSUPPORTED The driver specified by This does not support the 57 language specified by Language. 58 @retval EFI_DEVICE_ERROR A device error occurred while attempt to set the 59 configuration options for the controller specified 60 by ControllerHandle and ChildHandle. 61 @retval EFI_OUT_RESOURCES There are not enough resources available to set the 62 configuration options for the controller specified 63 by ControllerHandle and ChildHandle. 64 65 **/ 66 typedef 67 EFI_STATUS 68 (EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS)( 69 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This, 70 IN EFI_HANDLE ControllerHandle, 71 IN EFI_HANDLE ChildHandle OPTIONAL, 72 IN CHAR8 *Language, 73 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired 74 ); 75 76 /** 77 Tests to see if a controller's current configuration options are valid. 78 79 @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance. 80 @param ControllerHandle The handle of the controller to test if it's current 81 configuration options are valid. 82 @param ChildHandle The handle of the child controller to test if it's current 83 configuration options are valid. This is an optional 84 parameter that may be NULL. It will be NULL for device 85 drivers. It will also be NULL for bus drivers that wish 86 to test the configuration options for the bus controller. 87 It will not be NULL for a bus driver that wishes to test 88 configuration options for one of its child controllers. 89 90 @retval EFI_SUCCESS The controller specified by ControllerHandle and 91 ChildHandle that is being managed by the driver 92 specified by This has a valid set of configuration 93 options. 94 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. 95 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE. 96 @retval EFI_UNSUPPORTED The driver specified by This is not currently 97 managing the controller specified by ControllerHandle 98 and ChildHandle. 99 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and 100 ChildHandle that is being managed by the driver 101 specified by This has an invalid set of configuration 102 options. 103 104 **/ 105 typedef 106 EFI_STATUS 107 (EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID)( 108 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This, 109 IN EFI_HANDLE ControllerHandle, 110 IN EFI_HANDLE ChildHandle OPTIONAL 111 ); 112 113 /** 114 Forces a driver to set the default configuration options for a controller. 115 116 @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance. 117 @param ControllerHandle The handle of the controller to force default configuration options on. 118 @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. 119 @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. 120 @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. 121 122 @retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle. 123 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. 124 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE. 125 @retval EFI_INVALID_PARAMETER ActionRequired is NULL. 126 @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle. 127 @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType. 128 @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle. 129 @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle. 130 131 **/ 132 typedef 133 EFI_STATUS 134 (EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS)( 135 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This, 136 IN EFI_HANDLE ControllerHandle, 137 IN EFI_HANDLE ChildHandle OPTIONAL, 138 IN UINT32 DefaultType, 139 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired 140 ); 141 142 /// 143 /// Used to set configuration options for a controller that an EFI Driver is managing. 144 /// 145 struct _EFI_DRIVER_CONFIGURATION_PROTOCOL { 146 EFI_DRIVER_CONFIGURATION_SET_OPTIONS SetOptions; 147 EFI_DRIVER_CONFIGURATION_OPTIONS_VALID OptionsValid; 148 EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults; 149 /// 150 /// A Null-terminated ASCII string that contains one or more 151 /// ISO 639-2 language codes. This is the list of language 152 /// codes that this protocol supports. 153 /// 154 CHAR8 *SupportedLanguages; 155 }; 156 157 extern EFI_GUID gEfiDriverConfigurationProtocolGuid; 158 159 #endif 160