Update ISID to fixed value: first 3 bytes are derived from MAC address while the other 3 bytes are configurable via ISCSI configuration.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11507 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
tye1
2011-04-06 07:19:38 +00:00
parent f3c5971626
commit 312e3bdfcc
7 changed files with 162 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
/** @file
The implementation of iSCSI protocol based on RFC3720.
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -302,6 +302,11 @@ IScsiSessionLogin (
return EFI_NO_MEDIA;
}
//
// Set session identifier
//
CopyMem (Session->Isid, Session->ConfigData.NvData.IsId, 6);
//
// Create a connection for the session.
//
@@ -2681,21 +2686,10 @@ IScsiSessionInit (
IN BOOLEAN Recovery
)
{
UINT32 Random;
if (!Recovery) {
Session->Signature = ISCSI_SESSION_SIGNATURE;
Session->State = SESSION_STATE_FREE;
Random = NET_RANDOM (NetRandomInitSeed ());
Session->Isid[0] = ISID_BYTE_0;
Session->Isid[1] = ISID_BYTE_1;
Session->Isid[2] = ISID_BYTE_2;
Session->Isid[3] = ISID_BYTE_3;
Session->Isid[4] = (UINT8) Random;
Session->Isid[5] = (UINT8) (Random >> 8);
InitializeListHead (&Session->Conns);
InitializeListHead (&Session->TcbList);
}