]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/TcpDxe/TcpDriver.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / NetworkPkg / TcpDxe / TcpDriver.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 The prototype of driver binding and service binding protocol for TCP driver.\r
3\r
c2adf51f 4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
a3bcde70 5\r
ecf98fbc 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a3bcde70
HT
7\r
8**/\r
9\r
10#ifndef _TCP_DRIVER_H_\r
11#define _TCP_DRIVER_H_\r
12\r
d1050b9d 13#define TCP_DRIVER_SIGNATURE SIGNATURE_32 ('T', 'C', 'P', 'D')\r
a3bcde70 14\r
d1050b9d
MK
15#define TCP_PORT_KNOWN 1024\r
16#define TCP_PORT_USER_RESERVED 65535\r
a3bcde70
HT
17\r
18typedef struct _TCP_HEARTBEAT_TIMER {\r
d1050b9d
MK
19 EFI_EVENT TimerEvent;\r
20 INTN RefCnt;\r
a3bcde70
HT
21} TCP_HEARTBEAT_TIMER;\r
22\r
23typedef struct _TCP_SERVICE_DATA {\r
d1050b9d
MK
24 UINT32 Signature;\r
25 EFI_HANDLE ControllerHandle;\r
26 EFI_HANDLE DriverBindingHandle;\r
27 UINT8 IpVersion;\r
28 IP_IO *IpIo;\r
29 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
30 LIST_ENTRY SocketList;\r
a3bcde70
HT
31} TCP_SERVICE_DATA;\r
32\r
33typedef struct _TCP_PROTO_DATA {\r
d1050b9d
MK
34 TCP_SERVICE_DATA *TcpService;\r
35 TCP_CB *TcpPcb;\r
a3bcde70
HT
36} TCP_PROTO_DATA;\r
37\r
38#define TCP_SERVICE_FROM_THIS(a) \\r
39 CR ( \\r
40 (a), \\r
41 TCP_SERVICE_DATA, \\r
42 ServiceBinding, \\r
43 TCP_DRIVER_SIGNATURE \\r
44 )\r
45\r
46//\r
47// Function prototype for the driver's entry point\r
48//\r
49\r
50/**\r
51 The entry point for Tcp driver, used to install Tcp driver on the ImageHandle.\r
52\r
53 @param[in] ImageHandle The firmware allocated handle for this driver image.\r
54 @param[in] SystemTable Pointer to the EFI system table.\r
55\r
56 @retval EFI_SUCCESS The driver loaded.\r
57 @retval other The driver did not load.\r
58\r
59**/\r
60EFI_STATUS\r
61EFIAPI\r
62TcpDriverEntryPoint (\r
63 IN EFI_HANDLE ImageHandle,\r
64 IN EFI_SYSTEM_TABLE *SystemTable\r
65 );\r
66\r
67//\r
68// Function prototypes for the Driver Binding Protocol\r
69//\r
70\r
71/**\r
72 Test to see if this driver supports ControllerHandle.\r
73\r
74 @param[in] This Protocol instance pointer.\r
75 @param[in] ControllerHandle Handle of the device to test.\r
76 @param[in] RemainingDevicePath Optional parameter use to pick a specific\r
77 child device to start.\r
78\r
79 @retval EFI_SUCCESS This driver supports this device.\r
80 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
81 @retval other This driver does not support this device.\r
82\r
83**/\r
84EFI_STATUS\r
85EFIAPI\r
6879581d 86Tcp4DriverBindingSupported (\r
a3bcde70
HT
87 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
88 IN EFI_HANDLE ControllerHandle,\r
89 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
90 );\r
91\r
92/**\r
93 Start this driver on ControllerHandle.\r
94\r
95 @param[in] This Protocol instance pointer.\r
96 @param[in] ControllerHandle Handle of device to bind driver to.\r
97 @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r
98 device to start.\r
99\r
100 @retval EFI_SUCCESS The driver was added to ControllerHandle.\r
101 @retval EFI_OUT_OF_RESOURCES There are not enough resources to start the\r
102 driver.\r
103 @retval other The driver cannot be added to ControllerHandle.\r
104\r
105**/\r
106EFI_STATUS\r
107EFIAPI\r
6879581d 108Tcp4DriverBindingStart (\r
a3bcde70
HT
109 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
110 IN EFI_HANDLE ControllerHandle,\r
111 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
112 );\r
113\r
114/**\r
115 Stop this driver on ControllerHandle.\r
116\r
117 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
118 @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
119 support a bus specific I/O protocol for the driver\r
120 to use to stop the device.\r
121 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
122 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
123 if NumberOfChildren is 0.\r
124\r
125 @retval EFI_SUCCESS The device was stopped.\r
126 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
127\r
128**/\r
129EFI_STATUS\r
130EFIAPI\r
6879581d 131Tcp4DriverBindingStop (\r
132 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
133 IN EFI_HANDLE ControllerHandle,\r
134 IN UINTN NumberOfChildren,\r
135 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
136 );\r
137\r
138/**\r
139 Test to see if this driver supports ControllerHandle.\r
140\r
141 @param[in] This Protocol instance pointer.\r
142 @param[in] ControllerHandle Handle of the device to test.\r
143 @param[in] RemainingDevicePath Optional parameter use to pick a specific\r
144 child device to start.\r
145\r
146 @retval EFI_SUCCESS This driver supports this device.\r
147 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
148 @retval other This driver does not support this device.\r
149\r
150**/\r
151EFI_STATUS\r
152EFIAPI\r
153Tcp6DriverBindingSupported (\r
154 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
155 IN EFI_HANDLE ControllerHandle,\r
156 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
157 );\r
158\r
159/**\r
160 Start this driver on ControllerHandle.\r
161\r
162 @param[in] This Protocol instance pointer.\r
163 @param[in] ControllerHandle Handle of device to bind driver to.\r
164 @param[in] RemainingDevicePath Optional parameter use to pick a specific child\r
165 device to start.\r
166\r
167 @retval EFI_SUCCESS The driver was added to ControllerHandle.\r
168 @retval EFI_OUT_OF_RESOURCES There are not enough resources to start the\r
169 driver.\r
170 @retval other The driver cannot be added to ControllerHandle.\r
171\r
172**/\r
173EFI_STATUS\r
174EFIAPI\r
175Tcp6DriverBindingStart (\r
176 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
177 IN EFI_HANDLE ControllerHandle,\r
178 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
179 );\r
180\r
181/**\r
182 Stop this driver on ControllerHandle.\r
183\r
184 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
185 @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
186 support a bus specific I/O protocol for the driver\r
187 to use to stop the device.\r
188 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
189 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
190 if NumberOfChildren is 0.\r
191\r
192 @retval EFI_SUCCESS The device was stopped.\r
193 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
194\r
195**/\r
196EFI_STATUS\r
197EFIAPI\r
198Tcp6DriverBindingStop (\r
a3bcde70
HT
199 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
200 IN EFI_HANDLE ControllerHandle,\r
201 IN UINTN NumberOfChildren,\r
202 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
203 );\r
204\r
205/**\r
81c6f176 206 The Callback function called after the TCP socket is created.\r
a3bcde70
HT
207\r
208 @param[in] This Pointer to the socket just created.\r
209 @param[in] Context The context of the socket.\r
210\r
211 @retval EFI_SUCCESS This protocol is installed successfully.\r
81c6f176 212 @retval other An error occurred.\r
a3bcde70
HT
213\r
214**/\r
215EFI_STATUS\r
216TcpCreateSocketCallback (\r
217 IN SOCKET *This,\r
218 IN VOID *Context\r
219 );\r
220\r
221/**\r
222 The callback function called before the TCP socket is to be destroyed.\r
223\r
224 @param[in] This The TCP socket to be destroyed.\r
225 @param[in] Context The context of the socket.\r
226\r
227**/\r
228VOID\r
229TcpDestroySocketCallback (\r
230 IN SOCKET *This,\r
231 IN VOID *Context\r
232 );\r
233\r
234//\r
c2adf51f 235// Function prototypes for the ServiceBinding Protocol\r
a3bcde70
HT
236//\r
237\r
238/**\r
239 Creates a child handle with a set of TCP services.\r
240\r
241 The CreateChild() function installs a protocol on ChildHandle.\r
242 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
243 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
244\r
245 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
246 @param[in, out] ChildHandle Pointer to the handle of the child to create.\r
247 If it is NULL, then a new handle is created.\r
248 If it is a pointer to an existing UEFI handle,\r
249 then the protocol is added to the existing UEFI handle.\r
250\r
81c6f176 251 @retval EFI_SUCCESS The protocol was added to ChildHandle.\r
a3bcde70
HT
252 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
253 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create\r
254 the child.\r
255 @retval other The child handle was not created.\r
256\r
257**/\r
258EFI_STATUS\r
259EFIAPI\r
260TcpServiceBindingCreateChild (\r
261 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
262 IN OUT EFI_HANDLE *ChildHandle\r
263 );\r
264\r
265/**\r
266 Destroys a child handle with a set of TCP services.\r
267\r
268 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
269 that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
270 last protocol on ChildHandle, then ChildHandle is destroyed.\r
271\r
272 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
273 @param ChildHandle Handle of the child to destroy.\r
274\r
81c6f176 275 @retval EFI_SUCCESS The protocol was removed from ChildHandle.\r
a3bcde70 276 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r
15ee13fc 277 @retval EFI_INVALID_PARAMETER The child handle is NULL.\r
a3bcde70
HT
278 @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r
279 because its services are being used.\r
280 @retval other The child handle was not destroyed.\r
281\r
282**/\r
283EFI_STATUS\r
284EFIAPI\r
285TcpServiceBindingDestroyChild (\r
286 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
287 IN EFI_HANDLE ChildHandle\r
288 );\r
289\r
290#endif\r