TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp6Impl.h
Go to the documentation of this file.
1
10#ifndef __EFI_MTFTP6_IMPL_H__
11#define __EFI_MTFTP6_IMPL_H__
12
13#include <Uefi.h>
14
15#include <Protocol/Udp6.h>
16#include <Protocol/Mtftp6.h>
19
20#include <Library/DebugLib.h>
23#include <Library/UefiLib.h>
24#include <Library/BaseLib.h>
25#include <Library/NetLib.h>
26#include <Library/PrintLib.h>
27
28typedef struct _MTFTP6_SERVICE MTFTP6_SERVICE;
30
31#include "Mtftp6Driver.h"
32#include "Mtftp6Option.h"
33#include "Mtftp6Support.h"
34
35#define MTFTP6_SERVICE_SIGNATURE SIGNATURE_32 ('M', 'F', '6', 'S')
36#define MTFTP6_INSTANCE_SIGNATURE SIGNATURE_32 ('M', 'F', '6', 'I')
37
38#define MTFTP6_DEFAULT_SERVER_CMD_PORT 69
39#define MTFTP6_DEFAULT_TIMEOUT 3
40#define MTFTP6_GET_MAPPING_TIMEOUT 3
41#define MTFTP6_DEFAULT_MAX_RETRY 5
42#define MTFTP6_DEFAULT_BLK_SIZE 512
43#define MTFTP6_DEFAULT_WINDOWSIZE 1
44#define MTFTP6_TICK_PER_SECOND 10000000U
45
46#define MTFTP6_SERVICE_FROM_THIS(a) CR (a, MTFTP6_SERVICE, ServiceBinding, MTFTP6_SERVICE_SIGNATURE)
47#define MTFTP6_INSTANCE_FROM_THIS(a) CR (a, MTFTP6_INSTANCE, Mtftp6, MTFTP6_INSTANCE_SIGNATURE)
48
49extern EFI_MTFTP6_PROTOCOL gMtftp6ProtocolTemplate;
50
52 EFI_MTFTP6_PACKET **Packet;
53 UINT32 *PacketLen;
54 EFI_STATUS Status;
56
57//
58// Control block for MTFTP6 instance, it's per configuration data.
59//
61 UINT32 Signature;
62 EFI_HANDLE Handle;
63 LIST_ENTRY Link;
65 MTFTP6_SERVICE *Service;
67
68 EFI_MTFTP6_TOKEN *Token;
70
71 UINT16 BlkSize;
72 UINT16 LastBlk;
73 LIST_ENTRY BlkList;
74
75 UINT16 Operation;
76
77 UINT16 WindowSize;
78
79 //
80 // Record the total received and saved block number.
81 //
82 UINT64 TotalBlock;
83
84 //
85 // Record the acked block number.
86 //
87 UINT64 AckedBlock;
88
89 EFI_IPv6_ADDRESS ServerIp;
90 UINT16 ServerCmdPort;
91 UINT16 ServerDataPort;
92 UDP_IO *UdpIo;
93
94 EFI_IPv6_ADDRESS McastIp;
95 UINT16 McastPort;
96 UDP_IO *McastUdpIo;
97
98 NET_BUF *LastPacket;
99 UINT32 CurRetry;
100 UINT32 MaxRetry;
101 UINT32 PacketToLive;
102 UINT32 Timeout;
103
104 EFI_TPL OldTpl;
105 BOOLEAN IsTransmitted;
106 BOOLEAN IsMaster;
107 BOOLEAN InDestroy;
108};
109
110//
111// Control block for MTFTP6 service, it's per Nic handle.
112//
114 UINT32 Signature;
115 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
116 EFI_HANDLE Controller;
117 EFI_HANDLE Image;
118
119 UINT16 ChildrenNum;
120 LIST_ENTRY Children;
121 //
122 // It is used to be as internal calculagraph for all instances.
123 //
124 EFI_EVENT Timer;
125 //
126 // It is used to maintain the parent-child relationship between
127 // mtftp driver and udp driver.
128 //
129 UDP_IO *DummyUdpIo;
130};
131
132typedef struct {
133 EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
134 UINTN NumberOfChildren;
135 EFI_HANDLE *ChildHandleBuffer;
137
154EFIAPI
157 OUT EFI_MTFTP6_MODE_DATA *ModeData
158 );
159
199EFIAPI
202 IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData OPTIONAL
203 );
204
259EFIAPI
262 IN EFI_MTFTP6_OVERRIDE_DATA *OverrideData OPTIONAL,
263 IN UINT8 *Filename,
264 IN UINT8 *ModeStr OPTIONAL,
265 IN UINT8 OptionCount,
266 IN EFI_MTFTP6_OPTION *OptionList OPTIONAL,
267 OUT UINT32 *PacketLength,
268 OUT EFI_MTFTP6_PACKET **Packet OPTIONAL
269 );
270
302EFIAPI
305 IN UINT32 PacketLen,
306 IN EFI_MTFTP6_PACKET *Packet,
307 OUT UINT32 *OptionCount,
308 OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL
309 );
310
352EFIAPI
355 IN EFI_MTFTP6_TOKEN *Token
356 );
357
401EFIAPI
404 IN EFI_MTFTP6_TOKEN *Token
405 );
406
448EFIAPI
451 IN EFI_MTFTP6_TOKEN *Token
452 );
453
479EFIAPI
482 );
483
484#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI EfiMtftp6GetModeData(IN EFI_MTFTP6_PROTOCOL *This, OUT EFI_MTFTP6_MODE_DATA *ModeData)
Definition: Mtftp6Impl.c:47
EFI_STATUS EFIAPI EfiMtftp6WriteFile(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
Definition: Mtftp6Impl.c:531
EFI_STATUS EFIAPI EfiMtftp6GetInfo(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_OVERRIDE_DATA *OverrideData OPTIONAL, IN UINT8 *Filename, IN UINT8 *ModeStr OPTIONAL, IN UINT8 OptionCount, IN EFI_MTFTP6_OPTION *OptionList OPTIONAL, OUT UINT32 *PacketLength, OUT EFI_MTFTP6_PACKET **Packet OPTIONAL)
Definition: Mtftp6Impl.c:322
EFI_STATUS EFIAPI EfiMtftp6ReadDirectory(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
Definition: Mtftp6Impl.c:581
EFI_STATUS EFIAPI EfiMtftp6Configure(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData OPTIONAL)
Definition: Mtftp6Impl.c:129
EFI_STATUS EFIAPI EfiMtftp6ParseOptions(IN EFI_MTFTP6_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP6_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL)
Definition: Mtftp6Impl.c:421
EFI_STATUS EFIAPI EfiMtftp6Poll(IN EFI_MTFTP6_PROTOCOL *This)
Definition: Mtftp6Impl.c:615
EFI_STATUS EFIAPI EfiMtftp6ReadFile(IN EFI_MTFTP6_PROTOCOL *This, IN EFI_MTFTP6_TOKEN *Token)
Definition: Mtftp6Impl.c:479
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
UINTN EFI_TPL
Definition: UefiBaseType.h:41
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33