EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h

Go to the documentation of this file.
00001 
00016 #ifndef __EFI_MTFTP6_IMPL_H__
00017 #define __EFI_MTFTP6_IMPL_H__
00018 
00019 #include <Uefi.h>
00020 
00021 #include <Protocol/Udp6.h>
00022 #include <Protocol/Mtftp6.h>
00023 #include <Protocol/ServiceBinding.h>
00024 #include <Protocol/DriverBinding.h>
00025 
00026 #include <Library/DebugLib.h>
00027 #include <Library/UefiDriverEntryPoint.h>
00028 #include <Library/UefiBootServicesTableLib.h>
00029 #include <Library/UefiLib.h>
00030 #include <Library/BaseLib.h>
00031 #include <Library/NetLib.h>
00032 
00033 typedef struct _MTFTP6_SERVICE  MTFTP6_SERVICE;
00034 typedef struct _MTFTP6_INSTANCE MTFTP6_INSTANCE;
00035 
00036 #include "Mtftp6Driver.h"
00037 #include "Mtftp6Option.h"
00038 #include "Mtftp6Support.h"
00039 
00040 #define MTFTP6_SERVICE_SIGNATURE       SIGNATURE_32 ('M', 'F', '6', 'S')
00041 #define MTFTP6_INSTANCE_SIGNATURE      SIGNATURE_32 ('M', 'F', '6', 'I')
00042 
00043 #define MTFTP6_DEFAULT_SERVER_CMD_PORT 69
00044 #define MTFTP6_DEFAULT_TIMEOUT         3
00045 #define MTFTP6_GET_MAPPING_TIMEOUT     3
00046 #define MTFTP6_DEFAULT_MAX_RETRY       5
00047 #define MTFTP6_DEFAULT_BLK_SIZE        512
00048 #define MTFTP6_TICK_PER_SECOND         10000000U
00049 
00050 #define MTFTP6_SERVICE_FROM_THIS(a)    CR (a, MTFTP6_SERVICE, ServiceBinding, MTFTP6_SERVICE_SIGNATURE)
00051 #define MTFTP6_INSTANCE_FROM_THIS(a)   CR (a, MTFTP6_INSTANCE, Mtftp6, MTFTP6_INSTANCE_SIGNATURE)
00052 
00053 extern EFI_MTFTP6_PROTOCOL             gMtftp6ProtocolTemplate;
00054 
00055 typedef struct _MTFTP6_GETINFO_CONTEXT{
00056   EFI_MTFTP6_PACKET             **Packet;
00057   UINT32                        *PacketLen;
00058   EFI_STATUS                    Status;
00059 } MTFTP6_GETINFO_CONTEXT;
00060 
00061 //
00062 // Control block for MTFTP6 instance, it's per configuration data.
00063 //
00064 struct _MTFTP6_INSTANCE {
00065   UINT32                        Signature;
00066   EFI_HANDLE                    Handle;
00067   LIST_ENTRY                    Link;
00068   EFI_MTFTP6_PROTOCOL           Mtftp6;
00069   MTFTP6_SERVICE                *Service;
00070   EFI_MTFTP6_CONFIG_DATA        *Config;
00071 
00072   EFI_MTFTP6_TOKEN              *Token;
00073   MTFTP6_EXT_OPTION_INFO        ExtInfo;
00074 
00075   UINT16                        BlkSize;
00076   UINT16                        LastBlk;
00077   LIST_ENTRY                    BlkList;
00078 
00079   EFI_IPv6_ADDRESS              ServerIp;
00080   UINT16                        ServerCmdPort;
00081   UINT16                        ServerDataPort;
00082   UDP_IO                        *UdpIo;
00083 
00084   EFI_IPv6_ADDRESS              McastIp;
00085   UINT16                        McastPort;
00086   UDP_IO                        *McastUdpIo;
00087 
00088   NET_BUF                       *LastPacket;
00089   UINT32                        CurRetry;
00090   UINT32                        MaxRetry;
00091   UINT32                        PacketToLive;
00092   UINT32                        Timeout;
00093 
00094   EFI_TPL                       OldTpl;
00095   BOOLEAN                       IsTransmitted;
00096   BOOLEAN                       IsMaster;
00097   BOOLEAN                       InDestory;
00098 };
00099 
00100 //
00101 // Control block for MTFTP6 service, it's per Nic handle.
00102 //
00103 struct _MTFTP6_SERVICE {
00104   UINT32                        Signature;
00105   EFI_SERVICE_BINDING_PROTOCOL  ServiceBinding;
00106   EFI_HANDLE                    Controller;
00107   EFI_HANDLE                    Image;
00108 
00109   UINT16                        ChildrenNum;
00110   LIST_ENTRY                    Children;
00111   //
00112   // It is used to be as internal calculagraph for all instances.
00113   //
00114   EFI_EVENT                     Timer;
00115   //
00116   // It is used to maintain the parent-child relationship between
00117   // mtftp driver and udp driver.
00118   //
00119   UDP_IO                        *DummyUdpIo;
00120   BOOLEAN                       InDestory;
00121 };
00122 
00138 EFI_STATUS
00139 EFIAPI
00140 EfiMtftp6GetModeData (
00141   IN  EFI_MTFTP6_PROTOCOL    *This,
00142   OUT EFI_MTFTP6_MODE_DATA   *ModeData
00143   );
00144 
00183 EFI_STATUS
00184 EFIAPI
00185 EfiMtftp6Configure (
00186   IN EFI_MTFTP6_PROTOCOL    *This,
00187   IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData     OPTIONAL
00188   );
00189 
00243 EFI_STATUS
00244 EFIAPI
00245 EfiMtftp6GetInfo (
00246   IN  EFI_MTFTP6_PROTOCOL      *This,
00247   IN  EFI_MTFTP6_OVERRIDE_DATA *OverrideData         OPTIONAL,
00248   IN  UINT8                    *Filename,
00249   IN  UINT8                    *ModeStr              OPTIONAL,
00250   IN  UINT8                    OptionCount,
00251   IN  EFI_MTFTP6_OPTION        *OptionList           OPTIONAL,
00252   OUT UINT32                   *PacketLength,
00253   OUT EFI_MTFTP6_PACKET        **Packet              OPTIONAL
00254   );
00255 
00286 EFI_STATUS
00287 EFIAPI
00288 EfiMtftp6ParseOptions (
00289   IN     EFI_MTFTP6_PROTOCOL    *This,
00290   IN     UINT32                 PacketLen,
00291   IN     EFI_MTFTP6_PACKET      *Packet,
00292   OUT    UINT32                 *OptionCount,
00293   OUT    EFI_MTFTP6_OPTION      **OptionList          OPTIONAL
00294   );
00295 
00336 EFI_STATUS
00337 EFIAPI
00338 EfiMtftp6ReadFile (
00339   IN EFI_MTFTP6_PROTOCOL    *This,
00340   IN EFI_MTFTP6_TOKEN       *Token
00341   );
00342 
00385 EFI_STATUS
00386 EFIAPI
00387 EfiMtftp6WriteFile (
00388   IN EFI_MTFTP6_PROTOCOL    *This,
00389   IN EFI_MTFTP6_TOKEN       *Token
00390   );
00391 
00432 EFI_STATUS
00433 EFIAPI
00434 EfiMtftp6ReadDirectory (
00435   IN EFI_MTFTP6_PROTOCOL        *This,
00436   IN EFI_MTFTP6_TOKEN           *Token
00437   );
00438 
00463 EFI_STATUS
00464 EFIAPI
00465 EfiMtftp6Poll (
00466   IN EFI_MTFTP6_PROTOCOL    *This
00467   );
00468 
00469 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines