Add INF extension Information

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7228 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2009-01-09 06:26:42 +00:00
parent b3ff502f6d
commit e561879137
22 changed files with 164 additions and 190 deletions

View File

@@ -1,20 +1,5 @@
/** @file
Copyright (c) 2007 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PlatOverMngr.c
Abstract:
A UI application to offer a UI interface in device manager to let user configue
platform override protocol to override the default algorithm for matching
drivers to controllers.
@@ -27,6 +12,15 @@ Abstract:
4. The UI application save all the mapping info in NV variables which will be consumed
by platform override protocol driver to publish the platform override protocol.
Copyright (c) 2007 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <PiDxe.h>
@@ -119,30 +113,33 @@ ConvertComponentNameSupportLanguage (
IN CHAR8 *Language
)
{
CHAR8 *LangCode;
LangCode = NULL;
CHAR8 *LangCode;
LangCode = NULL;
//
// check the input language is English
// Check the input language is English
//
if (AsciiStrnCmp (Language, "en-", 3) != 0) {
return NULL;
}
//
// Convert Language string from RFC 3066 to ISO 639-2
//
LangCode = AllocateZeroPool(4);
AsciiStrCpy (LangCode, "eng");
//
// Check whether the converted language is supported in the SupportedLanguages list.
// Check SupportedLanguages format
//
if (AsciiStrStr (SupportedLanguages, LangCode) == NULL) {
FreePool (LangCode);
return NULL;
if (AsciiStrStr (SupportedLanguages, "en-") != NULL) {
//
// Create RFC 3066 language
//
LangCode = AllocateZeroPool(AsciiStrSize (Language));
AsciiStrCpy (LangCode, Language);
} else if (AsciiStrStr (SupportedLanguages, "en") != NULL) {
//
// Create ISO 639-2 Language
//
LangCode = AllocateZeroPool(4);
AsciiStrCpy (LangCode, "eng");
}
return LangCode;
}
@@ -193,12 +190,14 @@ GetComponentName (
if (ComponentName != NULL) {
if (ComponentName->GetDriverName != NULL) {
SupportedLanguage = ConvertComponentNameSupportLanguage (ComponentName->SupportedLanguages, mLanguage);
Status = ComponentName->GetDriverName (
ComponentName,
SupportedLanguage,
&DriverName
);
FreePool (SupportedLanguage);
if (SupportedLanguage != NULL) {
Status = ComponentName->GetDriverName (
ComponentName,
SupportedLanguage,
&DriverName
);
FreePool (SupportedLanguage);
}
}
} else if (ComponentName2 != NULL) {
if (ComponentName2->GetDriverName != NULL) {
@@ -555,7 +554,10 @@ GetDriverBindingHandleFromImageHandle (
if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) {
return NULL;
}
//
// Get the first Driver Binding handle which has the specific image handle.
//
for (Index = 0; Index < DriverBindingHandleCount; Index++) {
DriverBindingInterface = NULL;
Status = gBS->OpenProtocol (
@@ -576,9 +578,6 @@ GetDriverBindingHandleFromImageHandle (
}
}
//
// If no Driver Binding Protocol instance is found
//
FreePool (DriverBindingHandleBuffer);
return DriverBindingHandle;
}
@@ -1301,7 +1300,7 @@ PlatOverMngrInit (
EFI_CALLBACK_INFO *CallbackInfo;
EFI_HANDLE DriverHandle;
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
//
// There should only be one HII protocol
//
@@ -1341,7 +1340,7 @@ PlatOverMngrInit (
//
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
CallbackInfo->DriverHandle = DriverHandle;
@@ -1355,7 +1354,7 @@ PlatOverMngrInit (
&CallbackInfo->ConfigAccess
);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
//
@@ -1377,6 +1376,10 @@ PlatOverMngrInit (
);
FreePool (PackageList);
if (EFI_ERROR (Status)) {
goto Finish;
}
//
// Locate ConfigRouting protocol
//
@@ -1386,7 +1389,7 @@ PlatOverMngrInit (
(VOID **) &CallbackInfo->HiiConfigRouting
);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
//
@@ -1411,11 +1414,24 @@ PlatOverMngrInit (
NULL,
NULL
);
if (EFI_ERROR (Status)) {
goto Finish;
}
Status = HiiDatabase->RemovePackageList (HiiDatabase, CallbackInfo->RegisteredHandle);
if (EFI_ERROR (Status)) {
return Status;
goto Finish;
}
return EFI_SUCCESS;
Finish:
if (CallbackInfo->DriverHandle != NULL) {
HiiLibDestroyHiiDriverHandle (CallbackInfo->DriverHandle);
}
if (CallbackInfo != NULL) {
FreePool (CallbackInfo);
}
return EFI_SUCCESS;
return Status;
}

View File

@@ -67,21 +67,22 @@
GenericBdsLib
[Guids]
gEfiGlobalVariableGuid # Get value of variable L"PlatformLang".
# this value specifies the platform supported language string (RFC 3066)
gEfiGlobalVariableGuid ## CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 3066 format)
[Protocols]
gEfiComponentName2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiComponentNameProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiBusSpecificDriverOverrideProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDriverBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiDatabaseProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFormBrowser2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiConfigRoutingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiHiiConfigAccessProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
gEfiHiiDatabaseProtocolGuid ## CONSUMED
gEfiFormBrowser2ProtocolGuid ## CONSUMED
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
gEfiHiiConfigAccessProtocolGuid ## PRODUCED

View File

@@ -45,5 +45,5 @@
UefiBootServicesTableLib
[Protocols]
gEfiPlatformDriverOverrideProtocolGuid # ALWAYS_PRODUCED
gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED