2008-04-17 10:28:51 +02:00
|
|
|
/** @file
|
2008-12-10 04:32:55 +01:00
|
|
|
The header file of IScsiImpl.c.
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2010-04-24 11:33:45 +02:00
|
|
|
Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
2008-01-22 09:07:35 +01:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
**/
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
#ifndef _ISCSI_IMPL_H_
|
|
|
|
#define _ISCSI_IMPL_H_
|
|
|
|
|
2008-10-14 17:34:00 +02:00
|
|
|
#include <Uefi.h>
|
|
|
|
|
2009-05-21 01:15:47 +02:00
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
2007-12-24 03:20:21 +01:00
|
|
|
#include <Library/NetLib.h>
|
|
|
|
#include <Library/PrintLib.h>
|
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
2009-02-03 12:09:53 +01:00
|
|
|
|
|
|
|
#include <Guid/EventGroup.h>
|
2009-07-06 05:06:50 +02:00
|
|
|
#include <Guid/Acpi.h>
|
2009-02-03 12:09:53 +01:00
|
|
|
|
2007-12-24 03:20:21 +01:00
|
|
|
#include "IScsiCommon.h"
|
|
|
|
#include "IScsiDriver.h"
|
2008-12-17 19:01:32 +01:00
|
|
|
#include "IScsiInitiatorName.h"
|
2008-12-16 09:10:07 +01:00
|
|
|
#include "ComponentName.h"
|
2007-12-24 03:20:21 +01:00
|
|
|
#include "IScsiConfigNVDataStruc.h"
|
|
|
|
#include "IScsiExtScsiPassThru.h"
|
|
|
|
#include "IScsiProto.h"
|
2008-12-10 04:32:55 +01:00
|
|
|
#include "IScsiMisc.h"
|
2007-12-24 03:20:21 +01:00
|
|
|
#include "IScsiCHAP.h"
|
2008-12-10 04:32:55 +01:00
|
|
|
#include "IScsiConfig.h"
|
2007-12-24 03:20:21 +01:00
|
|
|
#include "IScsiDhcp.h"
|
|
|
|
#include "IScsiTcp4Io.h"
|
|
|
|
#include "IScsiIbft.h"
|
2008-12-10 04:32:55 +01:00
|
|
|
|
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define ISCSI_SESSION_SIGNATURE SIGNATURE_32 ('I', 'S', 'S', 'N')
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-01-22 08:14:48 +01:00
|
|
|
struct _ISCSI_SESSION {
|
2007-12-24 03:20:21 +01:00
|
|
|
UINT32 Signature;
|
|
|
|
|
|
|
|
ISCSI_SESSION_CONFIG_DATA ConfigData;
|
|
|
|
ISCSI_CHAP_AUTH_DATA AuthData;
|
|
|
|
|
|
|
|
CHAR8 InitiatorName[ISCSI_NAME_MAX_SIZE];
|
|
|
|
UINTN InitiatorNameLength;
|
|
|
|
UINT8 State;
|
|
|
|
|
2009-03-26 03:40:48 +01:00
|
|
|
UINT8 Isid[6];
|
|
|
|
UINT16 Tsih;
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
UINT32 CmdSN;
|
|
|
|
UINT32 ExpCmdSN;
|
|
|
|
UINT32 MaxCmdSN;
|
|
|
|
|
|
|
|
UINT32 InitiatorTaskTag;
|
2009-03-26 03:40:48 +01:00
|
|
|
UINT16 NextCid;
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Conns;
|
2007-12-24 03:20:21 +01:00
|
|
|
UINT32 NumConns;
|
|
|
|
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY TcbList;
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// session-wide parameters
|
|
|
|
//
|
|
|
|
UINT16 TargetPortalGroupTag;
|
|
|
|
UINT32 MaxConnections;
|
|
|
|
BOOLEAN InitialR2T;
|
|
|
|
BOOLEAN ImmediateData;
|
|
|
|
UINT32 MaxBurstLength;
|
|
|
|
UINT32 FirstBurstLength;
|
|
|
|
UINT32 DefaultTime2Wait;
|
|
|
|
UINT32 DefaultTime2Retain;
|
|
|
|
UINT16 MaxOutstandingR2T;
|
|
|
|
BOOLEAN DataPDUInOrder;
|
|
|
|
BOOLEAN DataSequenceInOrder;
|
|
|
|
UINT8 ErrorRecoveryLevel;
|
2008-01-22 08:14:48 +01:00
|
|
|
};
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define ISCSI_CONNECTION_SIGNATURE SIGNATURE_32 ('I', 'S', 'C', 'N')
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-01-22 08:14:48 +01:00
|
|
|
struct _ISCSI_CONNECTION {
|
2007-12-24 03:20:21 +01:00
|
|
|
UINT32 Signature;
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Link;
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
EFI_EVENT TimeoutEvent;
|
|
|
|
|
|
|
|
ISCSI_SESSION *Session;
|
|
|
|
|
|
|
|
UINT8 State;
|
|
|
|
UINT8 CurrentStage;
|
|
|
|
UINT8 NextStage;
|
|
|
|
|
|
|
|
UINT8 CHAPStep;
|
|
|
|
|
|
|
|
BOOLEAN PartialReqSent;
|
|
|
|
BOOLEAN PartialRspRcvd;
|
|
|
|
|
|
|
|
BOOLEAN TransitInitiated;
|
|
|
|
|
2009-03-26 03:40:48 +01:00
|
|
|
UINT16 Cid;
|
2007-12-24 03:20:21 +01:00
|
|
|
UINT32 ExpStatSN;
|
|
|
|
|
|
|
|
//
|
|
|
|
// queues...
|
|
|
|
//
|
|
|
|
NET_BUF_QUEUE RspQue;
|
|
|
|
|
|
|
|
TCP4_IO Tcp4Io;
|
|
|
|
|
|
|
|
//
|
|
|
|
// connection-only parameters
|
|
|
|
//
|
|
|
|
UINT32 MaxRecvDataSegmentLength;
|
|
|
|
ISCSI_DIGEST_TYPE HeaderDigest;
|
|
|
|
ISCSI_DIGEST_TYPE DataDigest;
|
2008-01-22 08:14:48 +01:00
|
|
|
};
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define ISCSI_DRIVER_DATA_SIGNATURE SIGNATURE_32 ('I', 'S', 'D', 'A')
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
#define ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU(PassThru) \
|
|
|
|
CR ( \
|
|
|
|
PassThru, \
|
|
|
|
ISCSI_DRIVER_DATA, \
|
|
|
|
IScsiExtScsiPassThru, \
|
|
|
|
ISCSI_DRIVER_DATA_SIGNATURE \
|
|
|
|
)
|
|
|
|
#define ISCSI_DRIVER_DATA_FROM_IDENTIFIER(Identifier) \
|
|
|
|
CR ( \
|
|
|
|
Identifier, \
|
|
|
|
ISCSI_DRIVER_DATA, \
|
|
|
|
IScsiIdentifier, \
|
|
|
|
ISCSI_DRIVER_DATA_SIGNATURE \
|
|
|
|
)
|
|
|
|
#define ISCSI_DRIVER_DATA_FROM_SESSION(s) \
|
|
|
|
CR ( \
|
|
|
|
s, \
|
|
|
|
ISCSI_DRIVER_DATA, \
|
|
|
|
Session, \
|
|
|
|
ISCSI_DRIVER_DATA_SIGNATURE \
|
|
|
|
)
|
|
|
|
|
2008-01-22 08:14:48 +01:00
|
|
|
struct _ISCSI_DRIVER_DATA {
|
2007-12-24 03:20:21 +01:00
|
|
|
UINT32 Signature;
|
|
|
|
EFI_HANDLE Image;
|
|
|
|
EFI_HANDLE Controller;
|
|
|
|
ISCSI_PRIVATE_PROTOCOL IScsiIdentifier;
|
|
|
|
|
|
|
|
EFI_EVENT ExitBootServiceEvent;
|
|
|
|
|
|
|
|
EFI_EXT_SCSI_PASS_THRU_PROTOCOL IScsiExtScsiPassThru;
|
|
|
|
EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;
|
|
|
|
EFI_HANDLE ExtScsiPassThruHandle;
|
|
|
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
|
|
|
|
|
|
|
ISCSI_SESSION Session;
|
2008-01-22 08:14:48 +01:00
|
|
|
};
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
#endif
|