]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/IScsiDxe/IScsiImpl.h
NetworkPkg: Bug fix of iSCSI to support MPIO
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiImpl.h
CommitLineData
4c5a5e0c 1/** @file\r
2 The shared head file for iSCSI driver.\r
3\r
8873b174 4Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
4c5a5e0c 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
75dce340 26#include <Protocol/Ip6.h>\r
4c5a5e0c 27#include <Protocol/Dhcp4.h>\r
28#include <Protocol/Dhcp6.h>\r
29#include <Protocol/Tcp4.h>\r
30#include <Protocol/Tcp6.h>\r
31\r
32#include <Protocol/AuthenticationInfo.h>\r
33#include <Protocol/IScsiInitiatorName.h>\r
34#include <Protocol/ScsiPassThruExt.h>\r
8873b174 35#include <Protocol/AdapterInformation.h>\r
4c5a5e0c 36\r
37#include <Library/HiiLib.h>\r
38#include <Library/UefiHiiServicesLib.h>\r
39#include <Library/DevicePathLib.h>\r
40#include <Library/DebugLib.h>\r
41#include <Library/BaseLib.h>\r
42#include <Library/BaseMemoryLib.h>\r
43#include <Library/MemoryAllocationLib.h>\r
44#include <Library/PrintLib.h>\r
45#include <Library/UefiBootServicesTableLib.h>\r
46#include <Library/UefiRuntimeServicesTableLib.h>\r
47#include <Library/UefiLib.h>\r
48#include <Library/DpcLib.h>\r
49#include <Library/NetLib.h>\r
50#include <Library/TcpIoLib.h>\r
51#include <Library/BaseCryptLib.h>\r
52\r
53#include <Guid/MdeModuleHii.h>\r
54#include <Guid/EventGroup.h>\r
55#include <Guid/Acpi.h>\r
56\r
57#include "IScsiConfigNVDataStruc.h"\r
58#include "IScsiDriver.h"\r
59#include "IScsiProto.h"\r
60#include "IScsiCHAP.h"\r
61#include "IScsiDhcp.h"\r
62#include "IScsiDhcp6.h"\r
63#include "IScsiIbft.h"\r
64#include "IScsiMisc.h"\r
65#include "IScsiConfig.h"\r
66\r
67#define ISCSI_AUTH_INITIAL 0\r
68\r
69#define ISCSI_SESSION_SIGNATURE SIGNATURE_32 ('I', 'S', 'S', 'N')\r
70///\r
71/// 10 seconds\r
72///\r
73#define ISCSI_GET_MAPPING_TIMEOUT 100000000U\r
74///\r
75/// 3 seconds\r
76///\r
77#define ISCSI_WAIT_IPSEC_TIMEOUT 30000000U\r
78\r
79struct _ISCSI_SESSION {\r
80 UINT32 Signature;\r
81\r
82 ISCSI_DRIVER_DATA *Private;\r
83 ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;\r
84\r
85 UINT8 AuthType;\r
86 union {\r
87 ISCSI_CHAP_AUTH_DATA CHAP;\r
88 } AuthData;\r
89\r
90 UINT8 State;\r
91\r
92 UINT8 Isid[6];\r
93 UINT16 Tsih;\r
94\r
95 UINT32 CmdSN;\r
96 UINT32 ExpCmdSN;\r
97 UINT32 MaxCmdSN;\r
98\r
99 UINT32 InitiatorTaskTag;\r
100 UINT16 NextCid;\r
101\r
102 LIST_ENTRY Conns;\r
103 UINT32 NumConns;\r
104\r
105 LIST_ENTRY TcbList;\r
106\r
107 //\r
108 // Session-wide parameters\r
109 //\r
110 UINT16 TargetPortalGroupTag;\r
111 UINT32 MaxConnections;\r
112 BOOLEAN InitialR2T;\r
113 BOOLEAN ImmediateData;\r
114 UINT32 MaxBurstLength;\r
115 UINT32 FirstBurstLength;\r
116 UINT32 DefaultTime2Wait;\r
117 UINT32 DefaultTime2Retain;\r
118 UINT16 MaxOutstandingR2T;\r
119 BOOLEAN DataPDUInOrder;\r
120 BOOLEAN DataSequenceInOrder;\r
121 UINT8 ErrorRecoveryLevel;\r
122};\r
123\r
124#define ISCSI_CONNECTION_SIGNATURE SIGNATURE_32 ('I', 'S', 'C', 'N')\r
125\r
126struct _ISCSI_CONNECTION {\r
127 UINT32 Signature;\r
128 LIST_ENTRY Link;\r
129\r
130 EFI_EVENT TimeoutEvent;\r
131\r
132 ISCSI_SESSION *Session;\r
133\r
134 UINT8 State;\r
135 UINT8 CurrentStage;\r
136 UINT8 NextStage;\r
137\r
138 UINT8 AuthStep;\r
139\r
140 BOOLEAN PartialReqSent;\r
141 BOOLEAN PartialRspRcvd;\r
142\r
143 BOOLEAN TransitInitiated;\r
144 BOOLEAN ParamNegotiated;\r
145\r
146 UINT16 Cid;\r
147 UINT32 ExpStatSN;\r
148\r
149 //\r
150 // Queues...\r
151 //\r
152 NET_BUF_QUEUE RspQue;\r
153\r
154 BOOLEAN Ipv6Flag;\r
155 TCP_IO TcpIo;\r
156\r
157 //\r
158 // Connection-only parameters.\r
159 //\r
160 UINT32 MaxRecvDataSegmentLength;\r
161 ISCSI_DIGEST_TYPE HeaderDigest;\r
162 ISCSI_DIGEST_TYPE DataDigest;\r
163};\r
164\r
165#define ISCSI_DRIVER_DATA_SIGNATURE SIGNATURE_32 ('I', 'S', 'D', 'A')\r
166\r
167#define ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU(PassThru) \\r
168 CR ( \\r
169 PassThru, \\r
170 ISCSI_DRIVER_DATA, \\r
171 IScsiExtScsiPassThru, \\r
172 ISCSI_DRIVER_DATA_SIGNATURE \\r
173 )\r
174\r
175#define ISCSI_DRIVER_DATA_FROM_IDENTIFIER(Identifier) \\r
176 CR ( \\r
177 Identifier, \\r
178 ISCSI_DRIVER_DATA, \\r
179 IScsiIdentifier, \\r
180 ISCSI_DRIVER_DATA_SIGNATURE \\r
181 )\r
182\r
183struct _ISCSI_DRIVER_DATA {\r
184 UINT32 Signature;\r
185 EFI_HANDLE Image;\r
186 EFI_HANDLE Controller;\r
187 ISCSI_PRIVATE_PROTOCOL IScsiIdentifier;\r
188\r
189 EFI_EVENT ExitBootServiceEvent;\r
190\r
191 EFI_EXT_SCSI_PASS_THRU_PROTOCOL IScsiExtScsiPassThru;\r
192 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;\r
193 EFI_HANDLE ExtScsiPassThruHandle;\r
194 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
195 EFI_HANDLE ChildHandle; \r
196 ISCSI_SESSION *Session;\r
197};\r
198\r
199#endif\r