]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
Fixed EBC build issues.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Driver.h
1 /** @file
2
3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Tcp4Driver.h
15
16 Abstract:
17
18
19 **/
20
21 #ifndef _TCP4_DRIVER_H_
22 #define _TCP4_DRIVER_H_
23
24 #include <Protocol/ServiceBinding.h>
25 #include <Library/IpIoLib.h>
26
27 #define TCP4_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('T', 'C', 'P', '4')
28
29 #define TCP4_PORT_KNOWN 1024
30 #define TCP4_PORT_USER_RESERVED 65535
31
32 typedef struct _TCP4_HEARTBEAT_TIMER {
33 EFI_EVENT TimerEvent;
34 INTN RefCnt;
35 } TCP4_HEARTBEAT_TIMER;
36
37 typedef struct _TCP4_SERVICE_DATA {
38 UINT32 Signature;
39 EFI_HANDLE ControllerHandle;
40 IP_IO *IpIo; // IP Io consumed by TCP4
41 EFI_SERVICE_BINDING_PROTOCOL Tcp4ServiceBinding;
42 EFI_HANDLE DriverBindingHandle;
43 CHAR16 *MacString;
44 } TCP4_SERVICE_DATA;
45
46 //
47 // Prototype for TCP4 driver Rcv callback function registered to IP_IO
48 //
49 VOID
50 Tcp4RxCallback (
51 IN EFI_STATUS Status,
52 IN ICMP_ERROR IcmpErr,
53 IN EFI_NET_SESSION_DATA *NetSession,
54 IN NET_BUF *Pkt,
55 IN VOID *Context OPTIONAL
56 );
57
58 INTN
59 TcpSendIpPacket (
60 IN TCP_CB *Tcb,
61 IN NET_BUF *Nbuf,
62 IN UINT32 Src,
63 IN UINT32 Dest
64 );
65
66 EFI_STATUS
67 Tcp4Dispatcher (
68 IN SOCKET *Sock,
69 IN SOCK_REQUEST Request,
70 IN VOID *Data OPTIONAL
71 );
72
73 typedef struct _TCP4_PROTO_DATA {
74 TCP4_SERVICE_DATA *TcpService;
75 TCP_CB *TcpPcb;
76 } TCP4_PROTO_DATA;
77
78 #define TCP4_FROM_THIS(a) \
79 CR ( \
80 (a), \
81 TCP4_SERVICE_DATA, \
82 Tcp4ServiceBinding, \
83 TCP4_DRIVER_SIGNATURE \
84 )
85
86 //
87 // Function prototype for the driver's entry point
88 //
89 EFI_STATUS
90 EFIAPI
91 Tcp4DriverEntryPoint (
92 IN EFI_HANDLE ImageHandle,
93 IN EFI_SYSTEM_TABLE *SystemTable
94 );
95
96 //
97 // Function prototypes for the Drivr Binding Protocol
98 //
99 EFI_STATUS
100 EFIAPI
101 Tcp4DriverBindingSupported (
102 IN EFI_DRIVER_BINDING_PROTOCOL * This,
103 IN EFI_HANDLE ControllerHandle,
104 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
105 );
106
107 EFI_STATUS
108 EFIAPI
109 Tcp4DriverBindingStart (
110 IN EFI_DRIVER_BINDING_PROTOCOL * This,
111 IN EFI_HANDLE ControllerHandle,
112 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
113 );
114
115 EFI_STATUS
116 EFIAPI
117 Tcp4DriverBindingStop (
118 IN EFI_DRIVER_BINDING_PROTOCOL *This,
119 IN EFI_HANDLE ControllerHandle,
120 IN UINTN NumberOfChildren,
121 IN EFI_HANDLE *ChildHandleBuffer
122 );
123
124 //
125 // Function ptototypes for the ServiceBinding Prococol
126 //
127 EFI_STATUS
128 EFIAPI
129 Tcp4ServiceBindingCreateChild (
130 IN EFI_SERVICE_BINDING_PROTOCOL *This,
131 IN EFI_HANDLE *ChildHandle
132 );
133
134 EFI_STATUS
135 EFIAPI
136 Tcp4ServiceBindingDestroyChild (
137 IN EFI_SERVICE_BINDING_PROTOCOL *This,
138 IN EFI_HANDLE ChildHandle
139 );
140
141 #endif