diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-19 03:04:06 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-19 03:04:06 +0000 |
commit | 81b618fe85f67f70a81d38a968cb5eca719e64d9 (patch) | |
tree | 0725443a1eb42bf159005179b531912044a47280 | |
parent | 6738e4e7a02f9c1f3239670ce457c276e9f18186 (diff) | |
download | edk2-81b618fe85f67f70a81d38a968cb5eca719e64d9.tar.gz edk2-81b618fe85f67f70a81d38a968cb5eca719e64d9.tar.bz2 edk2-81b618fe85f67f70a81d38a968cb5eca719e64d9.zip |
Update ALTCFG reference from default name token to default ID.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11558 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 65 | ||||
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 76 | ||||
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h | 1 |
3 files changed, 10 insertions, 132 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index d2b25a0036..7e93df9ada 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -1629,15 +1629,10 @@ InternalHiiIfrValueAction ( UINT32 Index;
EFI_GUID *VarGuid;
EFI_STRING VarName;
- EFI_STRING_ID DefaultName;
UINT8 *PackageData;
- UINTN IfrOffset;
- EFI_IFR_OP_HEADER *IfrOpHdr;
EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
- UINT32 PackageOffset;
UINTN PackageListLength;
- EFI_HII_PACKAGE_HEADER PacakgeHeader;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
@@ -1772,13 +1767,9 @@ InternalHiiIfrValueAction ( Status = EFI_SUCCESS;
goto NextConfigAltResp;
}
-
- //
- // 2. Get DefaultName string ID by parsing the PacakgeList
- //
//
- // Get HiiPackage by HiiHandle
+ // 2. Get HiiPackage by HiiHandle
//
PackageListLength = 0;
HiiPackageList = NULL;
@@ -1807,58 +1798,8 @@ InternalHiiIfrValueAction ( }
//
- // Parse the form package and get the default name string ID.
- //
- if (ActionType == ACTION_SET_DEFAUTL_VALUE) {
- PackageOffset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
- Status = EFI_NOT_FOUND;
- while (PackageOffset < PackageListLength) {
- CopyMem (&PacakgeHeader, (UINT8 *) HiiPackageList + PackageOffset, sizeof (PacakgeHeader));
-
- //
- // Parse IFR opcode to get default store opcode
- //
- if (PacakgeHeader.Type == EFI_HII_PACKAGE_FORMS) {
- IfrOffset = sizeof (PacakgeHeader);
- PackageData = (UINT8 *) HiiPackageList + PackageOffset;
- while (IfrOffset < PacakgeHeader.Length) {
- IfrOpHdr = (EFI_IFR_OP_HEADER *) (PackageData + IfrOffset);
- //
- // Match DefaultId to find its DefaultName
- //
- if (IfrOpHdr->OpCode == EFI_IFR_DEFAULTSTORE_OP) {
- if (((EFI_IFR_DEFAULTSTORE *) IfrOpHdr)->DefaultId == DefaultId) {
- DefaultName = ((EFI_IFR_DEFAULTSTORE *) IfrOpHdr)->DefaultName;
- Status = EFI_SUCCESS;
- break;
- }
- }
- IfrOffset += IfrOpHdr->Length;
- }
- //
- // Only one form is in a package list.
- //
- break;
- }
-
- //
- // Go to next package.
- //
- PackageOffset += PacakgeHeader.Length;
- }
-
- //
- // Not found the matched default string ID
- //
- if (EFI_ERROR (Status)) {
- Status = EFI_SUCCESS;
- goto NextConfigAltResp;
- }
- }
-
- //
// 3. Call ConfigRouting GetAltCfg(ConfigRoute, <ConfigResponse>, Guid, Name, DevicePath, AltCfgId, AltCfgResp)
- // Get the default configuration string according to the found default name string ID.
+ // Get the default configuration string according to the default ID.
//
Status = gHiiConfigRouting->GetAltConfig (
gHiiConfigRouting,
@@ -1866,7 +1807,7 @@ InternalHiiIfrValueAction ( VarGuid,
VarName,
DevicePath,
- (ActionType == ACTION_SET_DEFAUTL_VALUE) ? &DefaultName:NULL, // it can be NULL to get the current setting.
+ (ActionType == ACTION_SET_DEFAUTL_VALUE) ? &DefaultId:NULL, // it can be NULL to get the current setting.
&ConfigResp
);
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 30f602d30f..02d7d7b5fa 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -636,37 +636,6 @@ MergeDefaultString ( }
/**
- This function finds the matched DefaultName for the input DefaultId
-
- @param DefaultIdArray Array stores the map table between DefaultId and DefaultName.
- @param VarDefaultId Default Id
- @param VarDefaultName Default Name string ID for the input default ID.
-
- @retval EFI_SUCCESS The mapped default name string ID is found.
- @retval EFI_NOT_FOUND The mapped default name string ID is not found.
-**/
-EFI_STATUS
-FindDefaultName (
- IN IFR_DEFAULT_DATA *DefaultIdArray,
- IN UINT16 VarDefaultId,
- OUT EFI_STRING_ID *VarDefaultName
- )
-{
- LIST_ENTRY *Link;
- IFR_DEFAULT_DATA *DefaultData;
-
- for (Link = DefaultIdArray->Entry.ForwardLink; Link != &DefaultIdArray->Entry; Link = Link->ForwardLink) {
- DefaultData = BASE_CR (Link, IFR_DEFAULT_DATA, Entry);
- if (DefaultData->DefaultId == VarDefaultId) {
- *VarDefaultName = DefaultData->DefaultName;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-/**
This function inserts new DefaultValueData into the BlockData DefaultValue array.
@param BlockData The BlockData is updated to add new default value.
@@ -948,7 +917,6 @@ ParseIfrData ( goto Done;
}
DefaultData->DefaultId = ((EFI_IFR_DEFAULTSTORE *) IfrOpHdr)->DefaultId;
- DefaultData->DefaultName = ((EFI_IFR_DEFAULTSTORE *) IfrOpHdr)->DefaultName;
InsertTailList (&DefaultIdArray->Entry, &DefaultData->Entry);
DefaultData = NULL;
break;
@@ -1038,13 +1006,9 @@ ParseIfrData ( //
//
- // Set standard ID and Get DefaultName String ID
+ // Set standard ID
//
VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1055,7 +1019,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
case EFI_IFR_NUMERIC_SIZE_1:
@@ -1199,13 +1162,9 @@ ParseIfrData ( //
if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT) == EFI_IFR_CHECKBOX_DEFAULT) {
//
- // Set standard ID to Manufacture ID and Get DefaultName String ID
+ // Set standard ID to Manufacture ID
//
VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1216,7 +1175,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
DefaultData->Value = 1;
//
// Add DefaultValue into current BlockData
@@ -1226,13 +1184,9 @@ ParseIfrData ( if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG) == EFI_IFR_CHECKBOX_DEFAULT_MFG) {
//
- // Set standard ID to Manufacture ID and Get DefaultName String ID
+ // Set standard ID to Manufacture ID
//
VarDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1243,7 +1197,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
DefaultData->Value = 1;
//
// Add DefaultValue into current BlockData
@@ -1466,13 +1419,9 @@ ParseIfrData ( //
FirstOneOfOption = FALSE;
//
- // Set standard ID to Manufacture ID and Get DefaultName String ID
+ // Set standard ID to Manufacture ID
//
VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1483,7 +1432,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
DefaultData->Value = IfrOneOfOption->Value.u64;
//
// Add DefaultValue into current BlockData
@@ -1493,13 +1441,9 @@ ParseIfrData ( if ((IfrOneOfOption->Flags & EFI_IFR_OPTION_DEFAULT_MFG) == EFI_IFR_OPTION_DEFAULT_MFG) {
//
- // Set default ID to Manufacture ID and Get DefaultName String ID
+ // Set default ID to Manufacture ID
//
VarDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1510,7 +1454,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
DefaultData->Value = IfrOneOfOption->Value.u64;
//
// Add DefaultValue into current BlockData
@@ -1537,14 +1480,10 @@ ParseIfrData ( break;
}
//
- // Get the DefaultId and DefaultName String ID
+ // Get the DefaultId
//
IfrDefault = (EFI_IFR_DEFAULT *) IfrOpHdr;
VarDefaultId = IfrDefault->DefaultId;
- Status = FindDefaultName (DefaultIdArray, VarDefaultId, &VarDefaultName);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
//
// Prepare new DefaultValue
//
@@ -1555,7 +1494,6 @@ ParseIfrData ( }
DefaultData->OpCode = IfrOpHdr->OpCode;
DefaultData->DefaultId = VarDefaultId;
- DefaultData->DefaultName = VarDefaultName;
DefaultData->Value = IfrDefault->Value.u64;
//
// Add DefaultValue into current BlockData
@@ -2128,7 +2066,7 @@ GetFullStringFromHiiFormPackages ( (1 + StrLen (ConfigHdr) + 8 + 4 + 1) * sizeof (CHAR16),
L"&%s&ALTCFG=%04X",
ConfigHdr,
- DefaultId->DefaultName
+ DefaultId->DefaultId
);
StringPtr += StrLen (StringPtr);
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h index d01a672189..d4f730abb8 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h @@ -89,7 +89,6 @@ typedef struct { typedef struct {
LIST_ENTRY Entry;
UINT8 OpCode;
- EFI_STRING_ID DefaultName;
UINT16 DefaultId;
UINT64 Value;
} IFR_DEFAULT_DATA;
|