From 1e7b3ef63a16aa95261ca179727888245f506cbd Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Fri, 5 Feb 2016 10:15:37 +0800 Subject: [PATCH 1/2] MdeModulePkg: Make the DEBUG info consistent in SNP driver. SNP driver will print the UNDI returned StatFlags:StatCode with DEBUG macro, while in some please it uses the reverse order (StatCode:StatFlags). This patch is to make the print info consistent, that StatFlags always come first. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Jiaxin Wu Reviewed-by: Ye Ting --- MdeModulePkg/Universal/Network/SnpDxe/Get_status.c | 2 +- MdeModulePkg/Universal/Network/SnpDxe/Stop.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c index fad2e98212..4da07b503f 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c @@ -85,7 +85,7 @@ PxeGetStatus ( (EFI_D_NET, "\nSnp->undi.get_status() %xh:%xh\n", Snp->Cdb.StatFlags, - Snp->Cdb.StatFlags) + Snp->Cdb.StatCode) ); return EFI_DEVICE_ERROR; diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Stop.c b/MdeModulePkg/Universal/Network/SnpDxe/Stop.c index 730e397452..a52d3b1163 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Stop.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Stop.c @@ -1,7 +1,7 @@ /** @file Implementation of stopping a network interface. -Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. 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 @@ -51,8 +51,8 @@ PxeStop ( DEBUG ( (EFI_D_WARN, "\nsnp->undi.stop() %xh:%xh\n", - Snp->Cdb.StatCode, - Snp->Cdb.StatFlags) + Snp->Cdb.StatFlags, + Snp->Cdb.StatCode) ); return EFI_DEVICE_ERROR; From 3af347b3b8a02d6592681ce181da2c758deaa016 Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Fri, 5 Feb 2016 10:18:25 +0800 Subject: [PATCH 2/2] MdeModulePkg: SNP should check Cdb.StatCode with PXE_STATCODE_SUCCESS. This patch fixes a bug in SNP driver that the Cdb.StatCode should be check with PXE_STATCODE_SUCCESS instead of EFI_SUCCESS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Jiaxin Wu Reviewed-by: Ye Ting --- MdeModulePkg/Universal/Network/SnpDxe/Get_status.c | 2 +- MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c index 4da07b503f..edbc0f2374 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c @@ -80,7 +80,7 @@ PxeGetStatus ( (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); - if (Snp->Cdb.StatCode != EFI_SUCCESS) { + if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { DEBUG ( (EFI_D_NET, "\nSnp->undi.get_status() %xh:%xh\n", diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c b/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c index bb98f4c8a7..c37018c826 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c @@ -2,7 +2,7 @@ Implementation of managing the multicast receive filters of a network interface. -Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. 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 @@ -83,7 +83,7 @@ PxeRecvFilterEnable ( (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); - if (Snp->Cdb.StatCode != EFI_SUCCESS) { + if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { // // UNDI command failed. Return UNDI status to caller. // @@ -171,7 +171,7 @@ PxeRecvFilterDisable ( (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); - if (Snp->Cdb.StatCode != EFI_SUCCESS) { + if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { // // UNDI command failed. Return UNDI status to caller. // @@ -223,7 +223,7 @@ PxeRecvFilterRead ( (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); - if (Snp->Cdb.StatCode != EFI_SUCCESS) { + if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { // // UNDI command failed. Return UNDI status to caller. //