]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Driver.h
CommitLineData
8a67d61d 1/** @file
2
3Copyright (c) 2005 - 2006, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 Tcp4Driver.h
15
16Abstract:
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
32typedef struct _TCP4_HEARTBEAT_TIMER {
33 EFI_EVENT TimerEvent;
34 INTN RefCnt;
35} TCP4_HEARTBEAT_TIMER;
36
37typedef 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//
49VOID
50Tcp4RxCallback (
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
58INTN
59TcpSendIpPacket (
60 IN TCP_CB *Tcb,
61 IN NET_BUF *Nbuf,
62 IN UINT32 Src,
63 IN UINT32 Dest
64 );
65
66EFI_STATUS
67Tcp4Dispatcher (
68 IN SOCKET *Sock,
69 IN SOCK_REQUEST Request,
70 IN VOID *Data OPTIONAL
71 );
72
73typedef 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//
89EFI_STATUS
90EFIAPI
91Tcp4DriverEntryPoint (
92 IN EFI_HANDLE ImageHandle,
93 IN EFI_SYSTEM_TABLE *SystemTable
94 );
95
96//
97// Function prototypes for the Drivr Binding Protocol
98//
99EFI_STATUS
100EFIAPI
101Tcp4DriverBindingSupported (
102 IN EFI_DRIVER_BINDING_PROTOCOL * This,
103 IN EFI_HANDLE ControllerHandle,
104 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
105 );
106
107EFI_STATUS
108EFIAPI
109Tcp4DriverBindingStart (
110 IN EFI_DRIVER_BINDING_PROTOCOL * This,
111 IN EFI_HANDLE ControllerHandle,
112 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
113 );
114
115EFI_STATUS
116EFIAPI
117Tcp4DriverBindingStop (
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//
127EFI_STATUS
128EFIAPI
129Tcp4ServiceBindingCreateChild (
130 IN EFI_SERVICE_BINDING_PROTOCOL *This,
131 IN EFI_HANDLE *ChildHandle
132 );
133
134EFI_STATUS
135EFIAPI
136Tcp4ServiceBindingDestroyChild (
137 IN EFI_SERVICE_BINDING_PROTOCOL *This,
138 IN EFI_HANDLE ChildHandle
139 );
140
141#endif