Udp4Driver.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /** @file
  2. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _UDP4_DRIVER_H_
  6. #define _UDP4_DRIVER_H_
  7. #include <Uefi.h>
  8. #include <Library/BaseLib.h>
  9. #include <Library/NetLib.h>
  10. #include <Protocol/DriverBinding.h>
  11. #include <Protocol/ServiceBinding.h>
  12. /**
  13. Test to see if this driver supports ControllerHandle. This service
  14. is called by the EFI boot service ConnectController(). In
  15. order to make drivers as small as possible, there are a few calling
  16. restrictions for this service. ConnectController() must
  17. follow these calling restrictions. If any other agent wishes to call
  18. Supported() it must also follow these calling restrictions.
  19. @param[in] This Protocol instance pointer.
  20. @param[in] ControllerHandle Handle of device to test
  21. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  22. device to start.
  23. @retval EFI_SUCCESS This driver supports this device
  24. @retval EFI_ALREADY_STARTED This driver is already running on this device
  25. @retval other This driver does not support this device
  26. **/
  27. EFI_STATUS
  28. EFIAPI
  29. Udp4DriverBindingSupported (
  30. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  31. IN EFI_HANDLE ControllerHandle,
  32. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  33. );
  34. /**
  35. Start this driver on ControllerHandle. This service is called by the
  36. EFI boot service ConnectController(). In order to make
  37. drivers as small as possible, there are a few calling restrictions for
  38. this service. ConnectController() must follow these
  39. calling restrictions. If any other agent wishes to call Start() it
  40. must also follow these calling restrictions.
  41. @param[in] This Protocol instance pointer.
  42. @param[in] ControllerHandle Handle of device to bind driver to
  43. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  44. device to start.
  45. @retval EFI_SUCCESS This driver is added to ControllerHandle
  46. @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
  47. @retval other This driver does not support this device
  48. **/
  49. EFI_STATUS
  50. EFIAPI
  51. Udp4DriverBindingStart (
  52. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  53. IN EFI_HANDLE ControllerHandle,
  54. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
  55. );
  56. /**
  57. Stop this driver on ControllerHandle. This service is called by the
  58. EFI boot service DisconnectController(). In order to
  59. make drivers as small as possible, there are a few calling
  60. restrictions for this service. DisconnectController()
  61. must follow these calling restrictions. If any other agent wishes
  62. to call Stop() it must also follow these calling restrictions.
  63. @param[in] This Protocol instance pointer.
  64. @param[in] ControllerHandle Handle of device to stop driver on
  65. @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
  66. children is zero stop the entire bus driver.
  67. @param[in] ChildHandleBuffer List of Child Handles to Stop.
  68. @retval EFI_SUCCESS This driver is removed ControllerHandle
  69. @retval other This driver was not removed from this device
  70. **/
  71. EFI_STATUS
  72. EFIAPI
  73. Udp4DriverBindingStop (
  74. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  75. IN EFI_HANDLE ControllerHandle,
  76. IN UINTN NumberOfChildren,
  77. IN EFI_HANDLE *ChildHandleBuffer
  78. );
  79. /**
  80. Creates a child handle and installs a protocol.
  81. The CreateChild() function installs a protocol on ChildHandle.
  82. If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
  83. If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
  84. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  85. @param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
  86. then a new handle is created. If it is a pointer to an existing UEFI handle,
  87. then the protocol is added to the existing UEFI handle.
  88. @retval EFI_SUCCESS The protocol was added to ChildHandle.
  89. @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
  90. @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
  91. the child
  92. @retval other The child handle was not created
  93. **/
  94. EFI_STATUS
  95. EFIAPI
  96. Udp4ServiceBindingCreateChild (
  97. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  98. IN EFI_HANDLE *ChildHandle
  99. );
  100. /**
  101. Destroys a child handle with a protocol installed on it.
  102. The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
  103. that was installed by CreateChild() from ChildHandle. If the removed protocol is the
  104. last protocol on ChildHandle, then ChildHandle is destroyed.
  105. @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
  106. @param[in] ChildHandle Handle of the child to destroy
  107. @retval EFI_SUCCESS The protocol was removed from ChildHandle.
  108. @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
  109. @retval EFI_INVALID_PARAMETER Child handle is NULL.
  110. @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
  111. because its services are being used.
  112. @retval other The child handle was not destroyed
  113. **/
  114. EFI_STATUS
  115. EFIAPI
  116. Udp4ServiceBindingDestroyChild (
  117. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  118. IN EFI_HANDLE ChildHandle
  119. );
  120. #endif