• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Mtftp drivers function header.
3 
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php<BR>
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef __EFI_MTFTP4_DRIVER_H__
16 #define __EFI_MTFTP4_DRIVER_H__
17 
18 #include <Uefi.h>
19 
20 #include <Protocol/ServiceBinding.h>
21 
22 #include <Library/NetLib.h>
23 #include <Library/UefiLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 
26 extern EFI_COMPONENT_NAME_PROTOCOL   gMtftp4ComponentName;
27 extern EFI_COMPONENT_NAME2_PROTOCOL  gMtftp4ComponentName2;
28 extern EFI_DRIVER_BINDING_PROTOCOL   gMtftp4DriverBinding;
29 extern EFI_UNICODE_STRING_TABLE      *gMtftp4ControllerNameTable;
30 
31 /**
32   Test whether MTFTP driver support this controller.
33 
34   @param  This                   The MTFTP driver binding instance
35   @param  Controller             The controller to test
36   @param  RemainingDevicePath    The remaining device path
37 
38   @retval EFI_SUCCESS            The controller has UDP service binding protocol
39                                  installed, MTFTP can support it.
40   @retval Others                 MTFTP can't support the controller.
41 
42 **/
43 EFI_STATUS
44 EFIAPI
45 Mtftp4DriverBindingSupported (
46   IN EFI_DRIVER_BINDING_PROTOCOL    *This,
47   IN EFI_HANDLE                     Controller,
48   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath
49   );
50 
51 /**
52   Start the MTFTP driver on this controller.
53 
54   MTFTP driver will install a MTFTP SERVICE BINDING protocol on the supported
55   controller, which can be used to create/destroy MTFTP children.
56 
57   @param  This                   The MTFTP driver binding protocol.
58   @param  Controller             The controller to manage.
59   @param  RemainingDevicePath    Remaining device path.
60 
61   @retval EFI_ALREADY_STARTED    The MTFTP service binding protocol has been
62                                  started  on the controller.
63   @retval EFI_SUCCESS            The MTFTP service binding is installed on the
64                                  controller.
65 
66 **/
67 EFI_STATUS
68 EFIAPI
69 Mtftp4DriverBindingStart (
70   IN EFI_DRIVER_BINDING_PROTOCOL  *This,
71   IN EFI_HANDLE                   Controller,
72   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath
73   );
74 
75 /**
76   Stop the MTFTP driver on controller. The controller is a UDP
77   child handle.
78 
79   @param  This                   The MTFTP driver binding protocol
80   @param  Controller             The controller to stop
81   @param  NumberOfChildren       The number of children
82   @param  ChildHandleBuffer      The array of the child handle.
83 
84   @retval EFI_SUCCESS            The driver is stopped on the controller.
85   @retval EFI_DEVICE_ERROR       Failed to stop the driver on the controller.
86 
87 **/
88 EFI_STATUS
89 EFIAPI
90 Mtftp4DriverBindingStop (
91   IN EFI_DRIVER_BINDING_PROTOCOL *This,
92   IN EFI_HANDLE                  Controller,
93   IN UINTN                       NumberOfChildren,
94   IN EFI_HANDLE                  *ChildHandleBuffer
95   );
96 
97 /**
98   Create a MTFTP child for the service binding instance, then
99   install the MTFTP protocol to the ChildHandle.
100 
101   @param  This                   The MTFTP service binding instance.
102   @param  ChildHandle            The Child handle to install the MTFTP protocol.
103 
104   @retval EFI_INVALID_PARAMETER  The parameter is invalid.
105   @retval EFI_OUT_OF_RESOURCES   Failed to allocate resource for the new child.
106   @retval EFI_SUCCESS            The child is successfully create.
107 
108 **/
109 EFI_STATUS
110 EFIAPI
111 Mtftp4ServiceBindingCreateChild (
112   IN EFI_SERVICE_BINDING_PROTOCOL  *This,
113   IN EFI_HANDLE                *ChildHandle
114   );
115 
116 /**
117   Destroy one of the service binding's child.
118 
119   @param  This                   The service binding instance
120   @param  ChildHandle            The child handle to destroy
121 
122   @retval EFI_INVALID_PARAMETER  The parameter is invaid.
123   @retval EFI_UNSUPPORTED        The child may have already been destroyed.
124   @retval EFI_SUCCESS            The child is destroyed and removed from the
125                                  parent's child list.
126 
127 **/
128 EFI_STATUS
129 EFIAPI
130 Mtftp4ServiceBindingDestroyChild (
131   IN EFI_SERVICE_BINDING_PROTOCOL *This,
132   IN EFI_HANDLE                   ChildHandle
133   );
134 
135 
136 
137 #endif
138