[Change summary]:
1. Update NetLib to a combined NetLib support dual network stack: 1) Add Network Debug facility for IPv4 stack. 2) Extend the library APIs to support IPv6 stack: a. NetIp6IsUnspecifiedAddr b. NetIp6IsLinkLocalAddr c. NetIp6IsNetEqual d. NetLibCreateIPv6DPathNode. e. NetIp6PseudoHeadChecksum f. NetIp6IsValidUnicast 3) Update the structure definitions: a. Update NET_BUF to add EFI_IP6_HEADER and EFI_UDP_HEADER b. Add NET_IP6_PSEUDO_HDR 4) Update Ip4IsUnicast to NetIp4IsUnicast 2. Update the impacted modules to adopt the combined NetLib. 3. Clean up coding style errors in all network drivers and libraries. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9391 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The header file of CHAP configuration.
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -37,13 +37,12 @@ extern EFI_GUID mIScsiCHAPAuthInfoGuid;
|
||||
/// MD5_HASHSIZE
|
||||
///
|
||||
#define ISCSI_CHAP_RSP_LEN 16
|
||||
typedef enum {
|
||||
ISCSI_CHAP_INITIAL,
|
||||
ISCSI_CHAP_STEP_ONE,
|
||||
ISCSI_CHAP_STEP_TWO,
|
||||
ISCSI_CHAP_STEP_THREE,
|
||||
ISCSI_CHAP_STEP_FOUR
|
||||
} ISCSI_CHAP_STEP;
|
||||
|
||||
#define ISCSI_CHAP_INITIAL 0
|
||||
#define ISCSI_CHAP_STEP_ONE 1
|
||||
#define ISCSI_CHAP_STEP_TWO 2
|
||||
#define ISCSI_CHAP_STEP_THREE 3
|
||||
#define ISCSI_CHAP_STEP_FOUR 4
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Helper functions for configuring or getting the parameters relating to iSCSI.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -544,7 +544,7 @@ IScsiFormCallback (
|
||||
case KEY_LOCAL_IP:
|
||||
IScsiUnicodeStrToAsciiStr (IfrNvData->LocalIp, Ip4String);
|
||||
Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);
|
||||
if (EFI_ERROR (Status) || !Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
} else {
|
||||
@@ -568,7 +568,7 @@ IScsiFormCallback (
|
||||
case KEY_GATE_WAY:
|
||||
IScsiUnicodeStrToAsciiStr (IfrNvData->Gateway, Ip4String);
|
||||
Status = IScsiAsciiStrToIp (Ip4String, &Gateway.v4);
|
||||
if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !Ip4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
|
||||
if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
} else {
|
||||
@@ -580,7 +580,7 @@ IScsiFormCallback (
|
||||
case KEY_TARGET_IP:
|
||||
IScsiUnicodeStrToAsciiStr (IfrNvData->TargetIp, Ip4String);
|
||||
Status = IScsiAsciiStrToIp (Ip4String, &HostIp.v4);
|
||||
if (EFI_ERROR (Status) || !Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
} else {
|
||||
@@ -678,7 +678,7 @@ IScsiFormCallback (
|
||||
//
|
||||
if (!Private->Current->SessionConfigData.TargetInfoFromDhcp) {
|
||||
CopyMem (&HostIp.v4, &Private->Current->SessionConfigData.TargetIp, sizeof (HostIp.v4));
|
||||
if (!Ip4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
if (!NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Target IP is invalid!", NULL);
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
iSCSI DHCP related configuration routines.
|
||||
|
||||
Copyright (c) 2004 - 2007, 2009, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -38,7 +38,7 @@ IScsiDhcpExtractRootPath (
|
||||
CHAR8 *TmpStr;
|
||||
ISCSI_ROOT_PATH_FIELD Fields[RP_FIELD_IDX_MAX];
|
||||
ISCSI_ROOT_PATH_FIELD *Field;
|
||||
RP_FIELD_IDX FieldIndex;
|
||||
UINT32 FieldIndex;
|
||||
UINT8 Index;
|
||||
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The header file of IScsiDhcp.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -26,14 +26,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define ISCSI_ROOT_PATH_ID "iscsi:"
|
||||
#define ISCSI_ROOT_PATH_FIELD_DELIMITER ':'
|
||||
|
||||
typedef enum {
|
||||
RP_FIELD_IDX_SERVERNAME = 0,
|
||||
RP_FIELD_IDX_PROTOCOL,
|
||||
RP_FIELD_IDX_PORT,
|
||||
RP_FIELD_IDX_LUN,
|
||||
RP_FIELD_IDX_TARGETNAME,
|
||||
RP_FIELD_IDX_MAX
|
||||
} RP_FIELD_IDX;
|
||||
#define RP_FIELD_IDX_SERVERNAME 0
|
||||
#define RP_FIELD_IDX_PROTOCOL 1
|
||||
#define RP_FIELD_IDX_PORT 2
|
||||
#define RP_FIELD_IDX_LUN 3
|
||||
#define RP_FIELD_IDX_TARGETNAME 4
|
||||
#define RP_FIELD_IDX_MAX 5
|
||||
|
||||
typedef struct _ISCSI_ROOT_PATH_FIELD {
|
||||
CHAR8 *Str;
|
||||
|
@@ -20,7 +20,9 @@ UINTN mTableKey;
|
||||
/**
|
||||
Initialize the header of the iSCSI Boot Firmware Table.
|
||||
|
||||
@param[out] Header The header of the iSCSI Boot Firmware Table.
|
||||
@param[out] Header The header of the iSCSI Boot Firmware Table.
|
||||
@param[in] OemId The OEM ID.
|
||||
@param[in] OemTableId The OEM table ID for the iBFT.
|
||||
**/
|
||||
VOID
|
||||
IScsiInitIbfTableHeader (
|
||||
|
@@ -126,7 +126,7 @@ IScsiAsciiStrToLun (
|
||||
UINTN Index, IndexValue, IndexNum, SizeStr;
|
||||
CHAR8 TemStr[2];
|
||||
UINT8 TemValue;
|
||||
UINT16 Value [4];
|
||||
UINT16 Value[4];
|
||||
|
||||
ZeroMem (Lun, 8);
|
||||
ZeroMem (TemStr, 2);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The implementation of iSCSI protocol based on RFC3720.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -225,8 +225,8 @@ IScsiCreateConnection (
|
||||
// set the default connection-only parameters
|
||||
//
|
||||
Conn->MaxRecvDataSegmentLength = DEFAULT_MAX_RECV_DATA_SEG_LEN;
|
||||
Conn->HeaderDigest = ISCSI_DIGEST_NONE;
|
||||
Conn->DataDigest = ISCSI_DIGEST_NONE;
|
||||
Conn->HeaderDigest = IScsiDigestNone;
|
||||
Conn->DataDigest = IScsiDigestNone;
|
||||
|
||||
CopyMem (&Tcp4IoConfig.LocalIp, &Session->ConfigData.NvData.LocalIp, sizeof (EFI_IPv4_ADDRESS));
|
||||
CopyMem (&Tcp4IoConfig.SubnetMask, &Session->ConfigData.NvData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
|
||||
@@ -1146,11 +1146,11 @@ IScsiCheckOpParams (
|
||||
}
|
||||
|
||||
if (AsciiStrCmp (Value, "CRC32") == 0) {
|
||||
if (Conn->HeaderDigest != ISCSI_DIGEST_CRC32) {
|
||||
if (Conn->HeaderDigest != IScsiDigestCRC32) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
} else if (AsciiStrCmp (Value, ISCSI_KEY_VALUE_NONE) == 0) {
|
||||
Conn->HeaderDigest = ISCSI_DIGEST_NONE;
|
||||
Conn->HeaderDigest = IScsiDigestNone;
|
||||
} else {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
@@ -1163,11 +1163,11 @@ IScsiCheckOpParams (
|
||||
}
|
||||
|
||||
if (AsciiStrCmp (Value, "CRC32") == 0) {
|
||||
if (Conn->DataDigest != ISCSI_DIGEST_CRC32) {
|
||||
if (Conn->DataDigest != IScsiDigestCRC32) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
} else if (AsciiStrCmp (Value, ISCSI_KEY_VALUE_NONE) == 0) {
|
||||
Conn->DataDigest = ISCSI_DIGEST_NONE;
|
||||
Conn->DataDigest = IScsiDigestNone;
|
||||
} else {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
@@ -1361,10 +1361,10 @@ IScsiFillOpParams (
|
||||
|
||||
Session = Conn->Session;
|
||||
|
||||
AsciiSPrint (Value, sizeof (Value), "%a", (Conn->HeaderDigest == ISCSI_DIGEST_CRC32) ? "None,CRC32" : "None");
|
||||
AsciiSPrint (Value, sizeof (Value), "%a", (Conn->HeaderDigest == IScsiDigestCRC32) ? "None,CRC32" : "None");
|
||||
IScsiAddKeyValuePair (Pdu, ISCSI_KEY_HEADER_DIGEST, Value);
|
||||
|
||||
AsciiSPrint (Value, sizeof (Value), "%a", (Conn->DataDigest == ISCSI_DIGEST_CRC32) ? "None,CRC32" : "None");
|
||||
AsciiSPrint (Value, sizeof (Value), "%a", (Conn->DataDigest == IScsiDigestCRC32) ? "None,CRC32" : "None");
|
||||
IScsiAddKeyValuePair (Pdu, ISCSI_KEY_DATA_DIGEST, Value);
|
||||
|
||||
AsciiSPrint (Value, sizeof (Value), "%d", Session->ErrorRecoveryLevel);
|
||||
@@ -1854,7 +1854,7 @@ IScsiNewScsiCmdPdu (
|
||||
ScsiCmd->CmdSN = NTOHL (Tcb->CmdSN);
|
||||
ScsiCmd->ExpStatSN = NTOHL (Tcb->Conn->ExpStatSN);
|
||||
|
||||
CopyMem (ScsiCmd->CDB, Packet->Cdb, sizeof (ScsiCmd->CDB));
|
||||
CopyMem (ScsiCmd->Cdb, Packet->Cdb, sizeof (ScsiCmd->Cdb));
|
||||
|
||||
if (Packet->CdbLength > 16) {
|
||||
Header->Length = NTOHS (Packet->CdbLength - 15);
|
||||
@@ -2258,7 +2258,7 @@ IScsiOnR2TRcvd (
|
||||
R2THdr->InitiatorTaskTag = NTOHL (R2THdr->InitiatorTaskTag);
|
||||
R2THdr->TargetTransferTag = NTOHL (R2THdr->TargetTransferTag);
|
||||
R2THdr->StatSN = NTOHL (R2THdr->StatSN);
|
||||
R2THdr->R2TSN = NTOHL (R2THdr->R2TSN);
|
||||
R2THdr->R2TSeqNum = NTOHL (R2THdr->R2TSeqNum);
|
||||
R2THdr->BufferOffset = NTOHL (R2THdr->BufferOffset);
|
||||
R2THdr->DesiredDataTransferLength = NTOHL (R2THdr->DesiredDataTransferLength);
|
||||
|
||||
@@ -2268,7 +2268,7 @@ IScsiOnR2TRcvd (
|
||||
//
|
||||
// Check the sequence number.
|
||||
//
|
||||
Status = IScsiCheckSN (&Tcb->ExpDataSN, R2THdr->R2TSN);
|
||||
Status = IScsiCheckSN (&Tcb->ExpDataSN, R2THdr->R2TSeqNum);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The header file of iSCSI Protocol that defines many specific data structures.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation.<BR>
|
||||
Copyright (c) 2004 - 2009, Intel Corporation.<BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
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
|
||||
@@ -75,25 +75,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
///
|
||||
/// connection state for initiator
|
||||
///
|
||||
typedef enum {
|
||||
CONN_STATE_FREE,
|
||||
CONN_STATE_XPT_WAIT,
|
||||
CONN_STATE_IN_LOGIN,
|
||||
CONN_STATE_LOGGED_IN,
|
||||
CONN_STATE_IN_LOGOUT,
|
||||
CONN_STATE_LOGOUT_REQUESTED,
|
||||
CONN_STATE_CLEANUP_WAIT,
|
||||
CONN_STATE_IN_CLEANUP
|
||||
} CONNECTION_STATE;
|
||||
|
||||
#define CONN_STATE_FREE 0
|
||||
#define CONN_STATE_XPT_WAIT 1
|
||||
#define CONN_STATE_IN_LOGIN 2
|
||||
#define CONN_STATE_LOGGED_IN 3
|
||||
#define CONN_STATE_IN_LOGOUT 4
|
||||
#define CONN_STATE_LOGOUT_REQUESTED 5
|
||||
#define CONN_STATE_CLEANUP_WAIT 6
|
||||
#define CONN_STATE_IN_CLEANUP 7
|
||||
|
||||
///
|
||||
/// session state for initiator
|
||||
///
|
||||
typedef enum {
|
||||
SESSION_STATE_FREE,
|
||||
SESSION_STATE_LOGGED_IN,
|
||||
SESSION_STATE_FAILED
|
||||
} SESSION_STATE;
|
||||
#define SESSION_STATE_FREE 0
|
||||
#define SESSION_STATE_LOGGED_IN 1
|
||||
#define SESSION_STATE_FAILED 2
|
||||
|
||||
typedef enum {
|
||||
DataIn = 0,
|
||||
@@ -227,7 +224,7 @@ typedef struct _SCSI_COMMAND {
|
||||
UINT32 ExpDataXferLength;
|
||||
UINT32 CmdSN;
|
||||
UINT32 ExpStatSN;
|
||||
UINT8 CDB[16];
|
||||
UINT8 Cdb[16];
|
||||
} SCSI_COMMAND;
|
||||
|
||||
//
|
||||
@@ -378,7 +375,7 @@ typedef struct _ISCSI_READY_TO_TRANSFER {
|
||||
UINT32 StatSN;
|
||||
UINT32 ExpCmdSN;
|
||||
UINT32 MaxCmdSN;
|
||||
UINT32 R2TSN;
|
||||
UINT32 R2TSeqNum;
|
||||
UINT32 BufferOffset;
|
||||
UINT32 DesiredDataTransferLength;
|
||||
} ISCSI_READY_TO_TRANSFER;
|
||||
@@ -586,8 +583,8 @@ typedef struct _ISCSI_NOP_IN {
|
||||
#define ISCSI_FULL_FEATURE_PHASE 3
|
||||
|
||||
typedef enum {
|
||||
ISCSI_DIGEST_NONE,
|
||||
ISCSI_DIGEST_CRC32
|
||||
IScsiDigestNone,
|
||||
IScsiDigestCRC32
|
||||
} ISCSI_DIGEST_TYPE;
|
||||
|
||||
typedef struct _ISCSI_XFER_CONTEXT {
|
||||
|
Reference in New Issue
Block a user