]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/IScsiDxe/IScsiImpl.h
Update for NetworkPkg.
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiImpl.h
CommitLineData
4c5a5e0c 1/** @file\r
2 The shared head file for iSCSI driver.\r
3\r
4Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _ISCSI_IMPL_H_\r
16#define _ISCSI_IMPL_H_\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Protocol/ComponentName.h>\r
21#include <Protocol/ComponentName2.h>\r
22#include <Protocol/DriverBinding.h>\r
23#include <Protocol/DevicePath.h>\r
24#include <Protocol/HiiConfigAccess.h>\r
25\r
26#include <Protocol/Dhcp4.h>\r
27#include <Protocol/Dhcp6.h>\r
28#include <Protocol/Tcp4.h>\r
29#include <Protocol/Tcp6.h>\r
30\r
31#include <Protocol/AuthenticationInfo.h>\r
32#include <Protocol/IScsiInitiatorName.h>\r
33#include <Protocol/ScsiPassThruExt.h>\r
34\r
35#include <Library/HiiLib.h>\r
36#include <Library/UefiHiiServicesLib.h>\r
37#include <Library/DevicePathLib.h>\r
38#include <Library/DebugLib.h>\r
39#include <Library/BaseLib.h>\r
40#include <Library/BaseMemoryLib.h>\r
41#include <Library/MemoryAllocationLib.h>\r
42#include <Library/PrintLib.h>\r
43#include <Library/UefiBootServicesTableLib.h>\r
44#include <Library/UefiRuntimeServicesTableLib.h>\r
45#include <Library/UefiLib.h>\r
46#include <Library/DpcLib.h>\r
47#include <Library/NetLib.h>\r
48#include <Library/TcpIoLib.h>\r
49#include <Library/BaseCryptLib.h>\r
50\r
51#include <Guid/MdeModuleHii.h>\r
52#include <Guid/EventGroup.h>\r
53#include <Guid/Acpi.h>\r
54\r
55#include "IScsiConfigNVDataStruc.h"\r
56#include "IScsiDriver.h"\r
57#include "IScsiProto.h"\r
58#include "IScsiCHAP.h"\r
59#include "IScsiDhcp.h"\r
60#include "IScsiDhcp6.h"\r
61#include "IScsiIbft.h"\r
62#include "IScsiMisc.h"\r
63#include "IScsiConfig.h"\r
64\r
65#define ISCSI_AUTH_INITIAL 0\r
66\r
67#define ISCSI_SESSION_SIGNATURE SIGNATURE_32 ('I', 'S', 'S', 'N')\r
68///\r
69/// 10 seconds\r
70///\r
71#define ISCSI_GET_MAPPING_TIMEOUT 100000000U\r
72///\r
73/// 3 seconds\r
74///\r
75#define ISCSI_WAIT_IPSEC_TIMEOUT 30000000U\r
76\r
77struct _ISCSI_SESSION {\r
78 UINT32 Signature;\r
79\r
80 ISCSI_DRIVER_DATA *Private;\r
81 ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;\r
82\r
83 UINT8 AuthType;\r
84 union {\r
85 ISCSI_CHAP_AUTH_DATA CHAP;\r
86 } AuthData;\r
87\r
88 UINT8 State;\r
89\r
90 UINT8 Isid[6];\r
91 UINT16 Tsih;\r
92\r
93 UINT32 CmdSN;\r
94 UINT32 ExpCmdSN;\r
95 UINT32 MaxCmdSN;\r
96\r
97 UINT32 InitiatorTaskTag;\r
98 UINT16 NextCid;\r
99\r
100 LIST_ENTRY Conns;\r
101 UINT32 NumConns;\r
102\r
103 LIST_ENTRY TcbList;\r
104\r
105 //\r
106 // Session-wide parameters\r
107 //\r
108 UINT16 TargetPortalGroupTag;\r
109 UINT32 MaxConnections;\r
110 BOOLEAN InitialR2T;\r
111 BOOLEAN ImmediateData;\r
112 UINT32 MaxBurstLength;\r
113 UINT32 FirstBurstLength;\r
114 UINT32 DefaultTime2Wait;\r
115 UINT32 DefaultTime2Retain;\r
116 UINT16 MaxOutstandingR2T;\r
117 BOOLEAN DataPDUInOrder;\r
118 BOOLEAN DataSequenceInOrder;\r
119 UINT8 ErrorRecoveryLevel;\r
120};\r
121\r
122#define ISCSI_CONNECTION_SIGNATURE SIGNATURE_32 ('I', 'S', 'C', 'N')\r
123\r
124struct _ISCSI_CONNECTION {\r
125 UINT32 Signature;\r
126 LIST_ENTRY Link;\r
127\r
128 EFI_EVENT TimeoutEvent;\r
129\r
130 ISCSI_SESSION *Session;\r
131\r
132 UINT8 State;\r
133 UINT8 CurrentStage;\r
134 UINT8 NextStage;\r
135\r
136 UINT8 AuthStep;\r
137\r
138 BOOLEAN PartialReqSent;\r
139 BOOLEAN PartialRspRcvd;\r
140\r
141 BOOLEAN TransitInitiated;\r
142 BOOLEAN ParamNegotiated;\r
143\r
144 UINT16 Cid;\r
145 UINT32 ExpStatSN;\r
146\r
147 //\r
148 // Queues...\r
149 //\r
150 NET_BUF_QUEUE RspQue;\r
151\r
152 BOOLEAN Ipv6Flag;\r
153 TCP_IO TcpIo;\r
154\r
155 //\r
156 // Connection-only parameters.\r
157 //\r
158 UINT32 MaxRecvDataSegmentLength;\r
159 ISCSI_DIGEST_TYPE HeaderDigest;\r
160 ISCSI_DIGEST_TYPE DataDigest;\r
161};\r
162\r
163#define ISCSI_DRIVER_DATA_SIGNATURE SIGNATURE_32 ('I', 'S', 'D', 'A')\r
164\r
165#define ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU(PassThru) \\r
166 CR ( \\r
167 PassThru, \\r
168 ISCSI_DRIVER_DATA, \\r
169 IScsiExtScsiPassThru, \\r
170 ISCSI_DRIVER_DATA_SIGNATURE \\r
171 )\r
172\r
173#define ISCSI_DRIVER_DATA_FROM_IDENTIFIER(Identifier) \\r
174 CR ( \\r
175 Identifier, \\r
176 ISCSI_DRIVER_DATA, \\r
177 IScsiIdentifier, \\r
178 ISCSI_DRIVER_DATA_SIGNATURE \\r
179 )\r
180\r
181struct _ISCSI_DRIVER_DATA {\r
182 UINT32 Signature;\r
183 EFI_HANDLE Image;\r
184 EFI_HANDLE Controller;\r
185 ISCSI_PRIVATE_PROTOCOL IScsiIdentifier;\r
186\r
187 EFI_EVENT ExitBootServiceEvent;\r
188\r
189 EFI_EXT_SCSI_PASS_THRU_PROTOCOL IScsiExtScsiPassThru;\r
190 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;\r
191 EFI_HANDLE ExtScsiPassThruHandle;\r
192 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
193 EFI_HANDLE ChildHandle; \r
194 ISCSI_SESSION *Session;\r
195};\r
196\r
197#endif\r