From 5af5b3fd84da60fe0ebe2fd3cbab4a2f79bdbec4 Mon Sep 17 00:00:00 2001 From: ywu21 Date: Tue, 16 Dec 2008 07:17:19 +0000 Subject: [PATCH] 1) fix one goto issue in IScsiProto.c 2) add Md5.h in [Sources.common] of inf 3) change mIScsiPrivateGuid to gIScsiPrivateGuid git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7042 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c | 10 +++++----- MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h | 3 +-- MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf | 1 + MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c | 6 +++--- MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c | 10 +++++++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c index dd4068be6e..7e7512f041 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c @@ -23,7 +23,7 @@ EFI_DRIVER_BINDING_PROTOCOL gIScsiDriverBinding = { NULL }; -EFI_GUID mIScsiPrivateGuid = ISCSI_PRIVATE_GUID; +EFI_GUID gIScsiPrivateGuid = ISCSI_PRIVATE_GUID; /** @@ -63,7 +63,7 @@ IScsiDriverBindingSupported ( Status = gBS->OpenProtocol ( ControllerHandle, - &mIScsiPrivateGuid, + &gIScsiPrivateGuid, NULL, This->DriverBindingHandle, ControllerHandle, @@ -195,7 +195,7 @@ IScsiDriverBindingStart ( // Status = gBS->InstallProtocolInterface ( &ControllerHandle, - &mIScsiPrivateGuid, + &gIScsiPrivateGuid, EFI_NATIVE_INTERFACE, &Private->IScsiIdentifier ); @@ -299,7 +299,7 @@ IScsiDriverBindingStop ( Status = gBS->OpenProtocol ( IScsiController, - &mIScsiPrivateGuid, + &gIScsiPrivateGuid, (VOID **)&IScsiIdentifier, This->DriverBindingHandle, ControllerHandle, @@ -316,7 +316,7 @@ IScsiDriverBindingStop ( // gBS->UninstallProtocolInterface ( IScsiController, - &mIScsiPrivateGuid, + &gIScsiPrivateGuid, &Private->IScsiIdentifier ); diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h index 810462454d..78f0c446ee 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h @@ -41,8 +41,7 @@ extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName; extern EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName; - -extern EFI_GUID mIScsiPrivateGuid; +extern EFI_GUID gIScsiPrivateGuid; typedef struct _ISCSI_PRIVATE_PROTOCOL { UINT32 Reserved; diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf index e6b497e01b..dd71a80f56 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf @@ -41,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. IScsiDhcp.h IScsiCommon.h IScsiCHAP.h + Md5.h IScsiTcp4Io.c IScsiProto.c IScsiMisc.c diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c index 83824331ba..ac978a2a40 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c @@ -140,7 +140,7 @@ IScsiFillInitiatorSection ( // // Get the identifier from the handle. // - Status = gBS->HandleProtocol (Handle, &mIScsiPrivateGuid, (VOID **) &IScsiIdentifier); + Status = gBS->HandleProtocol (Handle, &gIScsiPrivateGuid, (VOID **) &IScsiIdentifier); if (EFI_ERROR (Status)) { ASSERT (FALSE); return ; @@ -302,7 +302,7 @@ IScsiFillNICAndTargetSections ( SectionOffset = &Control->NIC0Offset; for (Index = 0; Index < HandleCount; Index++) { - Status = gBS->HandleProtocol (Handles[Index], &mIScsiPrivateGuid, (VOID **)&IScsiIdentifier); + Status = gBS->HandleProtocol (Handles[Index], &gIScsiPrivateGuid, (VOID **)&IScsiIdentifier); if (EFI_ERROR (Status)) { ASSERT (FALSE); return ; @@ -495,7 +495,7 @@ IScsiPublishIbft ( // Status = gBS->LocateHandleBuffer ( ByProtocol, - &mIScsiPrivateGuid, + &gIScsiPrivateGuid, NULL, &HandleCount, &HandleBuffer diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c index 06b60da9b1..adf8d9a3c1 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c @@ -971,9 +971,14 @@ IScsiReceivePdu ( Len = ISCSI_GET_DATASEG_LEN (Header); if (Len == 0) { // - // No data segment. + // No data segment.Form the pdu from a list of pdu segments. // - goto FORM_PDU; + *Pdu = NetbufFromBufList (NbufList, 0, 0, IScsiFreeNbufList, NbufList); + if (*Pdu == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ON_EXIT; + } + return Status; } // // Get the length of the padding bytes of the data segment. @@ -1067,7 +1072,6 @@ IScsiReceivePdu ( NetbufTrim (DataSeg, PadLen, NET_BUF_TAIL); } -FORM_PDU: // // Form the pdu from a list of pdu segments. //