Home | History | Annotate | Download | only in HiiConfigAccess
      1 /*++
      2 
      3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14   HiiConfigAccess.h
     15 
     16 Abstract:
     17 
     18   EFI_HII_CONFIG_ACCESS_PROTOCOL as defined in UEFI 2.1 spec.
     19 
     20 --*/
     21 
     22 #ifndef _HII_CONFIG_ACCESS_H_
     23 #define _HII_CONFIG_ACCESS_H_
     24 
     25 #include EFI_PROTOCOL_DEFINITION (FormBrowser2)
     26 
     27 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
     28   { \
     29     0x330d4706, 0xf2a0, 0x4e4f, {0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85} \
     30   }
     31 
     32 //
     33 // Forward reference for pure ANSI compatability
     34 //
     35 EFI_FORWARD_DECLARATION (EFI_HII_CONFIG_ACCESS_PROTOCOL);
     36 
     37 typedef UINTN EFI_BROWSER_ACTION;
     38 
     39 #define EFI_BROWSER_ACTION_CHANGING 0
     40 #define EFI_BROWSER_ACTION_CHANGED  1
     41 
     42 
     43 typedef
     44 EFI_STATUS
     45 (EFIAPI *EFI_HII_ACCESS_EXTRACT_CONFIG) (
     46   IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
     47   IN  CONST EFI_STRING                       Request,
     48   OUT EFI_STRING                             *Progress,
     49   OUT EFI_STRING                             *Results
     50   )
     51 /*++
     52 
     53   Routine Description:
     54     This function allows a caller to extract the current configuration for one
     55     or more named elements from the target driver.
     56 
     57   Arguments:
     58     This       - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
     59     Request    - A null-terminated Unicode string in <ConfigRequest> format.
     60     Progress   - On return, points to a character in the Request string.
     61                  Points to the string's null terminator if request was successful.
     62                  Points to the most recent '&' before the first failing name/value
     63                  pair (or the beginning of the string if the failure is in the
     64                  first name/value pair) if the request was not successful.
     65     Results    - A null-terminated Unicode string in <ConfigAltResp> format which
     66                  has all values filled in for the names in the Request string.
     67                  String to be allocated by the called function.
     68 
     69   Returns:
     70     EFI_SUCCESS           - The Results is filled with the requested values.
     71     EFI_OUT_OF_RESOURCES  - Not enough memory to store the results.
     72     EFI_INVALID_PARAMETER - Request is NULL, illegal syntax, or unknown name.
     73     EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.
     74 
     75 --*/
     76 ;
     77 
     78 typedef
     79 EFI_STATUS
     80 (EFIAPI *EFI_HII_ACCESS_ROUTE_CONFIG) (
     81   IN  EFI_HII_CONFIG_ACCESS_PROTOCOL         *This,
     82   IN  CONST EFI_STRING                       Configuration,
     83   OUT EFI_STRING                             *Progress
     84   )
     85 /*++
     86 
     87   Routine Description:
     88     This function processes the results of changes in configuration.
     89 
     90   Arguments:
     91     This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
     92     Configuration - A null-terminated Unicode string in <ConfigResp> format.
     93     Progress      - A pointer to a string filled in with the offset of the most
     94                     recent '&' before the first failing name/value pair (or the
     95                     beginning of the string if the failure is in the first
     96                     name/value pair) or the terminating NULL if all was successful.
     97 
     98   Returns:
     99     EFI_SUCCESS           - The Results is processed successfully.
    100     EFI_INVALID_PARAMETER - Configuration is NULL.
    101     EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.
    102 
    103 --*/
    104 ;
    105 
    106 typedef
    107 EFI_STATUS
    108 (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK) (
    109   IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
    110   IN  EFI_BROWSER_ACTION                     Action,
    111   IN  EFI_QUESTION_ID                        QuestionId,
    112   IN  UINT8                                  Type,
    113   IN  EFI_IFR_TYPE_VALUE                     *Value,
    114   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
    115   )
    116 /*++
    117 
    118   Routine Description:
    119     This function processes the results of changes in configuration.
    120 
    121   Arguments:
    122     This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
    123     Action        - Specifies the type of action taken by the browser.
    124     QuestionId    - A unique value which is sent to the original exporting driver
    125                     so that it can identify the type of data to expect.
    126     Type          - The type of value for the question.
    127     Value         - A pointer to the data being sent to the original exporting driver.
    128     ActionRequest - On return, points to the action requested by the callback function.
    129 
    130   Returns:
    131     EFI_SUCCESS          - The callback successfully handled the action.
    132     EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the variable and its data.
    133     EFI_DEVICE_ERROR     - The variable could not be saved.
    134     EFI_UNSUPPORTED      - The specified Action is not supported by the callback.
    135 
    136 --*/
    137 ;
    138 
    139 struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
    140   EFI_HII_ACCESS_EXTRACT_CONFIG     ExtractConfig;
    141   EFI_HII_ACCESS_ROUTE_CONFIG       RouteConfig;
    142   EFI_HII_ACCESS_FORM_CALLBACK      Callback;
    143 };
    144 
    145 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
    146 
    147 #endif
    148