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