2 The shared head file for iSCSI driver.
4 Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _ISCSI_IMPL_H_
16 #define _ISCSI_IMPL_H_
20 #include <Protocol/ComponentName.h>
21 #include <Protocol/ComponentName2.h>
22 #include <Protocol/DriverBinding.h>
23 #include <Protocol/DevicePath.h>
24 #include <Protocol/HiiConfigAccess.h>
26 #include <Protocol/Ip6.h>
27 #include <Protocol/Dhcp4.h>
28 #include <Protocol/Dhcp6.h>
29 #include <Protocol/Tcp4.h>
30 #include <Protocol/Tcp6.h>
32 #include <Protocol/AuthenticationInfo.h>
33 #include <Protocol/IScsiInitiatorName.h>
34 #include <Protocol/ScsiPassThruExt.h>
36 #include <Library/HiiLib.h>
37 #include <Library/UefiHiiServicesLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/DebugLib.h>
40 #include <Library/BaseLib.h>
41 #include <Library/BaseMemoryLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/PrintLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
45 #include <Library/UefiRuntimeServicesTableLib.h>
46 #include <Library/UefiLib.h>
47 #include <Library/DpcLib.h>
48 #include <Library/NetLib.h>
49 #include <Library/TcpIoLib.h>
50 #include <Library/BaseCryptLib.h>
52 #include <Guid/MdeModuleHii.h>
53 #include <Guid/EventGroup.h>
54 #include <Guid/Acpi.h>
56 #include "IScsiConfigNVDataStruc.h"
57 #include "IScsiDriver.h"
58 #include "IScsiProto.h"
59 #include "IScsiCHAP.h"
60 #include "IScsiDhcp.h"
61 #include "IScsiDhcp6.h"
62 #include "IScsiIbft.h"
63 #include "IScsiMisc.h"
64 #include "IScsiConfig.h"
66 #define ISCSI_AUTH_INITIAL 0
68 #define ISCSI_SESSION_SIGNATURE SIGNATURE_32 ('I', 'S', 'S', 'N')
72 #define ISCSI_GET_MAPPING_TIMEOUT 100000000U
76 #define ISCSI_WAIT_IPSEC_TIMEOUT 30000000U
78 struct _ISCSI_SESSION
{
81 ISCSI_DRIVER_DATA
*Private
;
82 ISCSI_ATTEMPT_CONFIG_NVDATA
*ConfigData
;
86 ISCSI_CHAP_AUTH_DATA CHAP
;
98 UINT32 InitiatorTaskTag
;
107 // Session-wide parameters
109 UINT16 TargetPortalGroupTag
;
110 UINT32 MaxConnections
;
112 BOOLEAN ImmediateData
;
113 UINT32 MaxBurstLength
;
114 UINT32 FirstBurstLength
;
115 UINT32 DefaultTime2Wait
;
116 UINT32 DefaultTime2Retain
;
117 UINT16 MaxOutstandingR2T
;
118 BOOLEAN DataPDUInOrder
;
119 BOOLEAN DataSequenceInOrder
;
120 UINT8 ErrorRecoveryLevel
;
123 #define ISCSI_CONNECTION_SIGNATURE SIGNATURE_32 ('I', 'S', 'C', 'N')
125 struct _ISCSI_CONNECTION
{
129 EFI_EVENT TimeoutEvent
;
131 ISCSI_SESSION
*Session
;
139 BOOLEAN PartialReqSent
;
140 BOOLEAN PartialRspRcvd
;
142 BOOLEAN TransitInitiated
;
143 BOOLEAN ParamNegotiated
;
151 NET_BUF_QUEUE RspQue
;
157 // Connection-only parameters.
159 UINT32 MaxRecvDataSegmentLength
;
160 ISCSI_DIGEST_TYPE HeaderDigest
;
161 ISCSI_DIGEST_TYPE DataDigest
;
164 #define ISCSI_DRIVER_DATA_SIGNATURE SIGNATURE_32 ('I', 'S', 'D', 'A')
166 #define ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU(PassThru) \
170 IScsiExtScsiPassThru, \
171 ISCSI_DRIVER_DATA_SIGNATURE \
174 #define ISCSI_DRIVER_DATA_FROM_IDENTIFIER(Identifier) \
179 ISCSI_DRIVER_DATA_SIGNATURE \
182 struct _ISCSI_DRIVER_DATA
{
185 EFI_HANDLE Controller
;
186 ISCSI_PRIVATE_PROTOCOL IScsiIdentifier
;
188 EFI_EVENT ExitBootServiceEvent
;
190 EFI_EXT_SCSI_PASS_THRU_PROTOCOL IScsiExtScsiPassThru
;
191 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode
;
192 EFI_HANDLE ExtScsiPassThruHandle
;
193 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
194 EFI_HANDLE ChildHandle
;
195 ISCSI_SESSION
*Session
;