HttpBootDxe.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /** @file
  2. UEFI HTTP boot driver's private data structure and interfaces declaration.
  3. Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
  4. (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef __EFI_HTTP_BOOT_DXE_H__
  8. #define __EFI_HTTP_BOOT_DXE_H__
  9. #include <Uefi.h>
  10. #include <IndustryStandard/Http11.h>
  11. #include <IndustryStandard/Dhcp.h>
  12. //
  13. // Libraries
  14. //
  15. #include <Library/UefiBootServicesTableLib.h>
  16. #include <Library/UefiHiiServicesLib.h>
  17. #include <Library/UefiRuntimeServicesTableLib.h>
  18. #include <Library/MemoryAllocationLib.h>
  19. #include <Library/BaseLib.h>
  20. #include <Library/UefiLib.h>
  21. #include <Library/DevicePathLib.h>
  22. #include <Library/DebugLib.h>
  23. #include <Library/NetLib.h>
  24. #include <Library/HttpLib.h>
  25. #include <Library/HttpIoLib.h>
  26. #include <Library/HiiLib.h>
  27. #include <Library/PrintLib.h>
  28. #include <Library/DpcLib.h>
  29. //
  30. // UEFI Driver Model Protocols
  31. //
  32. #include <Protocol/DriverBinding.h>
  33. #include <Protocol/ComponentName2.h>
  34. #include <Protocol/ComponentName.h>
  35. //
  36. // Consumed Protocols
  37. //
  38. #include <Protocol/ServiceBinding.h>
  39. #include <Protocol/HiiConfigAccess.h>
  40. #include <Protocol/NetworkInterfaceIdentifier.h>
  41. #include <Protocol/Dhcp4.h>
  42. #include <Protocol/Dhcp6.h>
  43. #include <Protocol/Dns6.h>
  44. #include <Protocol/Http.h>
  45. #include <Protocol/Ip4Config2.h>
  46. #include <Protocol/Ip6Config.h>
  47. #include <Protocol/RamDisk.h>
  48. #include <Protocol/AdapterInformation.h>
  49. //
  50. // Produced Protocols
  51. //
  52. #include <Protocol/LoadFile.h>
  53. #include <Protocol/HttpBootCallback.h>
  54. //
  55. // Consumed Guids
  56. //
  57. #include <Guid/HttpBootConfigHii.h>
  58. //
  59. // Driver Version
  60. //
  61. #define HTTP_BOOT_DXE_VERSION 0xa
  62. //
  63. // Standard Media Types defined in
  64. // http://www.iana.org/assignments/media-types
  65. //
  66. #define HTTP_CONTENT_TYPE_APP_EFI "application/efi"
  67. #define HTTP_CONTENT_TYPE_APP_IMG "application/vnd.efi-img"
  68. #define HTTP_CONTENT_TYPE_APP_ISO "application/vnd.efi-iso"
  69. //
  70. // Protocol instances
  71. //
  72. extern EFI_DRIVER_BINDING_PROTOCOL gHttpBootDxeDriverBinding;
  73. extern EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2;
  74. extern EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName;
  75. //
  76. // Private data structure
  77. //
  78. typedef struct _HTTP_BOOT_PRIVATE_DATA HTTP_BOOT_PRIVATE_DATA;
  79. typedef struct _HTTP_BOOT_VIRTUAL_NIC HTTP_BOOT_VIRTUAL_NIC;
  80. typedef enum {
  81. ImageTypeEfi,
  82. ImageTypeVirtualCd,
  83. ImageTypeVirtualDisk,
  84. ImageTypeMax
  85. } HTTP_BOOT_IMAGE_TYPE;
  86. //
  87. // Include files with internal function prototypes
  88. //
  89. #include "HttpBootComponentName.h"
  90. #include "HttpBootDhcp4.h"
  91. #include "HttpBootDhcp6.h"
  92. #include "HttpBootImpl.h"
  93. #include "HttpBootSupport.h"
  94. #include "HttpBootClient.h"
  95. #include "HttpBootConfig.h"
  96. typedef union {
  97. HTTP_BOOT_DHCP4_PACKET_CACHE Dhcp4;
  98. HTTP_BOOT_DHCP6_PACKET_CACHE Dhcp6;
  99. } HTTP_BOOT_DHCP_PACKET_CACHE;
  100. struct _HTTP_BOOT_VIRTUAL_NIC {
  101. UINT32 Signature;
  102. EFI_HANDLE Controller;
  103. EFI_HANDLE ImageHandle;
  104. EFI_LOAD_FILE_PROTOCOL LoadFile;
  105. EFI_DEVICE_PATH_PROTOCOL *DevicePath;
  106. HTTP_BOOT_PRIVATE_DATA *Private;
  107. };
  108. #define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO(Callback) \
  109. CR ( \
  110. Callback, \
  111. HTTP_BOOT_PRIVATE_DATA, \
  112. CallbackInfo, \
  113. HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
  114. )
  115. #define HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_PROTOCOL(CallbackProtocol) \
  116. CR ( \
  117. CallbackProtocol, \
  118. HTTP_BOOT_PRIVATE_DATA, \
  119. LoadFileCallback, \
  120. HTTP_BOOT_PRIVATE_DATA_SIGNATURE \
  121. )
  122. struct _HTTP_BOOT_PRIVATE_DATA {
  123. UINT32 Signature;
  124. EFI_HANDLE Controller;
  125. HTTP_BOOT_VIRTUAL_NIC *Ip4Nic;
  126. HTTP_BOOT_VIRTUAL_NIC *Ip6Nic;
  127. //
  128. // Consumed children
  129. //
  130. EFI_HANDLE Ip6Child;
  131. EFI_HANDLE Dhcp4Child;
  132. EFI_HANDLE Dhcp6Child;
  133. HTTP_IO HttpIo;
  134. BOOLEAN HttpCreated;
  135. //
  136. // Consumed protocol
  137. //
  138. EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;
  139. EFI_IP6_PROTOCOL *Ip6;
  140. EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
  141. EFI_IP6_CONFIG_PROTOCOL *Ip6Config;
  142. EFI_DHCP4_PROTOCOL *Dhcp4;
  143. EFI_DHCP6_PROTOCOL *Dhcp6;
  144. EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
  145. //
  146. // Produced protocol
  147. //
  148. EFI_LOAD_FILE_PROTOCOL LoadFile;
  149. EFI_DEVICE_PATH_PROTOCOL *DevicePath;
  150. UINT32 Id;
  151. EFI_HTTP_BOOT_CALLBACK_PROTOCOL *HttpBootCallback;
  152. EFI_HTTP_BOOT_CALLBACK_PROTOCOL LoadFileCallback;
  153. //
  154. // Data for the default HTTP Boot callback protocol
  155. //
  156. UINT64 FileSize;
  157. UINT64 ReceivedSize;
  158. UINT32 Percentage;
  159. //
  160. // Data for the server to authenticate the client
  161. //
  162. CHAR8 *AuthData;
  163. CHAR8 *AuthScheme;
  164. //
  165. // HII callback info block
  166. //
  167. HTTP_BOOT_FORM_CALLBACK_INFO CallbackInfo;
  168. //
  169. // Mode data
  170. //
  171. BOOLEAN UsingIpv6;
  172. BOOLEAN Started;
  173. EFI_IP_ADDRESS StationIp;
  174. EFI_IP_ADDRESS SubnetMask;
  175. EFI_IP_ADDRESS GatewayIp;
  176. EFI_IP_ADDRESS ServerIp;
  177. UINT16 Port;
  178. UINT32 DnsServerCount;
  179. EFI_IP_ADDRESS *DnsServerIp;
  180. //
  181. // The URI string attempt to download through HTTP, may point to
  182. // the memory in cached DHCP offer, or to the memory in FilePathUri.
  183. //
  184. CHAR8 *BootFileUri;
  185. VOID *BootFileUriParser;
  186. UINTN BootFileSize;
  187. BOOLEAN NoGateway;
  188. HTTP_BOOT_IMAGE_TYPE ImageType;
  189. //
  190. // URI string extracted from the input FilePath parameter.
  191. //
  192. CHAR8 *FilePathUri;
  193. VOID *FilePathUriParser;
  194. //
  195. // Cached HTTP data
  196. //
  197. LIST_ENTRY CacheList;
  198. //
  199. // Cached DHCP offer
  200. //
  201. // OfferIndex records the index of DhcpOffer[] buffer, and OfferCount records the num of each type of offer.
  202. //
  203. // It supposed that
  204. //
  205. // OfferNum: 8
  206. // OfferBuffer: [ProxyNameUri, DhcpNameUri, DhcpIpUri, ProxyNameUri, ProxyIpUri, DhcpOnly, DhcpIpUri, DhcpNameUriDns]
  207. // (OfferBuffer is 0-based.)
  208. //
  209. // And assume that (DhcpIpUri is the first priority actually.)
  210. //
  211. // SelectIndex: 5
  212. // SelectProxyType: HttpOfferTypeProxyIpUri
  213. // (SelectIndex is 1-based, and 0 means no one is selected.)
  214. //
  215. // So it should be
  216. //
  217. // DhcpIpUri DhcpNameUriDns DhcpDns DhcpOnly ProxyNameUri ProxyIpUri DhcpNameUri
  218. // OfferCount: [ 2, 1, 0, 1, 2, 1, 1]
  219. //
  220. // OfferIndex: {[ 2, 7, 0, 5, 0, *4, 1]
  221. // [ 6, 0, 0, 0, 3, 0, 0]
  222. // [ 0, 0, 0, 0, 0, 0, 0]
  223. // ... ]}
  224. // (OfferIndex is 0-based.)
  225. //
  226. //
  227. UINT32 SelectIndex;
  228. UINT32 SelectProxyType;
  229. HTTP_BOOT_DHCP_PACKET_CACHE OfferBuffer[HTTP_BOOT_OFFER_MAX_NUM];
  230. UINT32 OfferNum;
  231. UINT32 OfferCount[HttpOfferTypeMax];
  232. UINT32 OfferIndex[HttpOfferTypeMax][HTTP_BOOT_OFFER_MAX_NUM];
  233. };
  234. #define HTTP_BOOT_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'B', 'P', 'D')
  235. #define HTTP_BOOT_VIRTUAL_NIC_SIGNATURE SIGNATURE_32 ('H', 'B', 'V', 'N')
  236. #define HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE(a) CR (a, HTTP_BOOT_PRIVATE_DATA, LoadFile, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)
  237. #define HTTP_BOOT_PRIVATE_DATA_FROM_ID(a) CR (a, HTTP_BOOT_PRIVATE_DATA, Id, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)
  238. #define HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, HTTP_BOOT_VIRTUAL_NIC, LoadFile, HTTP_BOOT_VIRTUAL_NIC_SIGNATURE)
  239. extern EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile;
  240. /**
  241. Tests to see if this driver supports a given controller. If a child device is provided,
  242. it further tests to see if this driver supports creating a handle for the specified child device.
  243. This function checks to see if the driver specified by This supports the device specified by
  244. ControllerHandle. Drivers will typically use the device path attached to
  245. ControllerHandle and/or the services from the bus I/O abstraction attached to
  246. ControllerHandle to determine if the driver supports ControllerHandle. This function
  247. may be called many times during platform initialization. In order to reduce boot times, the tests
  248. performed by this function must be very small, and take as little time as possible to execute. This
  249. function must not change the state of any hardware devices, and this function must be aware that the
  250. device specified by ControllerHandle may already be managed by the same driver or a
  251. different driver. This function must match its calls to AllocatePages() with FreePages(),
  252. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  253. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  254. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  255. to guarantee the state of ControllerHandle is not modified by this function.
  256. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  257. @param[in] ControllerHandle The handle of the controller to test. This handle
  258. must support a protocol interface that supplies
  259. an I/O abstraction to the driver.
  260. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  261. parameter is ignored by device drivers, and is optional for bus
  262. drivers. For bus drivers, if this parameter is not NULL, then
  263. the bus driver must determine if the bus controller specified
  264. by ControllerHandle and the child controller specified
  265. by RemainingDevicePath are both supported by this
  266. bus driver.
  267. @retval EFI_SUCCESS The device specified by ControllerHandle and
  268. RemainingDevicePath is supported by the driver specified by This.
  269. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  270. RemainingDevicePath is already being managed by the driver
  271. specified by This.
  272. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  273. RemainingDevicePath is already being managed by a different
  274. driver or an application that requires exclusive access.
  275. Currently not implemented.
  276. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  277. RemainingDevicePath is not supported by the driver specified by This.
  278. **/
  279. EFI_STATUS
  280. EFIAPI
  281. HttpBootIp4DxeDriverBindingSupported (
  282. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  283. IN EFI_HANDLE ControllerHandle,
  284. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  285. );
  286. /**
  287. Starts a device controller or a bus controller.
  288. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  289. As a result, much of the error checking on the parameters to Start() has been moved into this
  290. common boot service. It is legal to call Start() from other locations,
  291. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  292. 1. ControllerHandle must be a valid EFI_HANDLE.
  293. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  294. EFI_DEVICE_PATH_PROTOCOL.
  295. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  296. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  297. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  298. @param[in] ControllerHandle The handle of the controller to start. This handle
  299. must support a protocol interface that supplies
  300. an I/O abstraction to the driver.
  301. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  302. parameter is ignored by device drivers, and is optional for bus
  303. drivers. For a bus driver, if this parameter is NULL, then handles
  304. for all the children of Controller are created by this driver.
  305. If this parameter is not NULL and the first Device Path Node is
  306. not the End of Device Path Node, then only the handle for the
  307. child device specified by the first Device Path Node of
  308. RemainingDevicePath is created by this driver.
  309. If the first Device Path Node of RemainingDevicePath is
  310. the End of Device Path Node, no child handle is created by this
  311. driver.
  312. @retval EFI_SUCCESS The device was started.
  313. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  314. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  315. @retval Others The driver failed to start the device.
  316. **/
  317. EFI_STATUS
  318. EFIAPI
  319. HttpBootIp4DxeDriverBindingStart (
  320. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  321. IN EFI_HANDLE ControllerHandle,
  322. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  323. );
  324. /**
  325. Stops a device controller or a bus controller.
  326. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  327. As a result, much of the error checking on the parameters to Stop() has been moved
  328. into this common boot service. It is legal to call Stop() from other locations,
  329. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  330. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  331. same driver's Start() function.
  332. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  333. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  334. Start() function, and the Start() function must have called OpenProtocol() on
  335. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  336. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  337. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  338. support a bus specific I/O protocol for the driver
  339. to use to stop the device.
  340. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  341. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  342. if NumberOfChildren is 0.
  343. @retval EFI_SUCCESS The device was stopped.
  344. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  345. **/
  346. EFI_STATUS
  347. EFIAPI
  348. HttpBootIp4DxeDriverBindingStop (
  349. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  350. IN EFI_HANDLE ControllerHandle,
  351. IN UINTN NumberOfChildren,
  352. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  353. );
  354. /**
  355. Tests to see if this driver supports a given controller. If a child device is provided,
  356. it further tests to see if this driver supports creating a handle for the specified child device.
  357. This function checks to see if the driver specified by This supports the device specified by
  358. ControllerHandle. Drivers will typically use the device path attached to
  359. ControllerHandle and/or the services from the bus I/O abstraction attached to
  360. ControllerHandle to determine if the driver supports ControllerHandle. This function
  361. may be called many times during platform initialization. In order to reduce boot times, the tests
  362. performed by this function must be very small, and take as little time as possible to execute. This
  363. function must not change the state of any hardware devices, and this function must be aware that the
  364. device specified by ControllerHandle may already be managed by the same driver or a
  365. different driver. This function must match its calls to AllocatePages() with FreePages(),
  366. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  367. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  368. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  369. to guarantee the state of ControllerHandle is not modified by this function.
  370. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  371. @param[in] ControllerHandle The handle of the controller to test. This handle
  372. must support a protocol interface that supplies
  373. an I/O abstraction to the driver.
  374. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  375. parameter is ignored by device drivers, and is optional for bus
  376. drivers. For bus drivers, if this parameter is not NULL, then
  377. the bus driver must determine if the bus controller specified
  378. by ControllerHandle and the child controller specified
  379. by RemainingDevicePath are both supported by this
  380. bus driver.
  381. @retval EFI_SUCCESS The device specified by ControllerHandle and
  382. RemainingDevicePath is supported by the driver specified by This.
  383. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  384. RemainingDevicePath is already being managed by the driver
  385. specified by This.
  386. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  387. RemainingDevicePath is already being managed by a different
  388. driver or an application that requires exclusive access.
  389. Currently not implemented.
  390. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  391. RemainingDevicePath is not supported by the driver specified by This.
  392. **/
  393. EFI_STATUS
  394. EFIAPI
  395. HttpBootIp6DxeDriverBindingSupported (
  396. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  397. IN EFI_HANDLE ControllerHandle,
  398. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  399. );
  400. /**
  401. Starts a device controller or a bus controller.
  402. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  403. As a result, much of the error checking on the parameters to Start() has been moved into this
  404. common boot service. It is legal to call Start() from other locations,
  405. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  406. 1. ControllerHandle must be a valid EFI_HANDLE.
  407. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  408. EFI_DEVICE_PATH_PROTOCOL.
  409. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  410. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  411. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  412. @param[in] ControllerHandle The handle of the controller to start. This handle
  413. must support a protocol interface that supplies
  414. an I/O abstraction to the driver.
  415. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  416. parameter is ignored by device drivers, and is optional for bus
  417. drivers. For a bus driver, if this parameter is NULL, then handles
  418. for all the children of Controller are created by this driver.
  419. If this parameter is not NULL and the first Device Path Node is
  420. not the End of Device Path Node, then only the handle for the
  421. child device specified by the first Device Path Node of
  422. RemainingDevicePath is created by this driver.
  423. If the first Device Path Node of RemainingDevicePath is
  424. the End of Device Path Node, no child handle is created by this
  425. driver.
  426. @retval EFI_SUCCESS The device was started.
  427. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  428. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  429. @retval Others The driver failed to start the device.
  430. **/
  431. EFI_STATUS
  432. EFIAPI
  433. HttpBootIp6DxeDriverBindingStart (
  434. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  435. IN EFI_HANDLE ControllerHandle,
  436. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  437. );
  438. /**
  439. Stops a device controller or a bus controller.
  440. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  441. As a result, much of the error checking on the parameters to Stop() has been moved
  442. into this common boot service. It is legal to call Stop() from other locations,
  443. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  444. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  445. same driver's Start() function.
  446. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  447. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  448. Start() function, and the Start() function must have called OpenProtocol() on
  449. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  450. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  451. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  452. support a bus specific I/O protocol for the driver
  453. to use to stop the device.
  454. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  455. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  456. if NumberOfChildren is 0.
  457. @retval EFI_SUCCESS The device was stopped.
  458. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  459. **/
  460. EFI_STATUS
  461. EFIAPI
  462. HttpBootIp6DxeDriverBindingStop (
  463. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  464. IN EFI_HANDLE ControllerHandle,
  465. IN UINTN NumberOfChildren,
  466. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  467. );
  468. #endif