Mtftp4Driver.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /** @file
  2. Mtftp drivers function header.
  3. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __EFI_MTFTP4_DRIVER_H__
  7. #define __EFI_MTFTP4_DRIVER_H__
  8. #include <Uefi.h>
  9. #include <Protocol/ServiceBinding.h>
  10. #include <Library/NetLib.h>
  11. #include <Library/UefiLib.h>
  12. #include <Library/UefiDriverEntryPoint.h>
  13. extern EFI_COMPONENT_NAME_PROTOCOL gMtftp4ComponentName;
  14. extern EFI_COMPONENT_NAME2_PROTOCOL gMtftp4ComponentName2;
  15. extern EFI_DRIVER_BINDING_PROTOCOL gMtftp4DriverBinding;
  16. extern EFI_UNICODE_STRING_TABLE *gMtftp4ControllerNameTable;
  17. /**
  18. Test whether MTFTP driver support this controller.
  19. @param This The MTFTP driver binding instance
  20. @param Controller The controller to test
  21. @param RemainingDevicePath The remaining device path
  22. @retval EFI_SUCCESS The controller has UDP service binding protocol
  23. installed, MTFTP can support it.
  24. @retval Others MTFTP can't support the controller.
  25. **/
  26. EFI_STATUS
  27. EFIAPI
  28. Mtftp4DriverBindingSupported (
  29. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  30. IN EFI_HANDLE Controller,
  31. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  32. );
  33. /**
  34. Start the MTFTP driver on this controller.
  35. MTFTP driver will install a MTFTP SERVICE BINDING protocol on the supported
  36. controller, which can be used to create/destroy MTFTP children.
  37. @param This The MTFTP driver binding protocol.
  38. @param Controller The controller to manage.
  39. @param RemainingDevicePath Remaining device path.
  40. @retval EFI_ALREADY_STARTED The MTFTP service binding protocol has been
  41. started on the controller.
  42. @retval EFI_SUCCESS The MTFTP service binding is installed on the
  43. controller.
  44. **/
  45. EFI_STATUS
  46. EFIAPI
  47. Mtftp4DriverBindingStart (
  48. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  49. IN EFI_HANDLE Controller,
  50. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  51. );
  52. /**
  53. Stop the MTFTP driver on controller. The controller is a UDP
  54. child handle.
  55. @param This The MTFTP driver binding protocol
  56. @param Controller The controller to stop
  57. @param NumberOfChildren The number of children
  58. @param ChildHandleBuffer The array of the child handle.
  59. @retval EFI_SUCCESS The driver is stopped on the controller.
  60. @retval EFI_DEVICE_ERROR Failed to stop the driver on the controller.
  61. **/
  62. EFI_STATUS
  63. EFIAPI
  64. Mtftp4DriverBindingStop (
  65. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  66. IN EFI_HANDLE Controller,
  67. IN UINTN NumberOfChildren,
  68. IN EFI_HANDLE *ChildHandleBuffer
  69. );
  70. /**
  71. Create a MTFTP child for the service binding instance, then
  72. install the MTFTP protocol to the ChildHandle.
  73. @param This The MTFTP service binding instance.
  74. @param ChildHandle The Child handle to install the MTFTP protocol.
  75. @retval EFI_INVALID_PARAMETER The parameter is invalid.
  76. @retval EFI_OUT_OF_RESOURCES Failed to allocate resource for the new child.
  77. @retval EFI_SUCCESS The child is successfully create.
  78. **/
  79. EFI_STATUS
  80. EFIAPI
  81. Mtftp4ServiceBindingCreateChild (
  82. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  83. IN EFI_HANDLE *ChildHandle
  84. );
  85. /**
  86. Destroy one of the service binding's child.
  87. @param This The service binding instance
  88. @param ChildHandle The child handle to destroy
  89. @retval EFI_INVALID_PARAMETER The parameter is invalid.
  90. @retval EFI_UNSUPPORTED The child may have already been destroyed.
  91. @retval EFI_SUCCESS The child is destroyed and removed from the
  92. parent's child list.
  93. **/
  94. EFI_STATUS
  95. EFIAPI
  96. Mtftp4ServiceBindingDestroyChild (
  97. IN EFI_SERVICE_BINDING_PROTOCOL *This,
  98. IN EFI_HANDLE ChildHandle
  99. );
  100. #endif