diff options
4 files changed, 171 insertions, 28 deletions
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c index 1b11d72a24..7cb4734bab 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c @@ -186,8 +186,7 @@ ClockDescribeRates ( UINT32 PayloadLength;
SCMI_COMMAND Cmd;
- UINT32 *MessageParams1;
- UINT32 *MessageParams2;
+ UINT32 *MessageParams;
CLOCK_DESCRIBE_RATES *DescribeRates;
CLOCK_RATE_DWORD *Rate;
@@ -200,7 +199,7 @@ ClockDescribeRates ( RequiredArraySize = 0;
RateIndex = 0;
- Status = ScmiCommandGetPayload (&MessageParams1);
+ Status = ScmiCommandGetPayload (&MessageParams);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -208,11 +207,9 @@ ClockDescribeRates ( Cmd.ProtocolId = ScmiProtocolIdClock;
Cmd.MessageId = ScmiMessageIdClockDescribeRates;
- MessageParams2 = MessageParams1 + 1;
-
do {
- *MessageParams1 = ClockId;
- *MessageParams2 = RateIndex;
+ MessageParams[0] = ClockId;
+ MessageParams[1] = RateIndex;
// Set Payload length, note PayloadLength is a IN/OUT parameter.
PayloadLength = sizeof (ClockId) + sizeof (RateIndex);
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index c8ca25e87f..3950bbb169 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -848,7 +848,17 @@ DeviceManagerCallback ( {
UINTN CurIndex;
- if (Action != EFI_BROWSER_ACTION_CHANGING) {
+ if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+ //
+ // Means enter the device manager form.
+ // Update device manager page when form opens, because options may add or remove.
+ //
+ if (QuestionId == 0x1212) {
+ CreateDeviceManagerForm (DEVICE_MANAGER_FORM_ID);
+ }
+
+ return EFI_SUCCESS;
+ } else if (Action != EFI_BROWSER_ACTION_CHANGING) {
//
// Do nothing for other UEFI Action. Only do call back when data is changed.
//
@@ -926,11 +936,6 @@ DeviceManagerUiLibConstructor ( //
EfiBootManagerConnectAll ();
- //
- // Update boot manager page
- //
- CreateDeviceManagerForm (DEVICE_MANAGER_FORM_ID);
-
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr index d81c580fe7..911ea036b8 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr @@ -28,6 +28,17 @@ formset title = STRING_TOKEN(STR_EDKII_MENU_TITLE);
subtitle text = STRING_TOKEN(STR_DEVICES_LIST);
+ //
+ // Add this invisable text in order to indicate enter Device Manager form.
+ //
+ suppressif TRUE;
+ text
+ help = STRING_TOKEN(STR_EMPTY_STRING),
+ text = STRING_TOKEN(STR_EMPTY_STRING),
+ flags = INTERACTIVE,
+ key = 0x1212;
+ endif;
+
label LABEL_DEVICES_LIST;
label LABEL_END;
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c index 46a8b780e3..1f6786f353 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c @@ -105,6 +105,79 @@ BmGetControllerName ( }
/**
+ Return the driver name.
+
+ @param DriverHealthHandle The handle on which the Driver Health protocol instance is retrieved.
+
+ @return A pointer to the Unicode string to return. This Unicode string is the name of the controller
+ specified by DriverHealthHandle.
+**/
+CHAR16 *
+BmGetDriverName (
+ IN EFI_HANDLE DriverHealthHandle
+ )
+{
+ EFI_STATUS Status;
+ CHAR16 *DriverName;
+ CHAR8 *LanguageVariable;
+ CHAR8 *BestLanguage;
+ BOOLEAN Iso639Language;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+
+ DriverName = NULL;
+
+ //
+ // Locate Component Name (2) protocol on the driver binging handle.
+ //
+ Iso639Language = FALSE;
+ Status = gBS->HandleProtocol (
+ DriverHealthHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **)&ComponentName
+ );
+ if (EFI_ERROR (Status)) {
+ Status = gBS->HandleProtocol (
+ DriverHealthHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **)&ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ Iso639Language = TRUE;
+ }
+ }
+
+ if (!EFI_ERROR (Status)) {
+ GetEfiGlobalVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", (VOID **)&LanguageVariable, NULL);
+ BestLanguage = GetBestLanguage (
+ ComponentName->SupportedLanguages,
+ Iso639Language,
+ (LanguageVariable != NULL) ? LanguageVariable : "",
+ Iso639Language ? "eng" : "en-US",
+ NULL
+ );
+ if (LanguageVariable != NULL) {
+ FreePool (LanguageVariable);
+ }
+
+ Status = ComponentName->GetDriverName (
+ ComponentName,
+ BestLanguage,
+ &DriverName
+ );
+ }
+
+ if (!EFI_ERROR (Status)) {
+ return AllocateCopyPool (StrSize (DriverName), DriverName);
+ } else {
+ return ConvertDevicePathToText (
+ DevicePathFromHandle (DriverHealthHandle),
+ FALSE,
+ FALSE
+ );
+ }
+}
+
+/**
Display a set of messages returned by the GetHealthStatus () service of the EFI Driver Health Protocol
@param DriverHealthInfo Pointer to the Driver Health information entry.
@@ -116,7 +189,8 @@ BmDisplayMessages ( {
UINTN Index;
EFI_STRING String;
- CHAR16 *ControllerName;
+ CHAR16 *ControllerName = NULL;
+ CHAR16 *DriverName = NULL;
if ((DriverHealthInfo->MessageList == NULL) ||
(DriverHealthInfo->MessageList[0].HiiHandle == NULL))
@@ -124,14 +198,30 @@ BmDisplayMessages ( return;
}
- ControllerName = BmGetControllerName (
- DriverHealthInfo->DriverHealthHandle,
- DriverHealthInfo->ControllerHandle,
- DriverHealthInfo->ChildHandle
- );
+ if (DriverHealthInfo->DriverHealthHandle != NULL) {
+ DriverName = BmGetDriverName (DriverHealthInfo->DriverHealthHandle);
+ if (DriverName != NULL) {
+ DEBUG ((DEBUG_INFO, "Driver: %s\n", DriverName));
+ Print (L"Driver: %s\n", DriverName);
+ }
+ }
+
+ if (DriverHealthInfo->ControllerHandle != NULL) {
+ ControllerName = BmGetControllerName (
+ DriverHealthInfo->DriverHealthHandle,
+ DriverHealthInfo->ControllerHandle,
+ DriverHealthInfo->ChildHandle
+ );
+ if (ControllerName != NULL) {
+ DEBUG ((DEBUG_INFO, "Controller: %s\n", ControllerName));
+ Print (L"Controller: %s\n", ControllerName);
+ }
+ }
+
+ if ((DriverName == NULL) && (ControllerName == NULL)) {
+ return;
+ }
- DEBUG ((DEBUG_INFO, "Controller: %s\n", ControllerName));
- Print (L"Controller: %s\n", ControllerName);
for (Index = 0; DriverHealthInfo->MessageList[Index].HiiHandle != NULL; Index++) {
String = HiiGetString (
DriverHealthInfo->MessageList[Index].HiiHandle,
@@ -147,6 +237,12 @@ BmDisplayMessages ( if (ControllerName != NULL) {
FreePool (ControllerName);
+ ControllerName = NULL;
+ }
+
+ if (DriverName != NULL) {
+ FreePool (DriverName);
+ DriverName = NULL;
}
}
@@ -550,24 +646,58 @@ BmRepairAllControllers ( EfiBootManagerFreeDriverHealthInfo (DriverHealthInfo, Count);
DEBUG_CODE_BEGIN ();
- CHAR16 *ControllerName;
+ CHAR16 *ControllerName = NULL;
+ CHAR16 *DriverName = NULL;
+ CHAR16 String[512];
DriverHealthInfo = EfiBootManagerGetDriverHealthInfo (&Count);
for (Index = 0; Index < Count; Index++) {
- ControllerName = BmGetControllerName (
- DriverHealthInfo[Index].DriverHealthHandle,
- DriverHealthInfo[Index].ControllerHandle,
- DriverHealthInfo[Index].ChildHandle
- );
+ if (DriverHealthInfo == NULL) {
+ continue;
+ }
+
+ ZeroMem (String, sizeof (String));
+ if (DriverHealthInfo[Index].DriverHealthHandle != NULL) {
+ DriverName = BmGetDriverName (DriverHealthInfo[Index].DriverHealthHandle);
+ }
+
+ if (DriverHealthInfo[Index].ControllerHandle != NULL) {
+ ControllerName = BmGetControllerName (
+ DriverHealthInfo[Index].DriverHealthHandle,
+ DriverHealthInfo[Index].ControllerHandle,
+ DriverHealthInfo[Index].ChildHandle
+ );
+ }
+
+ if ((DriverName == NULL) && (ControllerName == NULL)) {
+ continue;
+ }
+
+ UnicodeSPrint (
+ String,
+ sizeof (String),
+ L"%s%s%s",
+ DriverName != NULL ? DriverName : L"",
+ (DriverName != NULL && ControllerName != NULL) ? L" " : L"",
+ ControllerName != NULL ? ControllerName : L""
+ );
+
DEBUG ((
DEBUG_INFO,
"%02d: %s - %s\n",
Index,
- ControllerName,
+ String,
mBmHealthStatusText[DriverHealthInfo[Index].HealthStatus]
));
+
if (ControllerName != NULL) {
FreePool (ControllerName);
+ ControllerName = NULL;
+ }
+
+ if (DriverName != NULL) {
+ FreePool (DriverName);
+ DriverName = NULL;
}
}
|