TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | EFI_CALLBACK_INFO |
struct | HII_VENDOR_DEVICE_PATH |
Macros | |
#define | EFI_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('C', 'l', 'b', 'k') |
#define | EFI_CALLBACK_INFO_FROM_THIS(a) CR (a, EFI_CALLBACK_INFO, ConfigAccess, EFI_CALLBACK_INFO_SIGNATURE) |
Variables | |
UINT8 | VfrBin [] |
UINT8 | PlatDriOverrideDxeStrings [] |
CHAR16 | mVariableName [] = L"Data" |
LIST_ENTRY | mMappingDataBase = INITIALIZE_LIST_HEAD_VARIABLE (mMappingDataBase) |
BOOLEAN | mEnvironmentVariableRead = FALSE |
EFI_HANDLE | mCallerImageHandle = NULL |
EFI_HANDLE * | mDevicePathHandleBuffer |
EFI_HANDLE * | mDriverImageHandleBuffer |
INTN | mSelectedCtrIndex |
EFI_STRING_ID * | mControllerToken |
UINTN | mDriverImageHandleCount |
EFI_STRING_ID * | mDriverImageToken |
EFI_DEVICE_PATH_PROTOCOL ** | mControllerDevicePathProtocol |
UINTN | mSelectedDriverImageNum |
UINTN | mLastSavedDriverImageNum |
UINT16 | mCurrentPage |
EFI_CALLBACK_INFO * | mCallbackInfo |
BOOLEAN * | mDriSelection |
UINTN | mMaxDeviceCount |
HII_VENDOR_DEVICE_PATH | mHiiVendorDevicePath |
This file also installs UEFI PLATFORM_DRIVER_OVERRIDE_PROTOCOL.
The main code offers a UI interface in device manager to let user configure platform override protocol to override the default algorithm for matching drivers to controllers.
The main flow:
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PlatDriOverrideDxe.c.
#define EFI_CALLBACK_INFO_FROM_THIS | ( | a | ) | CR (a, EFI_CALLBACK_INFO, ConfigAccess, EFI_CALLBACK_INFO_SIGNATURE) |
Definition at line 25 of file PlatDriOverrideDxe.c.
#define EFI_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('C', 'l', 'b', 'k') |
Definition at line 24 of file PlatDriOverrideDxe.c.
EFI_STATUS CommitChanges | ( | IN EFI_CALLBACK_INFO * | Private, |
IN UINT16 | KeyValue, | ||
IN PLAT_OVER_MNGR_DATA * | FakeNvData | ||
) |
Save the save the mapping database to NV variable.
Private | Pointer to EFI_CALLBACK_INFO. |
KeyValue | The callback key value of device controller item in first page. |
FakeNvData | Pointer to PLAT_OVER_MNGR_DATA. |
EFI_SUCCESS | Always returned. |
Definition at line 1114 of file PlatDriOverrideDxe.c.
CHAR16 * DevicePathToStr | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevPath | ) |
Converting a given device to an unicode string.
DevPath | Given device path instance |
L"?" | Converting failed. |
Definition at line 109 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI DriverLoaded | ( | IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DriverImagePath, | ||
IN EFI_HANDLE | DriverImageHandle | ||
) |
Used to associate a driver image handle with a device path that was returned on a prior call to the GetDriverPath() service. This driver image handle will then be available through the GetDriver() service. This driver doesn't support this API.
This | A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_ PROTOCOL instance. |
ControllerHandle | The device handle of the controller. |
DriverImagePath | A pointer to the driver device path that was returned in a prior call to GetDriverPath(). |
DriverImageHandle | The driver image handle that was returned by LoadImage() when the driver specified by DriverImagePath was loaded into memory. |
EFI_UNSUPPORTED |
Definition at line 1580 of file PlatDriOverrideDxe.c.
CHAR16 * GetComponentName | ( | IN EFI_HANDLE | DriverBindingHandle | ) |
Get the driver name by ComponentName or ComponentName2 protocol according to the driver binding handle
DriverBindingHandle | The Handle of DriverBinding. |
!NULL | Pointer into the image name if the image name is found, |
NULL | Pointer to NULL if the image name is not found. |
Definition at line 204 of file PlatDriOverrideDxe.c.
CHAR16 * GetComponentNameWorker | ( | IN EFI_HANDLE | DriverBindingHandle, |
IN EFI_GUID * | ProtocolGuid, | ||
IN CONST CHAR16 * | VariableName | ||
) |
Worker function to get the driver name by ComponentName or ComponentName2 protocol according to the driver binding handle.
DriverBindingHandle | The Handle of DriverBinding. |
ProtocolGuid | The pointer to Component Name (2) protocol GUID. |
VariableName | The name of the RFC 4646 or ISO 639-2 language variable. |
!NULL | Pointer into the image name if the image name is found, |
NULL | Pointer to NULL if the image name is not found. |
Definition at line 141 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI GetDriver | ( | IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN OUT EFI_HANDLE * | DriverImageHandle | ||
) |
Retrieves the image handle of the platform override driver for a controller in the system.
This | A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance. |
ControllerHandle | The device handle of the controller to check if a driver override exists. |
DriverImageHandle | On input, a pointer to the previous driver image handle returned by GetDriver(). On output, a pointer to the next driver image handle. Passing in a NULL, will return the first driver image handle for ControllerHandle. |
EFI_SUCCESS | The driver override for ControllerHandle was returned in DriverImageHandle. |
EFI_NOT_FOUND | A driver override for ControllerHandle was not found. |
EFI_INVALID_PARAMETER | The handle specified by ControllerHandle is NULL. DriverImageHandle is not a handle that was returned on a previous call to GetDriver(). |
Definition at line 1489 of file PlatDriOverrideDxe.c.
EFI_HANDLE GetDriverBindingHandleFromImageHandle | ( | IN EFI_HANDLE | ImageHandle | ) |
Get the first Driver Binding handle which has the specific image handle.
ImageHandle | The Image handle |
NULL | The parameter is not valid or the driver binding handle is not found. |
Definition at line 548 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI GetDriverPath | ( | IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DriverImagePath | ||
) |
Retrieves the device path of the platform override driver for a controller in the system. This driver doesn't support this API.
This | A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_ PROTOCOL instance. |
ControllerHandle | The device handle of the controller to check if a driver override exists. |
DriverImagePath | On input, a pointer to the previous driver device path returned by GetDriverPath(). On output, a pointer to the next driver device path. Passing in a pointer to NULL, will return the first driver device path for ControllerHandle. |
EFI_UNSUPPORTED |
Definition at line 1553 of file PlatDriOverrideDxe.c.
CHAR16 * GetImageName | ( | IN EFI_LOADED_IMAGE_PROTOCOL * | Image | ) |
Get the image name from EFI UI section. Get FV protocol by its loaded image protocol to abstract EFI UI section.
Image | Pointer to the loaded image protocol |
!NULL | Pointer to the image name if the image name is found, |
NULL | NULL if the image name is not found. |
Definition at line 235 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI PlatDriOverrideDxeInit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The driver Entry Point. The function will export a disk device class formset and its callback function to hii database.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
other | Some error occurs when executing this entry point. |
Definition at line 1603 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI PlatDriOverrideDxeUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
Unload its installed protocol.
[in] | ImageHandle | Handle that identifies the image to be unloaded. |
EFI_SUCCESS | The image has been unloaded. |
Definition at line 1723 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI PlatOverMngrCallback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | KeyValue, | ||
IN UINT8 | Type, | ||
IN EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
This is the function that is called to provide results data to the driver. This data consists of a unique key which is used to identify what data is either being passed back or being asked for.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Action | A null-terminated Unicode string in <ConfigRequest> format. |
KeyValue | A unique Goto OpCode callback value which record user's selection. 0x100 <= KeyValue <0x500 : user select a controller item in the first page; KeyValue == 0x1234 : user select 'Refresh' in first page, or user select 'Go to Previous Menu' in second page KeyValue == 0x1235 : user select 'Pci device filter' in first page KeyValue == 0x1500 : user select 'order ... priority' item in second page KeyValue == 0x1800 : user select 'commint changes' in third page KeyValue == 0x2000 : user select 'Go to Previous Menu' in third page |
Type | The type of value for the question. |
Value | A pointer to the data being sent to the original exporting driver. |
ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | Always returned. |
Definition at line 1345 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI PlatOverMngrExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function allows a caller to extract the current configuration for one or more named elements from the target driver.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Request | A null-terminated Unicode string in <ConfigRequest> format. |
Progress | On return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful. |
Results | A null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function. |
EFI_SUCCESS | The Results is filled with the requested values. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the results. |
EFI_INVALID_PARAMETER | Request is illegal syntax, or unknown name. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 1183 of file PlatDriOverrideDxe.c.
EFI_STATUS EFIAPI PlatOverMngrRouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function processes the results of changes in configuration.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Configuration | A null-terminated Unicode string in <ConfigRequest> format. |
Progress | A pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful. |
EFI_SUCCESS | The Results is processed successfully. |
EFI_INVALID_PARAMETER | Configuration is NULL. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 1281 of file PlatDriOverrideDxe.c.
EFI_STATUS UpdateBindingDriverSelectPage | ( | IN EFI_CALLBACK_INFO * | Private, |
IN UINT16 | KeyValue, | ||
IN PLAT_OVER_MNGR_DATA * | FakeNvData | ||
) |
Prepare to let user select the drivers which need mapping with the device controller selected in first page.
Private | Pointer to EFI_CALLBACK_INFO. |
KeyValue | The callback key value of device controller item in first page. KeyValue is larger than or equal to KEY_VALUE_DEVICE_OFFSET. |
FakeNvData | Pointer to PLAT_OVER_MNGR_DATA. |
EFI_SUCCESS | Always returned. |
Definition at line 620 of file PlatDriOverrideDxe.c.
EFI_STATUS UpdateDeviceSelectPage | ( | IN EFI_CALLBACK_INFO * | Private, |
IN UINT16 | KeyValue, | ||
IN PLAT_OVER_MNGR_DATA * | FakeNvData | ||
) |
Prepare the first page to let user select the device controller which need to add mapping drivers if user select 'Refresh' in first page. During first page, user will see all currnet controller device path in system, select any device path will go to second page to select its overrides drivers.
Private | Pointer to EFI_CALLBACK_INFO. |
KeyValue | The callback key value of device controller item in first page. |
FakeNvData | Pointer to PLAT_OVER_MNGR_DATA. |
EFI_SUCCESS | Always returned. |
Definition at line 323 of file PlatDriOverrideDxe.c.
EFI_STATUS UpdatePrioritySelectPage | ( | IN EFI_CALLBACK_INFO * | Private, |
IN UINT16 | KeyValue, | ||
IN PLAT_OVER_MNGR_DATA * | FakeNvData | ||
) |
Prepare to let user select the priority order of the drivers which are selected in second page.
Private | Pointer to EFI_CALLBACK_INFO. |
KeyValue | The callback key value of device controller item in first page. |
FakeNvData | Pointer to PLAT_OVER_MNGR_DATA. |
EFI_SUCCESS | Always returned. |
Definition at line 911 of file PlatDriOverrideDxe.c.
EFI_CALLBACK_INFO* mCallbackInfo |
Definition at line 74 of file PlatDriOverrideDxe.c.
EFI_HANDLE mCallerImageHandle = NULL |
Definition at line 61 of file PlatDriOverrideDxe.c.
EFI_DEVICE_PATH_PROTOCOL** mControllerDevicePathProtocol |
Definition at line 70 of file PlatDriOverrideDxe.c.
EFI_STRING_ID* mControllerToken |
Definition at line 67 of file PlatDriOverrideDxe.c.
UINT16 mCurrentPage |
Definition at line 73 of file PlatDriOverrideDxe.c.
EFI_HANDLE* mDevicePathHandleBuffer |
Definition at line 63 of file PlatDriOverrideDxe.c.
BOOLEAN* mDriSelection |
Definition at line 75 of file PlatDriOverrideDxe.c.
EFI_HANDLE* mDriverImageHandleBuffer |
Definition at line 64 of file PlatDriOverrideDxe.c.
UINTN mDriverImageHandleCount |
Definition at line 68 of file PlatDriOverrideDxe.c.
EFI_STRING_ID* mDriverImageToken |
Definition at line 69 of file PlatDriOverrideDxe.c.
BOOLEAN mEnvironmentVariableRead = FALSE |
Definition at line 60 of file PlatDriOverrideDxe.c.
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath |
Definition at line 78 of file PlatDriOverrideDxe.c.
UINTN mLastSavedDriverImageNum |
Definition at line 72 of file PlatDriOverrideDxe.c.
LIST_ENTRY mMappingDataBase = INITIALIZE_LIST_HEAD_VARIABLE (mMappingDataBase) |
Definition at line 59 of file PlatDriOverrideDxe.c.
UINTN mMaxDeviceCount |
Definition at line 76 of file PlatDriOverrideDxe.c.
INTN mSelectedCtrIndex |
Definition at line 66 of file PlatDriOverrideDxe.c.
UINTN mSelectedDriverImageNum |
Definition at line 71 of file PlatDriOverrideDxe.c.
CHAR16 mVariableName[] = L"Data" |
Definition at line 58 of file PlatDriOverrideDxe.c.