--- /dev/null
+/** @file\r
+ The shared head file for iSCSI driver.\r
+\r
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _ISCSI_IMPL_H_\r
+#define _ISCSI_IMPL_H_\r
+\r
+#include <Uefi.h>\r
+\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/ComponentName2.h>\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
+\r
+#include <Protocol/Dhcp4.h>\r
+#include <Protocol/Dhcp6.h>\r
+#include <Protocol/Tcp4.h>\r
+#include <Protocol/Tcp6.h>\r
+\r
+#include <Protocol/AuthenticationInfo.h>\r
+#include <Protocol/IScsiInitiatorName.h>\r
+#include <Protocol/ScsiPassThruExt.h>\r
+\r
+#include <Library/HiiLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/DpcLib.h>\r
+#include <Library/NetLib.h>\r
+#include <Library/TcpIoLib.h>\r
+#include <Library/BaseCryptLib.h>\r
+\r
+#include <Guid/MdeModuleHii.h>\r
+#include <Guid/EventGroup.h>\r
+#include <Guid/Acpi.h>\r
+\r
+#include "IScsiConfigNVDataStruc.h"\r
+#include "IScsiDriver.h"\r
+#include "IScsiProto.h"\r
+#include "IScsiCHAP.h"\r
+#include "IScsiDhcp.h"\r
+#include "IScsiDhcp6.h"\r
+#include "IScsiIbft.h"\r
+#include "IScsiMisc.h"\r
+#include "IScsiConfig.h"\r
+\r
+#define ISCSI_AUTH_INITIAL 0\r
+\r
+#define ISCSI_SESSION_SIGNATURE SIGNATURE_32 ('I', 'S', 'S', 'N')\r
+///\r
+/// 10 seconds\r
+///\r
+#define ISCSI_GET_MAPPING_TIMEOUT 100000000U\r
+///\r
+/// 3 seconds\r
+///\r
+#define ISCSI_WAIT_IPSEC_TIMEOUT 30000000U\r
+\r
+struct _ISCSI_SESSION {\r
+ UINT32 Signature;\r
+\r
+ ISCSI_DRIVER_DATA *Private;\r
+ ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;\r
+\r
+ UINT8 AuthType;\r
+ union {\r
+ ISCSI_CHAP_AUTH_DATA CHAP;\r
+ } AuthData;\r
+\r
+ UINT8 State;\r
+\r
+ UINT8 Isid[6];\r
+ UINT16 Tsih;\r
+\r
+ UINT32 CmdSN;\r
+ UINT32 ExpCmdSN;\r
+ UINT32 MaxCmdSN;\r
+\r
+ UINT32 InitiatorTaskTag;\r
+ UINT16 NextCid;\r
+\r
+ LIST_ENTRY Conns;\r
+ UINT32 NumConns;\r
+\r
+ LIST_ENTRY TcbList;\r
+\r
+ //\r
+ // Session-wide parameters\r
+ //\r
+ UINT16 TargetPortalGroupTag;\r
+ UINT32 MaxConnections;\r
+ BOOLEAN InitialR2T;\r
+ BOOLEAN ImmediateData;\r
+ UINT32 MaxBurstLength;\r
+ UINT32 FirstBurstLength;\r
+ UINT32 DefaultTime2Wait;\r
+ UINT32 DefaultTime2Retain;\r
+ UINT16 MaxOutstandingR2T;\r
+ BOOLEAN DataPDUInOrder;\r
+ BOOLEAN DataSequenceInOrder;\r
+ UINT8 ErrorRecoveryLevel;\r
+};\r
+\r
+#define ISCSI_CONNECTION_SIGNATURE SIGNATURE_32 ('I', 'S', 'C', 'N')\r
+\r
+struct _ISCSI_CONNECTION {\r
+ UINT32 Signature;\r
+ LIST_ENTRY Link;\r
+\r
+ EFI_EVENT TimeoutEvent;\r
+\r
+ ISCSI_SESSION *Session;\r
+\r
+ UINT8 State;\r
+ UINT8 CurrentStage;\r
+ UINT8 NextStage;\r
+\r
+ UINT8 AuthStep;\r
+\r
+ BOOLEAN PartialReqSent;\r
+ BOOLEAN PartialRspRcvd;\r
+\r
+ BOOLEAN TransitInitiated;\r
+ BOOLEAN ParamNegotiated;\r
+\r
+ UINT16 Cid;\r
+ UINT32 ExpStatSN;\r
+\r
+ //\r
+ // Queues...\r
+ //\r
+ NET_BUF_QUEUE RspQue;\r
+\r
+ BOOLEAN Ipv6Flag;\r
+ TCP_IO TcpIo;\r
+\r
+ //\r
+ // Connection-only parameters.\r
+ //\r
+ UINT32 MaxRecvDataSegmentLength;\r
+ ISCSI_DIGEST_TYPE HeaderDigest;\r
+ ISCSI_DIGEST_TYPE DataDigest;\r
+};\r
+\r
+#define ISCSI_DRIVER_DATA_SIGNATURE SIGNATURE_32 ('I', 'S', 'D', 'A')\r
+\r
+#define ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU(PassThru) \\r
+ CR ( \\r
+ PassThru, \\r
+ ISCSI_DRIVER_DATA, \\r
+ IScsiExtScsiPassThru, \\r
+ ISCSI_DRIVER_DATA_SIGNATURE \\r
+ )\r
+\r
+#define ISCSI_DRIVER_DATA_FROM_IDENTIFIER(Identifier) \\r
+ CR ( \\r
+ Identifier, \\r
+ ISCSI_DRIVER_DATA, \\r
+ IScsiIdentifier, \\r
+ ISCSI_DRIVER_DATA_SIGNATURE \\r
+ )\r
+\r
+struct _ISCSI_DRIVER_DATA {\r
+ UINT32 Signature;\r
+ EFI_HANDLE Image;\r
+ EFI_HANDLE Controller;\r
+ ISCSI_PRIVATE_PROTOCOL IScsiIdentifier;\r
+\r
+ EFI_EVENT ExitBootServiceEvent;\r
+\r
+ EFI_EXT_SCSI_PASS_THRU_PROTOCOL IScsiExtScsiPassThru;\r
+ EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;\r
+ EFI_HANDLE ExtScsiPassThruHandle;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+ EFI_HANDLE ChildHandle; \r
+ ISCSI_SESSION *Session;\r
+};\r
+\r
+#endif\r