HttpBootDxe.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  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. // HII callback info block
  161. //
  162. HTTP_BOOT_FORM_CALLBACK_INFO CallbackInfo;
  163. //
  164. // Mode data
  165. //
  166. BOOLEAN UsingIpv6;
  167. BOOLEAN Started;
  168. EFI_IP_ADDRESS StationIp;
  169. EFI_IP_ADDRESS SubnetMask;
  170. EFI_IP_ADDRESS GatewayIp;
  171. EFI_IP_ADDRESS ServerIp;
  172. UINT16 Port;
  173. UINT32 DnsServerCount;
  174. EFI_IP_ADDRESS *DnsServerIp;
  175. //
  176. // The URI string attempt to download through HTTP, may point to
  177. // the memory in cached DHCP offer, or to the memory in FilePathUri.
  178. //
  179. CHAR8 *BootFileUri;
  180. VOID *BootFileUriParser;
  181. UINTN BootFileSize;
  182. BOOLEAN NoGateway;
  183. HTTP_BOOT_IMAGE_TYPE ImageType;
  184. //
  185. // URI string extracted from the input FilePath parameter.
  186. //
  187. CHAR8 *FilePathUri;
  188. VOID *FilePathUriParser;
  189. //
  190. // Cached HTTP data
  191. //
  192. LIST_ENTRY CacheList;
  193. //
  194. // Cached DHCP offer
  195. //
  196. // OfferIndex records the index of DhcpOffer[] buffer, and OfferCount records the num of each type of offer.
  197. //
  198. // It supposed that
  199. //
  200. // OfferNum: 8
  201. // OfferBuffer: [ProxyNameUri, DhcpNameUri, DhcpIpUri, ProxyNameUri, ProxyIpUri, DhcpOnly, DhcpIpUri, DhcpNameUriDns]
  202. // (OfferBuffer is 0-based.)
  203. //
  204. // And assume that (DhcpIpUri is the first priority actually.)
  205. //
  206. // SelectIndex: 5
  207. // SelectProxyType: HttpOfferTypeProxyIpUri
  208. // (SelectIndex is 1-based, and 0 means no one is selected.)
  209. //
  210. // So it should be
  211. //
  212. // DhcpIpUri DhcpNameUriDns DhcpDns DhcpOnly ProxyNameUri ProxyIpUri DhcpNameUri
  213. // OfferCount: [ 2, 1, 0, 1, 2, 1, 1]
  214. //
  215. // OfferIndex: {[ 2, 7, 0, 5, 0, *4, 1]
  216. // [ 6, 0, 0, 0, 3, 0, 0]
  217. // [ 0, 0, 0, 0, 0, 0, 0]
  218. // ... ]}
  219. // (OfferIndex is 0-based.)
  220. //
  221. //
  222. UINT32 SelectIndex;
  223. UINT32 SelectProxyType;
  224. HTTP_BOOT_DHCP_PACKET_CACHE OfferBuffer[HTTP_BOOT_OFFER_MAX_NUM];
  225. UINT32 OfferNum;
  226. UINT32 OfferCount[HttpOfferTypeMax];
  227. UINT32 OfferIndex[HttpOfferTypeMax][HTTP_BOOT_OFFER_MAX_NUM];
  228. };
  229. #define HTTP_BOOT_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'B', 'P', 'D')
  230. #define HTTP_BOOT_VIRTUAL_NIC_SIGNATURE SIGNATURE_32 ('H', 'B', 'V', 'N')
  231. #define HTTP_BOOT_PRIVATE_DATA_FROM_LOADFILE(a) CR (a, HTTP_BOOT_PRIVATE_DATA, LoadFile, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)
  232. #define HTTP_BOOT_PRIVATE_DATA_FROM_ID(a) CR (a, HTTP_BOOT_PRIVATE_DATA, Id, HTTP_BOOT_PRIVATE_DATA_SIGNATURE)
  233. #define HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, HTTP_BOOT_VIRTUAL_NIC, LoadFile, HTTP_BOOT_VIRTUAL_NIC_SIGNATURE)
  234. extern EFI_LOAD_FILE_PROTOCOL gHttpBootDxeLoadFile;
  235. /**
  236. Tests to see if this driver supports a given controller. If a child device is provided,
  237. it further tests to see if this driver supports creating a handle for the specified child device.
  238. This function checks to see if the driver specified by This supports the device specified by
  239. ControllerHandle. Drivers will typically use the device path attached to
  240. ControllerHandle and/or the services from the bus I/O abstraction attached to
  241. ControllerHandle to determine if the driver supports ControllerHandle. This function
  242. may be called many times during platform initialization. In order to reduce boot times, the tests
  243. performed by this function must be very small, and take as little time as possible to execute. This
  244. function must not change the state of any hardware devices, and this function must be aware that the
  245. device specified by ControllerHandle may already be managed by the same driver or a
  246. different driver. This function must match its calls to AllocatePages() with FreePages(),
  247. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  248. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  249. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  250. to guarantee the state of ControllerHandle is not modified by this function.
  251. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  252. @param[in] ControllerHandle The handle of the controller to test. This handle
  253. must support a protocol interface that supplies
  254. an I/O abstraction to the driver.
  255. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  256. parameter is ignored by device drivers, and is optional for bus
  257. drivers. For bus drivers, if this parameter is not NULL, then
  258. the bus driver must determine if the bus controller specified
  259. by ControllerHandle and the child controller specified
  260. by RemainingDevicePath are both supported by this
  261. bus driver.
  262. @retval EFI_SUCCESS The device specified by ControllerHandle and
  263. RemainingDevicePath is supported by the driver specified by This.
  264. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  265. RemainingDevicePath is already being managed by the driver
  266. specified by This.
  267. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  268. RemainingDevicePath is already being managed by a different
  269. driver or an application that requires exclusive access.
  270. Currently not implemented.
  271. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  272. RemainingDevicePath is not supported by the driver specified by This.
  273. **/
  274. EFI_STATUS
  275. EFIAPI
  276. HttpBootIp4DxeDriverBindingSupported (
  277. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  278. IN EFI_HANDLE ControllerHandle,
  279. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  280. );
  281. /**
  282. Starts a device controller or a bus controller.
  283. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  284. As a result, much of the error checking on the parameters to Start() has been moved into this
  285. common boot service. It is legal to call Start() from other locations,
  286. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  287. 1. ControllerHandle must be a valid EFI_HANDLE.
  288. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  289. EFI_DEVICE_PATH_PROTOCOL.
  290. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  291. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  292. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  293. @param[in] ControllerHandle The handle of the controller to start. This handle
  294. must support a protocol interface that supplies
  295. an I/O abstraction to the driver.
  296. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  297. parameter is ignored by device drivers, and is optional for bus
  298. drivers. For a bus driver, if this parameter is NULL, then handles
  299. for all the children of Controller are created by this driver.
  300. If this parameter is not NULL and the first Device Path Node is
  301. not the End of Device Path Node, then only the handle for the
  302. child device specified by the first Device Path Node of
  303. RemainingDevicePath is created by this driver.
  304. If the first Device Path Node of RemainingDevicePath is
  305. the End of Device Path Node, no child handle is created by this
  306. driver.
  307. @retval EFI_SUCCESS The device was started.
  308. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  309. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  310. @retval Others The driver failed to start the device.
  311. **/
  312. EFI_STATUS
  313. EFIAPI
  314. HttpBootIp4DxeDriverBindingStart (
  315. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  316. IN EFI_HANDLE ControllerHandle,
  317. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  318. );
  319. /**
  320. Stops a device controller or a bus controller.
  321. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  322. As a result, much of the error checking on the parameters to Stop() has been moved
  323. into this common boot service. It is legal to call Stop() from other locations,
  324. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  325. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  326. same driver's Start() function.
  327. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  328. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  329. Start() function, and the Start() function must have called OpenProtocol() on
  330. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  331. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  332. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  333. support a bus specific I/O protocol for the driver
  334. to use to stop the device.
  335. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  336. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  337. if NumberOfChildren is 0.
  338. @retval EFI_SUCCESS The device was stopped.
  339. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  340. **/
  341. EFI_STATUS
  342. EFIAPI
  343. HttpBootIp4DxeDriverBindingStop (
  344. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  345. IN EFI_HANDLE ControllerHandle,
  346. IN UINTN NumberOfChildren,
  347. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  348. );
  349. /**
  350. Tests to see if this driver supports a given controller. If a child device is provided,
  351. it further tests to see if this driver supports creating a handle for the specified child device.
  352. This function checks to see if the driver specified by This supports the device specified by
  353. ControllerHandle. Drivers will typically use the device path attached to
  354. ControllerHandle and/or the services from the bus I/O abstraction attached to
  355. ControllerHandle to determine if the driver supports ControllerHandle. This function
  356. may be called many times during platform initialization. In order to reduce boot times, the tests
  357. performed by this function must be very small, and take as little time as possible to execute. This
  358. function must not change the state of any hardware devices, and this function must be aware that the
  359. device specified by ControllerHandle may already be managed by the same driver or a
  360. different driver. This function must match its calls to AllocatePages() with FreePages(),
  361. AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
  362. Because ControllerHandle may have been previously started by the same driver, if a protocol is
  363. already in the opened state, then it must not be closed with CloseProtocol(). This is required
  364. to guarantee the state of ControllerHandle is not modified by this function.
  365. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  366. @param[in] ControllerHandle The handle of the controller to test. This handle
  367. must support a protocol interface that supplies
  368. an I/O abstraction to the driver.
  369. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  370. parameter is ignored by device drivers, and is optional for bus
  371. drivers. For bus drivers, if this parameter is not NULL, then
  372. the bus driver must determine if the bus controller specified
  373. by ControllerHandle and the child controller specified
  374. by RemainingDevicePath are both supported by this
  375. bus driver.
  376. @retval EFI_SUCCESS The device specified by ControllerHandle and
  377. RemainingDevicePath is supported by the driver specified by This.
  378. @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
  379. RemainingDevicePath is already being managed by the driver
  380. specified by This.
  381. @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
  382. RemainingDevicePath is already being managed by a different
  383. driver or an application that requires exclusive access.
  384. Currently not implemented.
  385. @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
  386. RemainingDevicePath is not supported by the driver specified by This.
  387. **/
  388. EFI_STATUS
  389. EFIAPI
  390. HttpBootIp6DxeDriverBindingSupported (
  391. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  392. IN EFI_HANDLE ControllerHandle,
  393. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  394. );
  395. /**
  396. Starts a device controller or a bus controller.
  397. The Start() function is designed to be invoked from the EFI boot service ConnectController().
  398. As a result, much of the error checking on the parameters to Start() has been moved into this
  399. common boot service. It is legal to call Start() from other locations,
  400. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  401. 1. ControllerHandle must be a valid EFI_HANDLE.
  402. 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
  403. EFI_DEVICE_PATH_PROTOCOL.
  404. 3. Prior to calling Start(), the Supported() function for the driver specified by This must
  405. have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
  406. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  407. @param[in] ControllerHandle The handle of the controller to start. This handle
  408. must support a protocol interface that supplies
  409. an I/O abstraction to the driver.
  410. @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
  411. parameter is ignored by device drivers, and is optional for bus
  412. drivers. For a bus driver, if this parameter is NULL, then handles
  413. for all the children of Controller are created by this driver.
  414. If this parameter is not NULL and the first Device Path Node is
  415. not the End of Device Path Node, then only the handle for the
  416. child device specified by the first Device Path Node of
  417. RemainingDevicePath is created by this driver.
  418. If the first Device Path Node of RemainingDevicePath is
  419. the End of Device Path Node, no child handle is created by this
  420. driver.
  421. @retval EFI_SUCCESS The device was started.
  422. @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
  423. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
  424. @retval Others The driver failed to start the device.
  425. **/
  426. EFI_STATUS
  427. EFIAPI
  428. HttpBootIp6DxeDriverBindingStart (
  429. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  430. IN EFI_HANDLE ControllerHandle,
  431. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  432. );
  433. /**
  434. Stops a device controller or a bus controller.
  435. The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
  436. As a result, much of the error checking on the parameters to Stop() has been moved
  437. into this common boot service. It is legal to call Stop() from other locations,
  438. but the following calling restrictions must be followed, or the system behavior will not be deterministic.
  439. 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
  440. same driver's Start() function.
  441. 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
  442. EFI_HANDLE. In addition, all of these handles must have been created in this driver's
  443. Start() function, and the Start() function must have called OpenProtocol() on
  444. ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
  445. @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
  446. @param[in] ControllerHandle A handle to the device being stopped. The handle must
  447. support a bus specific I/O protocol for the driver
  448. to use to stop the device.
  449. @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
  450. @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
  451. if NumberOfChildren is 0.
  452. @retval EFI_SUCCESS The device was stopped.
  453. @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
  454. **/
  455. EFI_STATUS
  456. EFIAPI
  457. HttpBootIp6DxeDriverBindingStop (
  458. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  459. IN EFI_HANDLE ControllerHandle,
  460. IN UINTN NumberOfChildren,
  461. IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
  462. );
  463. #endif