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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI DriverHealthManagerFakeExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI DriverHealthManagerFakeRouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI InitializeDriverHealthManager (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
CHAR8 * DriverHealthManagerSelectBestLanguage (IN CHAR8 *SupportedLanguages, IN BOOLEAN Iso639Language)
 
EFI_STATUS DriverHealthManagerGetComponentNameWorker (IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE DriverBindingHandle, OUT EFI_COMPONENT_NAME_PROTOCOL **ComponentName, OUT CHAR8 **SupportedLanguage)
 
EFI_STATUS DriverHealthManagerGetDriverNameWorker (IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE DriverBindingHandle, OUT CHAR16 **DriverName)
 
CHAR16 * DriverHealthManagerGetDriverName (IN EFI_HANDLE DriverBindingHandle)
 
EFI_STATUS DriverHealthManagerGetControllerNameWorker (IN EFI_GUID *ProtocolGuid, IN EFI_HANDLE DriverBindingHandle, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle, OUT CHAR16 **ControllerName)
 
CHAR16 * DriverHealthManagerGetControllerName (IN EFI_HANDLE DriverBindingHandle, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle)
 
EFI_STATUS EFIAPI DriverHealthManagerRepairNotify (IN UINTN Value, IN UINTN Limit)
 
EFI_STATUS DriverHealthManagerGetFormsetId (IN EFI_HII_HANDLE Handle, OUT EFI_GUID *FormsetGuid)
 
VOID DriverHealthManagerProcessSingleControllerHealth (IN EFI_DRIVER_HEALTH_PROTOCOL *DriverHealth, IN EFI_HANDLE ControllerHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL, IN EFI_DRIVER_HEALTH_STATUS HealthStatus, IN EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList OPTIONAL, IN EFI_HII_HANDLE FormHiiHandle)
 
VOID DriverHealthManagerUpdateForm (BOOLEAN ConfigureOnly)
 
VOID DriverHealthManagerCleanDynamicString (VOID)
 
EFI_STATUS EFIAPI DriverHealthManagerCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 

Variables

EFI_HII_CONFIG_ACCESS_PROTOCOL mDriverHealthManagerConfigAccess
 
EFI_GUID mDriverHealthManagerForm = DRIVER_HEALTH_MANAGER_FORMSET_GUID
 
FORM_DEVICE_PATH mDriverHealthManagerFormDevicePath
 
EFI_HII_HANDLE mDriverHealthManagerHiiHandle
 
EFI_BOOT_MANAGER_DRIVER_HEALTH_INFOmDriverHealthManagerHealthInfo = NULL
 
UINTN mDriverHealthManagerHealthInfoCount = 0
 
EFI_HII_DATABASE_PROTOCOLmDriverHealthManagerDatabase
 
UINT8 DriverHealthManagerVfrBin []
 
UINT8 DriverHealthConfigureVfrBin []
 

Detailed Description

This module produces two driver health manager forms. One will be used by BDS core to configure the Configured Required driver health instances, the other will be automatically included by firmware setup (UI).

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2018 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DriverHealthManagerDxe.c.

Function Documentation

◆ DriverHealthManagerCallback()

EFI_STATUS EFIAPI DriverHealthManagerCallback ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN EFI_BROWSER_ACTION  Action,
IN EFI_QUESTION_ID  QuestionId,
IN UINT8  Type,
IN EFI_IFR_TYPE_VALUE Value,
OUT EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This function is invoked if user selected a interactive opcode from Driver Health's Formset.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ActionSpecifies the type of action taken by the browser.
QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect.
TypeThe type of value for the question.
ValueA pointer to the data being sent to the original exporting driver.
ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_INVALID_PARAMETERThe setup browser call this function with invalid parameters.

Definition at line 934 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerCleanDynamicString()

VOID DriverHealthManagerCleanDynamicString ( VOID  )

Called when the form is closing to remove the dynamicly added string from the HII package list.

Definition at line 878 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerFakeExtractConfig()

EFI_STATUS EFIAPI DriverHealthManagerFakeExtractConfig ( 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.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
RequestA null-terminated Unicode string in <ConfigRequest> format.
ProgressOn 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.
ResultsA 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.
Return values
EFI_SUCCESSThe Results is filled with the requested values.
EFI_OUT_OF_RESOURCESNot enough memory to store the results.
EFI_INVALID_PARAMETERRequest is illegal syntax, or unknown name.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 78 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerFakeRouteConfig()

EFI_STATUS EFIAPI DriverHealthManagerFakeRouteConfig ( 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.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ConfigurationA null-terminated Unicode string in <ConfigResp> format.
ProgressA 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.
Return values
EFI_SUCCESSThe Results is processed successfully.
EFI_INVALID_PARAMETERConfiguration is NULL.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 111 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetComponentNameWorker()

EFI_STATUS DriverHealthManagerGetComponentNameWorker ( IN EFI_GUID ProtocolGuid,
IN EFI_HANDLE  DriverBindingHandle,
OUT EFI_COMPONENT_NAME_PROTOCOL **  ComponentName,
OUT CHAR8 **  SupportedLanguage 
)

This is an internal worker function to get the Component Name (2) protocol interface and the language it supports.

Parameters
ProtocolGuidA pointer to an EFI_GUID. It points to Component Name (2) protocol GUID.
DriverBindingHandleThe handle on which the Component Name (2) protocol instance is retrieved.
ComponentNameA pointer to the Component Name (2) protocol interface.
SupportedLanguageThe best suitable language that matches the SupportedLangues interface for the located Component Name (2) instance.
Return values
EFI_SUCCESSThe Component Name (2) protocol instance is successfully located and we find the best matching language it support.
EFI_UNSUPPORTEDThe input Language is not supported by the Component Name (2) protocol.
OtherSome error occurs when locating Component Name (2) protocol instance or finding the supported language.

Definition at line 247 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetControllerName()

CHAR16 * DriverHealthManagerGetControllerName ( IN EFI_HANDLE  DriverBindingHandle,
IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE  ChildHandle 
)

This function gets controller name from Component Name 2 protocol interface and Component Name protocol interface in turn. It first tries UEFI 2.0 Component Name 2 protocol interface and try to get the controller name. If the attempt fails, it then gets the controller name from EFI 1.1 Component Name protocol for backward compatibility support.

Parameters
DriverBindingHandleThe handle on which the Component Name (2) protocol instance is retrieved.
ControllerHandleThe handle of a controller that the driver specified by DriverBindingHandle is managing. This handle specifies the controller whose name is to be returned.
ChildHandleThe handle of the child controller to retrieve the name of. 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 attempt to retrieve the name of the bus controller. It will not be NULL for a bus driver that attempts to retrieve the name of a child controller.
Returns
A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle.

Definition at line 463 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetControllerNameWorker()

EFI_STATUS DriverHealthManagerGetControllerNameWorker ( IN EFI_GUID ProtocolGuid,
IN EFI_HANDLE  DriverBindingHandle,
IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE  ChildHandle,
OUT CHAR16 **  ControllerName 
)

This function gets controller name from Component Name 2 protocol interface and Component Name protocol interface in turn. It first tries UEFI 2.0 Component Name 2 protocol interface and try to get the controller name. If the attempt fails, it then gets the controller name from EFI 1.1 Component Name protocol for backward compatibility support.

Parameters
ProtocolGuidA pointer to an EFI_GUID. It points to Component Name (2) protocol GUID.
DriverBindingHandleThe handle on which the Component Name (2) protocol instance is retrieved.
ControllerHandleThe handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned.
ChildHandleThe handle of the child controller to retrieve the name of. 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 attempt to retrieve the name of the bus controller. It will not be NULL for a bus driver that attempts to retrieve the name of a child controller.
ControllerNameA pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle.
Return values
EFI_SUCCESSThe controller name is successfully retrieved from Component Name (2) protocol interface.
OtherThe controller name cannot be retrieved from Component Name (2) protocol.

Definition at line 402 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetDriverName()

CHAR16 * DriverHealthManagerGetDriverName ( IN EFI_HANDLE  DriverBindingHandle)

This function gets driver name from Component Name 2 protocol interface and Component Name protocol interface in turn. It first tries UEFI 2.0 Component Name 2 protocol interface and try to get the driver name. If the attempt fails, it then gets the driver name from EFI 1.1 Component Name protocol for backward compatibility support.

Parameters
DriverBindingHandleThe handle on which the Component Name (2) protocol instance is retrieved.
Returns
A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle.

Definition at line 352 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetDriverNameWorker()

EFI_STATUS DriverHealthManagerGetDriverNameWorker ( IN EFI_GUID ProtocolGuid,
IN EFI_HANDLE  DriverBindingHandle,
OUT CHAR16 **  DriverName 
)

This is an internal worker function to get driver name from Component Name (2) protocol interface.

Parameters
ProtocolGuidA pointer to an EFI_GUID. It points to Component Name (2) protocol GUID.
DriverBindingHandleThe handle on which the Component Name (2) protocol instance is retrieved.
DriverNameA pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This.
Return values
EFI_SUCCESSThe driver name is successfully retrieved from Component Name (2) protocol interface.
OtherThe driver name cannot be retrieved from Component Name (2) protocol interface.

Definition at line 301 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerGetFormsetId()

EFI_STATUS DriverHealthManagerGetFormsetId ( IN EFI_HII_HANDLE  Handle,
OUT EFI_GUID FormsetGuid 
)

Look for the formset GUID which has the gEfiHiiDriverHealthFormsetGuid class GUID in the specified HII package list.

Parameters
HandleHandle to the HII package list.
FormsetGuidReturn the formset GUID.
Return values
EFI_SUCCESSThe formset is found successfully.
EFI_NOT_FOUNDThe formset cannot be found.

Definition at line 535 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerProcessSingleControllerHealth()

VOID DriverHealthManagerProcessSingleControllerHealth ( IN EFI_DRIVER_HEALTH_PROTOCOL DriverHealth,
IN EFI_HANDLE ControllerHandle  OPTIONAL,
IN EFI_HANDLE ChildHandle  OPTIONAL,
IN EFI_DRIVER_HEALTH_STATUS  HealthStatus,
IN EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList  OPTIONAL,
IN EFI_HII_HANDLE  FormHiiHandle 
)

Processes a single controller using the EFI Driver Health Protocol associated with that controller.

Parameters
DriverHealthA pointer to the EFI_DRIVER_HEALTH_PROTOCOL instance.
ControllerHandleThe class guid specifies which form set will be displayed.
ChildHandleThe handle of the child controller to retrieve the health status on. This is an optional parameter that may be NULL.
HealthStatusThe health status of the controller.
MessageListAn array of warning or error messages associated with the controller specified by ControllerHandle and ChildHandle. This is an optional parameter that may be NULL.
FormHiiHandleThe HII handle for an HII form associated with the controller specified by ControllerHandle and ChildHandle.

Definition at line 629 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerRepairNotify()

EFI_STATUS EFIAPI DriverHealthManagerRepairNotify ( IN UINTN  Value,
IN UINTN  Limit 
)

The repair notify function.

Parameters
ValueA value between 0 and Limit that identifies the current progress of the repair operation.
LimitThe maximum value of Value for the current repair operation. If Limit is 0, then the completion progress is indeterminate. For example, a driver that wants to specify progress in percent would use a Limit value of 100.
Return values
EFI_SUCCESSSuccessfully return from the notify function.

Definition at line 516 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerSelectBestLanguage()

CHAR8 * DriverHealthManagerSelectBestLanguage ( IN CHAR8 *  SupportedLanguages,
IN BOOLEAN  Iso639Language 
)

Select the best matching language according to front page policy for best user experience.

This function supports both ISO 639-2 and RFC 4646 language codes, but language code types may not be mixed in a single call to this function.

Parameters
SupportedLanguagesA pointer to a Null-terminated ASCII string that contains a set of language codes in the format specified by Iso639Language.
Iso639LanguageIf TRUE, then all language codes are assumed to be in ISO 639-2 format. If FALSE, then all language codes are assumed to be in RFC 4646 language format.
Return values
NULLThe best matching language could not be found in SupportedLanguages.
NULLThere are not enough resources available to return the best matching language.
OtherA pointer to a Null-terminated ASCII string that is the best matching language in SupportedLanguages.

Definition at line 204 of file DriverHealthManagerDxe.c.

◆ DriverHealthManagerUpdateForm()

VOID DriverHealthManagerUpdateForm ( BOOLEAN  ConfigureOnly)

Update the form to include the driver health instances.

Parameters
ConfigureOnlyOnly include the configure required driver health instances when TRUE, include all the driver health instances otherwise.

Definition at line 685 of file DriverHealthManagerDxe.c.

◆ InitializeDriverHealthManager()

EFI_STATUS EFIAPI InitializeDriverHealthManager ( EFI_HANDLE  ImageHandle,
EFI_SYSTEM_TABLE SystemTable 
)

Install the health manager forms. One will be used by BDS core to configure the Configured Required driver health instances, the other will be automatically included by firmware setup (UI).

Parameters
ImageHandleThe image handle.
SystemTableThe system table.
Return values
EFI_SUCEESSThe health manager forms are successfully installed.

Definition at line 141 of file DriverHealthManagerDxe.c.

Variable Documentation

◆ mDriverHealthManagerConfigAccess

EFI_HII_CONFIG_ACCESS_PROTOCOL mDriverHealthManagerConfigAccess
Initial value:
= {
}
EFI_STATUS EFIAPI DriverHealthManagerFakeRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI DriverHealthManagerFakeExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI DriverHealthManagerCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)

Definition at line 16 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerDatabase

EFI_HII_DATABASE_PROTOCOL* mDriverHealthManagerDatabase

Definition at line 49 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerForm

EFI_GUID mDriverHealthManagerForm = DRIVER_HEALTH_MANAGER_FORMSET_GUID

Definition at line 22 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerFormDevicePath

FORM_DEVICE_PATH mDriverHealthManagerFormDevicePath
Initial value:
= {
{
{
{
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
EFI_CALLER_ID_GUID
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(END_DEVICE_PATH_LENGTH),
(UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
}
}
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133

Definition at line 24 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerHealthInfo

EFI_BOOT_MANAGER_DRIVER_HEALTH_INFO* mDriverHealthManagerHealthInfo = NULL

Definition at line 47 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerHealthInfoCount

UINTN mDriverHealthManagerHealthInfoCount = 0

Definition at line 48 of file DriverHealthManagerDxe.c.

◆ mDriverHealthManagerHiiHandle

EFI_HII_HANDLE mDriverHealthManagerHiiHandle

Definition at line 46 of file DriverHealthManagerDxe.c.