Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

HiiConfigAccess.h 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /** @file
  2. The EFI HII results processing protocol invokes this type of protocol
  3. when it needs to forward results to a driver's configuration handler.
  4. This protocol is published by drivers providing and requesting
  5. configuration data from HII. It may only be invoked by HII.
  6. Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
  7. This program and the accompanying materials are licensed and made available under
  8. the terms and conditions of the BSD License that accompanies this distribution.
  9. The full text of the license may be found at
  10. http://opensource.org/licenses/bsd-license.php.
  11. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  13. **/
  14. #ifndef __EFI_HII_CONFIG_ACCESS_H__
  15. #define __EFI_HII_CONFIG_ACCESS_H__
  16. FILE_LICENCE ( BSD3 );
  17. #include <ipxe/efi/Protocol/FormBrowser2.h>
  18. #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
  19. { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
  20. typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;
  21. typedef UINTN EFI_BROWSER_ACTION;
  22. #define EFI_BROWSER_ACTION_CHANGING 0
  23. #define EFI_BROWSER_ACTION_CHANGED 1
  24. #define EFI_BROWSER_ACTION_RETRIEVE 2
  25. #define EFI_BROWSER_ACTION_FORM_OPEN 3
  26. #define EFI_BROWSER_ACTION_FORM_CLOSE 4
  27. #define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000
  28. #define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001
  29. #define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002
  30. #define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000
  31. #define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000
  32. #define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000
  33. /**
  34. This function allows the caller to request the current
  35. configuration for one or more named elements. The resulting
  36. string is in <ConfigAltResp> format. Any and all alternative
  37. configuration strings shall also be appended to the end of the
  38. current configuration string. If they are, they must appear
  39. after the current configuration. They must contain the same
  40. routing (GUID, NAME, PATH) as the current configuration string.
  41. They must have an additional description indicating the type of
  42. alternative configuration the string represents,
  43. "ALTCFG=<StringToken>". That <StringToken> (when
  44. converted from Hex UNICODE to binary) is a reference to a
  45. string in the associated string pack.
  46. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  47. @param Request A null-terminated Unicode string in
  48. <ConfigRequest> format. Note that this
  49. includes the routing information as well as
  50. the configurable name / value pairs. It is
  51. invalid for this string to be in
  52. <MultiConfigRequest> format.
  53. If a NULL is passed in for the Request field,
  54. all of the settings being abstracted by this function
  55. will be returned in the Results field. In addition,
  56. if a ConfigHdr is passed in with no request elements,
  57. all of the settings being abstracted for that particular
  58. ConfigHdr reference will be returned in the Results Field.
  59. @param Progress On return, points to a character in the
  60. Request string. Points to the string's null
  61. terminator if request was successful. Points
  62. to the most recent "&" before the first
  63. failing name / value pair (or the beginning
  64. of the string if the failure is in the first
  65. name / value pair) if the request was not
  66. successful.
  67. @param Results A null-terminated Unicode string in
  68. <MultiConfigAltResp> format which has all values
  69. filled in for the names in the Request string.
  70. String to be allocated by the called function.
  71. @retval EFI_SUCCESS The Results string is filled with the
  72. values corresponding to all requested
  73. names.
  74. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
  75. parts of the results that must be
  76. stored awaiting possible future
  77. protocols.
  78. @retval EFI_NOT_FOUND A configuration element matching
  79. the routing data is not found.
  80. Progress set to the first character
  81. in the routing header.
  82. @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
  83. to most recent "&" before the
  84. error or the beginning of the
  85. string.
  86. @retval EFI_INVALID_PARAMETER Unknown name. Progress points
  87. to the & before the name in
  88. question.
  89. **/
  90. typedef
  91. EFI_STATUS
  92. (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(
  93. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  94. IN CONST EFI_STRING Request,
  95. OUT EFI_STRING *Progress,
  96. OUT EFI_STRING *Results
  97. );
  98. /**
  99. This function applies changes in a driver's configuration.
  100. Input is a Configuration, which has the routing data for this
  101. driver followed by name / value configuration pairs. The driver
  102. must apply those pairs to its configurable storage. If the
  103. driver's configuration is stored in a linear block of data
  104. and the driver's name / value pairs are in <BlockConfig>
  105. format, it may use the ConfigToBlock helper function (above) to
  106. simplify the job.
  107. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  108. @param Configuration A null-terminated Unicode string in
  109. <ConfigString> format.
  110. @param Progress A pointer to a string filled in with the
  111. offset of the most recent '&' before the
  112. first failing name / value pair (or the
  113. beginn ing of the string if the failure
  114. is in the first name / value pair) or
  115. the terminating NULL if all was
  116. successful.
  117. @retval EFI_SUCCESS The results have been distributed or are
  118. awaiting distribution.
  119. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
  120. parts of the results that must be
  121. stored awaiting possible future
  122. protocols.
  123. @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
  124. Results parameter would result
  125. in this type of error.
  126. @retval EFI_NOT_FOUND Target for the specified routing data
  127. was not found
  128. **/
  129. typedef
  130. EFI_STATUS
  131. (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(
  132. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  133. IN CONST EFI_STRING Configuration,
  134. OUT EFI_STRING *Progress
  135. );
  136. /**
  137. This function is called to provide results data to the driver.
  138. This data consists of a unique key that is used to identify
  139. which data is either being passed back or being asked for.
  140. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  141. @param Action Specifies the type of action taken by the browser.
  142. @param QuestionId A unique value which is sent to the original
  143. exporting driver so that it can identify the type
  144. of data to expect. The format of the data tends to
  145. vary based on the opcode that generated the callback.
  146. @param Type The type of value for the question.
  147. @param Value A pointer to the data being sent to the original
  148. exporting driver.
  149. @param ActionRequest On return, points to the action requested by the
  150. callback function.
  151. @retval EFI_SUCCESS The callback successfully handled the action.
  152. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
  153. variable and its data.
  154. @retval EFI_DEVICE_ERROR The variable could not be saved.
  155. @retval EFI_UNSUPPORTED The specified Action is not supported by the
  156. callback.
  157. **/
  158. typedef
  159. EFI_STATUS
  160. (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(
  161. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  162. IN EFI_BROWSER_ACTION Action,
  163. IN EFI_QUESTION_ID QuestionId,
  164. IN UINT8 Type,
  165. IN OUT EFI_IFR_TYPE_VALUE *Value,
  166. OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
  167. )
  168. ;
  169. ///
  170. /// This protocol provides a callable interface between the HII and
  171. /// drivers. Only drivers which provide IFR data to HII are required
  172. /// to publish this protocol.
  173. ///
  174. struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
  175. EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
  176. EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
  177. EFI_HII_ACCESS_FORM_CALLBACK Callback;
  178. } ;
  179. extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
  180. #endif