WifiConnectionMgrHiiConfigAccess.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /** @file
  2. The Hii functions for WiFi Connection Manager.
  3. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_WIFI_MGR_HII_CONFIG_ACCESS__
  7. #define __EFI_WIFI_MGR_HII_CONFIG_ACCESS__
  8. /**
  9. Update connection message on connect configuration page, and trigger related form refresh.
  10. @param[in] Nic The related Nic for updating message.
  11. @param[in] ConnectStateChanged The tag to tell if the connection state has been changed, only
  12. when the connection changes from "Connected" or "Disconnecting"
  13. to "Disconnected", or from "Disconnected" or "Connecting" to
  14. "Connected", this tag can be set as TRUE.
  15. @param[in] ConnectStatusMessage The message to show on connected status bar, if NULL, will
  16. use default message.
  17. **/
  18. VOID
  19. WifiMgrUpdateConnectMessage (
  20. IN WIFI_MGR_DEVICE_DATA *Nic,
  21. IN BOOLEAN ConnectStateChanged,
  22. IN EFI_STRING ConnectStatusMessage
  23. );
  24. /**
  25. This function allows the caller to request the current
  26. configuration for one or more named elements. The resulting
  27. string is in <ConfigAltResp> format. Any and all alternative
  28. configuration strings shall also be appended to the end of the
  29. current configuration string. If they are, they must appear
  30. after the current configuration. They must contain the same
  31. routing (GUID, NAME, PATH) as the current configuration string.
  32. They must have an additional description indicating the type of
  33. alternative configuration the string represents,
  34. "ALTCFG=<StringToken>". That <StringToken> (when
  35. converted from Hex UNICODE to binary) is a reference to a
  36. string in the associated string pack.
  37. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  38. @param Request A null-terminated Unicode string in
  39. <ConfigRequest> format. Note that this
  40. includes the routing information as well as
  41. the configurable name / value pairs. It is
  42. invalid for this string to be in
  43. <MultiConfigRequest> format.
  44. If a NULL is passed in for the Request field,
  45. all of the settings being abstracted by this function
  46. will be returned in the Results field. In addition,
  47. if a ConfigHdr is passed in with no request elements,
  48. all of the settings being abstracted for that particular
  49. ConfigHdr reference will be returned in the Results Field.
  50. @param Progress On return, points to a character in the
  51. Request string. Points to the string's null
  52. terminator if request was successful. Points
  53. to the most recent "&" before the first
  54. failing name / value pair (or the beginning
  55. of the string if the failure is in the first
  56. name / value pair) if the request was not
  57. successful.
  58. @param Results A null-terminated Unicode string in
  59. <MultiConfigAltResp> format which has all values
  60. filled in for the names in the Request string.
  61. String to be allocated by the called function.
  62. @retval EFI_SUCCESS The Results string is filled with the
  63. values corresponding to all requested
  64. names.
  65. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
  66. parts of the results that must be
  67. stored awaiting possible future
  68. protocols.
  69. @retval EFI_NOT_FOUND Routing data doesn't match any
  70. known driver. Progress set to the
  71. first character in the routing header.
  72. Note: There is no requirement that the
  73. driver validate the routing data. It
  74. must skip the <ConfigHdr> in order to
  75. process the names.
  76. @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
  77. to most recent "&" before the
  78. error or the beginning of the
  79. string.
  80. @retval EFI_INVALID_PARAMETER Unknown name. Progress points
  81. to the & before the name in
  82. question.
  83. **/
  84. EFI_STATUS
  85. EFIAPI
  86. WifiMgrDxeHiiConfigAccessExtractConfig (
  87. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  88. IN CONST EFI_STRING Request,
  89. OUT EFI_STRING *Progress,
  90. OUT EFI_STRING *Results
  91. );
  92. /**
  93. This function applies changes in a driver's configuration.
  94. Input is a Configuration, which has the routing data for this
  95. driver followed by name / value configuration pairs. The driver
  96. must apply those pairs to its configurable storage. If the
  97. driver's configuration is stored in a linear block of data
  98. and the driver's name / value pairs are in <BlockConfig>
  99. format, it may use the ConfigToBlock helper function (above) to
  100. simplify the job.
  101. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  102. @param Configuration A null-terminated Unicode string in
  103. <ConfigString> format.
  104. @param Progress A pointer to a string filled in with the
  105. offset of the most recent '&' before the
  106. first failing name / value pair (or the
  107. beginn ing of the string if the failure
  108. is in the first name / value pair) or
  109. the terminating NULL if all was
  110. successful.
  111. @retval EFI_SUCCESS The results have been distributed or are
  112. awaiting distribution.
  113. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
  114. parts of the results that must be
  115. stored awaiting possible future
  116. protocols.
  117. @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
  118. Results parameter would result
  119. in this type of error.
  120. @retval EFI_NOT_FOUND Target for the specified routing data
  121. was not found
  122. **/
  123. EFI_STATUS
  124. EFIAPI
  125. WifiMgrDxeHiiConfigAccessRouteConfig (
  126. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  127. IN CONST EFI_STRING Configuration,
  128. OUT EFI_STRING *Progress
  129. );
  130. /**
  131. This function is called to provide results data to the driver.
  132. This data consists of a unique key that is used to identify
  133. which data is either being passed back or being asked for.
  134. @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  135. @param Action Specifies the type of action taken by the browser.
  136. @param QuestionId A unique value which is sent to the original
  137. exporting driver so that it can identify the type
  138. of data to expect. The format of the data tends to
  139. vary based on the opcode that generated the callback.
  140. @param Type The type of value for the question.
  141. @param Value A pointer to the data being sent to the original
  142. exporting driver.
  143. @param ActionRequest On return, points to the action requested by the
  144. callback function.
  145. @retval EFI_SUCCESS The callback successfully handled the action.
  146. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
  147. variable and its data.
  148. @retval EFI_DEVICE_ERROR The variable could not be saved.
  149. @retval EFI_UNSUPPORTED The specified Action is not supported by the
  150. callback.
  151. **/
  152. EFI_STATUS
  153. EFIAPI
  154. WifiMgrDxeHiiConfigAccessCallback (
  155. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  156. IN EFI_BROWSER_ACTION Action,
  157. IN EFI_QUESTION_ID QuestionId,
  158. IN UINT8 Type,
  159. IN OUT EFI_IFR_TYPE_VALUE *Value,
  160. OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
  161. );
  162. /**
  163. Initialize the WiFi configuration form.
  164. @param[in] Private The pointer to the global private data structure.
  165. @retval EFI_SUCCESS The configuration form is initialized.
  166. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  167. @retval Other Erros Returned errors when installing protocols.
  168. **/
  169. EFI_STATUS
  170. WifiMgrDxeConfigFormInit (
  171. WIFI_MGR_PRIVATE_DATA *Private
  172. );
  173. /**
  174. Unload the WiFi configuration form.
  175. @param[in] Private The pointer to the global private data structure.
  176. @retval EFI_SUCCESS The configuration form is unloaded successfully.
  177. @retval Other Errors Returned Erros when uninstalling protocols.
  178. **/
  179. EFI_STATUS
  180. WifiMgrDxeConfigFormUnload (
  181. WIFI_MGR_PRIVATE_DATA *Private
  182. );
  183. /**
  184. Refresh the network list display of the current Nic.
  185. @param[in] Private The pointer to the global private data structure.
  186. @param[out] IfrNvData The IFR NV data.
  187. @retval EFI_SUCCESS The operation is completed successfully.
  188. @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
  189. @retval Other Errors Returned errors when creating Opcodes or updating the
  190. Hii form.
  191. **/
  192. EFI_STATUS
  193. WifiMgrRefreshNetworkList (
  194. IN WIFI_MGR_PRIVATE_DATA *Private,
  195. OUT WIFI_MANAGER_IFR_NVDATA *IfrNvData
  196. );
  197. #endif