EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Data Structures | Functions | Variables

EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c File Reference

#include "HiiDatabase.h"
#include "UefiIfrDefault.h"

Go to the source code of this file.

Data Structures

struct  FW_HII_FORMSET_TEMPLATE

Functions

EFI_STATUS EFIAPI HiiExportDatabase (IN EFI_HII_PROTOCOL *This, IN FRAMEWORK_EFI_HII_HANDLE Handle, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI HiiGetForms (IN EFI_HII_PROTOCOL *This, IN FRAMEWORK_EFI_HII_HANDLE Handle, IN EFI_FORM_ID FormId, IN OUT UINTN *BufferLengthTemp, OUT UINT8 *Buffer)
EFI_STATUS EFIAPI HiiGetDefaultImage (IN EFI_HII_PROTOCOL *This, IN FRAMEWORK_EFI_HII_HANDLE Handle, IN UINTN DefaultMask, OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList)
EFI_STATUS UpdateFormCallBack (IN EFI_HANDLE CallbackHandle, IN CONST HII_THUNK_CONTEXT *ThunkContext)
EFI_STATUS GetPackageData (IN EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList, IN UINT32 PackageIndex, OUT UINT32 *BufferLen, OUT EFI_HII_PACKAGE_HEADER **Buffer)
EFI_STATUS LocateLabel (IN CONST EFI_HII_PACKAGE_HEADER *Package, IN EFI_FORM_LABEL Label, OUT EFI_GUID *FormsetGuid, OUT EFI_FORM_ID *FormId)
EFI_STATUS LocateFormId (IN EFI_HII_HANDLE Handle, IN EFI_FORM_LABEL Label, OUT EFI_GUID *FormsetGuid, OUT EFI_FORM_ID *FormId)
EFI_STATUS EFIAPI HiiThunkUpdateForm (IN EFI_HII_PROTOCOL *This, IN FRAMEWORK_EFI_HII_HANDLE Handle, IN EFI_FORM_LABEL Label, IN BOOLEAN AddData, IN EFI_HII_UPDATE_DATA *Data)

Variables

FW_HII_FORMSET_TEMPLATE FormSetTemplate
EFI_GUID mTianoHiiIfrGuid = EFI_IFR_TIANO_GUID

Detailed Description

This file contains the form processing code to the HII database.

Copyright (c) 2006 - 2010, 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.

Definition in file Forms.c.


Function Documentation

EFI_STATUS GetPackageData ( IN EFI_HII_PACKAGE_LIST_HEADER HiiPackageList,
IN UINT32  PackageIndex,
OUT UINT32 BufferLen,
OUT EFI_HII_PACKAGE_HEADER **  Buffer 
)

Get the package data from the Package List.

Parameters:
HiiPackageListPackage List.
PackageIndexThe index of the Package in the Package List.
BufferLenThe Length of the Pacage data.
BufferOn output, the Package data.
Returns:
EFI_NOT_FOUND No Package is found for PackageIndex.
EFI_SUCCESS The package data is returned.

Definition at line 281 of file Forms.c.

EFI_STATUS EFIAPI HiiExportDatabase ( IN EFI_HII_PROTOCOL This,
IN FRAMEWORK_EFI_HII_HANDLE  Handle,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

This thunk module only handles UEFI HII packages. The caller of this function won't be able to parse the content. Therefore, it is not supported.

This function will ASSERT and return EFI_UNSUPPORTED.

Parameters:
ThisN.A.
HandleN.A.
BufferSizeN.A.
BufferN.A.
Return values:
EFI_UNSUPPORTED

Definition at line 76 of file Forms.c.

EFI_STATUS EFIAPI HiiGetDefaultImage ( IN EFI_HII_PROTOCOL This,
IN FRAMEWORK_EFI_HII_HANDLE  Handle,
IN UINTN  DefaultMask,
OUT EFI_HII_VARIABLE_PACK_LIST **  VariablePackList 
)

This function allows a program to extract the NV Image that represents the default storage image

Parameters:
ThisA pointer to the EFI_HII_PROTOCOL instance.
HandleThe HII handle from which will have default data retrieved. UINTN - Mask used to retrieve the default image.
DefaultMaskEDES_TODO: Add parameter description
VariablePackListCallee allocated, tightly-packed, link list data structure that contain all default varaible packs from the Hii Database.
Return values:
EFI_NOT_FOUNDIf Hii database does not contain any default images.
EFI_INVALID_PARAMETERInvalid input parameter.
EFI_SUCCESSOperation successful.

Definition at line 180 of file Forms.c.

EFI_STATUS EFIAPI HiiGetForms ( IN EFI_HII_PROTOCOL This,
IN FRAMEWORK_EFI_HII_HANDLE  Handle,
IN EFI_FORM_ID  FormId,
IN OUT UINTN BufferLengthTemp,
OUT UINT8 Buffer 
)

This function allows a program to extract a form or form package that has previously been registered with the EFI HII database.

In this thunk module, this function will create a IFR Package with only one Formset. Effectively, only the GUID of the Formset is updated and return in this IFR package to caller. This is enable the Framework modules which call a API named GetStringFromToken. GetStringFromToken retieves a String based on a String Token from a Package List known only by the Formset GUID.

Parameters:
ThisA pointer to the EFI_HII_PROTOCOL instance.
HandleHandle on which the form resides. Type FRAMEWORK_EFI_HII_HANDLE is defined in EFI_HII_PROTOCOL.NewPack() in the Packages section.
FormIdIgnored by this implementation.
BufferLengthTempOn input, the size of input buffer. On output, it is the size of FW_HII_FORMSET_TEMPLATE.
BufferThe buffer designed to receive the form(s).
Return values:
EFI_SUCCESSBuffer filled with the requested forms. BufferLength was updated.
EFI_INVALID_PARAMETERThe handle is unknown.
EFI_NOT_FOUNDA form on the requested handle cannot be found with the requested FormId.
EFI_BUFFER_TOO_SMALLThe buffer provided was not large enough to allow the form to be stored.

Definition at line 118 of file Forms.c.

EFI_STATUS EFIAPI HiiThunkUpdateForm ( IN EFI_HII_PROTOCOL This,
IN FRAMEWORK_EFI_HII_HANDLE  Handle,
IN EFI_FORM_LABEL  Label,
IN BOOLEAN  AddData,
IN EFI_HII_UPDATE_DATA Data 
)

This function allows the caller to update a form that has previously been registered with the EFI HII database.

Parameters:
ThisEDES_TODO: Add parameter description
HandleHii Handle associated with the Formset to modify
LabelUpdate information starting immediately after this label in the IFR
AddDataIf TRUE, add data. If FALSE, remove data
DataIf adding data, this is the pointer to the data to add
Return values:
EFI_SUCCESSUpdate success.
OtherUpdate fail.

Definition at line 489 of file Forms.c.

EFI_STATUS LocateFormId ( IN EFI_HII_HANDLE  Handle,
IN EFI_FORM_LABEL  Label,
OUT EFI_GUID FormsetGuid,
OUT EFI_FORM_ID FormId 
)

Find the first EFI_FORM_LABEL in FormSets for a given EFI_HII_HANLDE defined.

EFI_FORM_LABEL is a specific to Tiano implementation. The current implementation does not restrict labels with same label value to be duplicated in either FormSet scope or Form scope. This function will only locate the FIRST EFI_FORM_LABEL with value as the same as the input Label in the Formset registered with UefiHiiHandle. The FormSet GUID and Form ID is returned if such Label is found.

Parameters:
HandleUefi Hii Handle to be searched.
LabelThe first Label ID to be found.
FormsetGuidThe matched FormSet GUID.
FormIdThe matched Form ID.
Return values:
EFI_INVALID_PARAMETERIf UefiHiiHandle is not a valid handle.
EFI_NOT_FOUNDThe package list identified by UefiHiiHandle deos not contain FormSet or Form ID with value Label found in all Form Sets in the pacakge list.
EFI_SUCCESSThe first found Form ID is returned in FormId.

Definition at line 422 of file Forms.c.

EFI_STATUS LocateLabel ( IN CONST EFI_HII_PACKAGE_HEADER Package,
IN EFI_FORM_LABEL  Label,
OUT EFI_GUID FormsetGuid,
OUT EFI_FORM_ID FormId 
)

Check if Label exist in the IFR form package and return the FormSet GUID and Form ID.

Parameters:
PackageThe Package Header.
LabelThe Label ID.
FormsetGuidReturns the FormSet GUID.
FormIdReturns the Form ID.
Return values:
EFI_SUCCESSThe FORM ID is found.
EFI_NOT_FOUNDThe FORM ID is not found.

Definition at line 339 of file Forms.c.

EFI_STATUS UpdateFormCallBack ( IN EFI_HANDLE  CallbackHandle,
IN CONST HII_THUNK_CONTEXT ThunkContext 
)

This function update the FormCallbackProtocol cached in Config Access private context data.

Parameters:
CallbackHandleThe EFI Handle on which the Framework FormCallbackProtocol is installed.
ThunkContextThe Thunk Context.
Return values:
EFI_SUCCESSThe update is successful.
EFI_INVALID_PARAMETERIf no Framework FormCallbackProtocol is located on CallbackHandle.

Definition at line 227 of file Forms.c.


Variable Documentation

Initial value:
 {
  {
    sizeof (FW_HII_FORMSET_TEMPLATE),
    EFI_HII_IFR
  },
  {
    {
      FRAMEWORK_EFI_IFR_FORM_SET_OP,
      sizeof (FRAMEWORK_EFI_IFR_FORM_SET)
    },
    {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, 
    0,
    0,
    0,
    0,
    0,
    0
  },
  {
    {
      EFI_IFR_END_FORM_SET_OP,
      sizeof (EFI_IFR_END_FORM_SET)
    }
  }
}

Definition at line 30 of file Forms.c.

EFI_GUID mTianoHiiIfrGuid = EFI_IFR_TIANO_GUID

Definition at line 57 of file Forms.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines