From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 60784AC1A29 for ; Wed, 5 Jun 2024 19:27:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=XR5D5shrRur4Bjp7OlIRxo4GAik3qCwLLMnyzSVjTNw=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:Authentication-Results-Original:nodisclaimer:MIME-Version:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1717615656; v=1; b=wfkLKHeFpUgLJGsfAT5uzx4tpVuX6Yw/JM9VeVPnW76gUT16HjGVYd+aAZW87FbOWKP+KsXg bPT892x1o2522kroZ3eRDfmDwLnWJcUwnDAYvJoC1LvvoZpIR8T9Fpi++WgIxzuKndcjymhzC+0 UnllImI1AoYOYf1C02LgbtaqNcKNb3cRotlf/L0rvCsEwqL6/saC7/iT6RXus4ldfonJk0aW9v7 m9gWwT4FLESn1UNex2p9EiAfvHjeC4imsz7oQI3A6sTIzyQWVlzizZNOnc4aQ8m/Mqq3ZLlMJYI h6QXEgT7WaO23DfGiKkdtGu24FV3b08Kcya2z9SSMVPxw== X-Received: by 127.0.0.2 with SMTP id a0JRYY7687511xFdcGeM91fb; Wed, 05 Jun 2024 12:27:34 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.89]) by mx.groups.io with SMTP id smtpd.web11.3138.1717615652656255648 for ; Wed, 05 Jun 2024 12:27:34 -0700 X-Received: from DUZPR01CA0278.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b9::23) by GV1PR08MB11028.eurprd08.prod.outlook.com (2603:10a6:150:1ee::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Wed, 5 Jun 2024 19:27:24 +0000 X-Received: from DB1PEPF000509FF.eurprd03.prod.outlook.com (2603:10a6:10:4b9:cafe::84) by DUZPR01CA0278.outlook.office365.com (2603:10a6:10:4b9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.16 via Frontend Transport; Wed, 5 Jun 2024 19:27:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB1PEPF000509FF.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 5 Jun 2024 19:27:23 +0000 X-Received: ("Tessian outbound eccca8f339e8:v327"); Wed, 05 Jun 2024 19:27:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9220624f5a6c1935 X-CR-MTA-TID: 64aa7808 X-Received: from 0c2a6cb9571f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 611C01FC-39F5-4F22-9CF3-87B5147666D5.1; Wed, 05 Jun 2024 19:27:11 +0000 X-Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0c2a6cb9571f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 05 Jun 2024 19:27:11 +0000 X-Received: from AM0PR08MB4483.eurprd08.prod.outlook.com (2603:10a6:208:145::21) by AS8PR08MB6615.eurprd08.prod.outlook.com (2603:10a6:20b:335::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Wed, 5 Jun 2024 19:27:07 +0000 X-Received: from AM0PR08MB4483.eurprd08.prod.outlook.com ([fe80::e255:8a54:7149:ee5c]) by AM0PR08MB4483.eurprd08.prod.outlook.com ([fe80::e255:8a54:7149:ee5c%4]) with mapi id 15.20.7633.021; Wed, 5 Jun 2024 19:27:07 +0000 From: "Prachotan Bathi" To: Sunny Wang , "devel@edk2.groups.io" CC: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen , Samer El-Haj-Mahmoud , Eric Jin , Arvin Chen , Supreeth Venkatesh Subject: Re: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT improvement - Print out the PCIe device path fo.. Thread-Topic: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT improvement - Print out the PCIe device path fo.. Thread-Index: AQHat25R2ho7bas1wEeaFMzZnVILvrG5jZ0F Date: Wed, 5 Jun 2024 19:27:07 +0000 Message-ID: References: <20240603182749.246451-1-prachotan.bathi@arm.com> <20240603182749.246451-2-prachotan.bathi@arm.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AM0PR08MB4483:EE_|AS8PR08MB6615:EE_|DB1PEPF000509FF:EE_|GV1PR08MB11028:EE_ X-MS-Office365-Filtering-Correlation-Id: 391071a0-1ba1-4fd9-0552-08dc85958678 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230031|69100299006|1800799015|376005|366007|38070700009; X-Microsoft-Antispam-Message-Info-Original: =?us-ascii?Q?hnnF9pmmIdr2SZkFxkTylvcw4dMKSnBHAiQ+JvbmHnK5qRwpnYjfZ6jsjyX0?= =?us-ascii?Q?zThRRFEwGtY00UoQxkkVB5neIy7ENP92SH8BuhdxNRzK2jFzNUagj8yr0GXV?= =?us-ascii?Q?qarq9DWtKRS2o9bB6TGb2s7i03hwbMTJWSJE9pPsctHq8eqioIQ57NLL5BGc?= =?us-ascii?Q?5U9/dQxZo49z6RjoVQwhiQtVWu799cMqKChAwcTSLy3QTBi+Ak2L5etV8aoh?= =?us-ascii?Q?oII2xSDzSWy+Zgj0AKEVSgo9wtAHmClPaFVY7mIoFhBpu24rS4ep7kWGYm1U?= =?us-ascii?Q?flNMmRlsSavBwsUipzMLmvqCWiTlkbmpimiT40eG+4wiOov/IrwtM5YAAiIn?= =?us-ascii?Q?oHVQIDUzDa/e8b3G9Czewhd648wgWfiOXanvaqNbGs+6CdWzLtQ4DcmJp2O+?= =?us-ascii?Q?jJheHDEQkDE/C6PR2viIyXeht+y0YU/o4eCMosPfWMDjMBjePE/jCRxGPS1G?= =?us-ascii?Q?x+yOHcUrGIAKzhhXuH7814/rXQ+RtG7VA3HXZIGntWpT+hfnmjxqYoWSawrg?= =?us-ascii?Q?Q/F8vYHGL1ao0IcoIoB5MQ/0mU9peFqilNyo9tH1KM44ntScYQ+mBTOEEdKM?= =?us-ascii?Q?cJWzOSbLY39d2p683XE5fZy8rWZqQyi4VFn1NHbrGXGltByQeHBiv9Jcp6Hl?= =?us-ascii?Q?3zUh/zaTMTd9WPpYmTbGDrJL8KqhcDnRSESEZDLOFA+VSCsZvi6YHZ8KWEIV?= =?us-ascii?Q?9CPZPl39m9QJXhsZ+9OZUxyN/oBlZ0r+DVJCw5RKiVGzOkst3q4WovXSgU9N?= =?us-ascii?Q?xTFCtA1xOEmM45UI6EEm9A+JP9rshJAmzNxPR9Y1PZfAyAU4CTL/Nft2Cw3b?= =?us-ascii?Q?GUh81mqPISj6h4DJ5TT6kl+1nXgN2IBHVjPT95qA41c0i65Qp3PjWjMiLD2v?= =?us-ascii?Q?FXF0EaYINw6Ezcmsv1OwYFcRN3zaX8rc1pcjGTy6vUsJT7W3JK7kH5ZPosxP?= =?us-ascii?Q?UUEvLujYC1THxpkMvZl5pOSHf+IGtAvrY0G0BYXAQqrgjdrCqtw0DNUYZBDr?= =?us-ascii?Q?YgZzYe+5BZGLseMILTvlNZ7/Q1GRBEjx27o682PddGYjhC9Xkwtx1TDlhqqn?= =?us-ascii?Q?88SDLmLje4ULSf3RY42g9nm+CnlUzDog5DSjsbinPXk45XC3HWE+YTzqY7ep?= =?us-ascii?Q?LUIpknoKSm1M933mgq2MREQatFKV+TLn9ZuyRdfXLvFnLgkhUAFYHaMloOR/?= =?us-ascii?Q?wLHM9s2Zwpqn37d5bboos1yIUP9j1hSyguWw2MJDje1pncCHlTCyG7JxWVQv?= =?us-ascii?Q?CatUflYEhmvzFIZ3CvtnKgqSpcIjIL31QezummkqUwcwiBoLwq+Uqr2ZN/VL?= =?us-ascii?Q?ABhixPtmdLZc6eWsp8TebJMa?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4483.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(69100299006)(1800799015)(376005)(366007)(38070700009);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6615 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509FF.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 182ca9eb-b931-45ab-b22a-08dc85957ce9 X-Microsoft-Antispam-Message-Info: =?Windows-1252?Q?VxRDgX6NjhceDoJbCsb3Y0nZoGwffVBFOtRVDG911BtyQ1tXCaN2z0h3?= =?Windows-1252?Q?jcYkVjNG/xqpKWjfsXxGefZ4klAC3mTurTiVtvcbBNZXLliN47iuK6JO?= =?Windows-1252?Q?czPKMIZWsWs+NyrA+AB8Vby/kkQN1pNM+ZvB+uLBxKN8iAEFnjPDIwA3?= =?Windows-1252?Q?J++CgNnABwltlFj/waQ4AQyFJgTY1xmV0JL9F2wxxh/ISodFsEameSPD?= =?Windows-1252?Q?mzRA1uwFMCV2SgzGdC52uJpytEL463bK9ohxDOJw73ER8omRcvPq7sAj?= =?Windows-1252?Q?wGMj7O1y2RuG4XptYWzb4fiJb2VDkI4rjtbGCI/hOzfjwCurHTLNWPvv?= =?Windows-1252?Q?LxJtp4DiIZfC5nmCNvcwIe0pjsCNTN17+aYQN+bHshJky/x37bAtewV/?= =?Windows-1252?Q?ssYkI3XLkdHtNATnrVlaVB/fnCs01NyIJFkrqlRMMJgt8tXWmv3L/WCn?= =?Windows-1252?Q?N8rKxU+UMm9ulnya5NlQvKArmkWilthd3A2fE51+uM4EzRoldVk4rnjB?= =?Windows-1252?Q?INRzVpnETVW/CIcwxUffskxyV5S9XmKeUk68Iy7XleygKHKQ8Mn0pfy1?= =?Windows-1252?Q?GrMlIVO3rzGVj2HiGfpPUji0QhOJPzrHCT6gJERdIVrJk+9f/BSGj5lO?= =?Windows-1252?Q?zxHm+1APr7YPLgVa0AiAXVCgmbUWbo7hPCEH7n07kO3+b8RqBKNdWEAx?= =?Windows-1252?Q?sLU1mENowFKj5e8jAyPwzC869dnhR/X8T9JmXs+Xlny1yNx7hBMPhcOp?= =?Windows-1252?Q?XkF1zD+oONBvNVJNgDuNA6Zsr964xloHmJV5fk0fYk0c/bj1CiQTc3Oz?= =?Windows-1252?Q?M9qCTOJ1RW4zfG2duBuwjdf0KIaSSiX7jHUCUDQ1WRfF+mOAQuptUUmC?= =?Windows-1252?Q?am9Y66pnx5QeGubUqOIvjOWECleUvsfAxMlGHwyVjoEXvQ/FPW+53bmx?= =?Windows-1252?Q?FXYXNYQS6fSjq3bUzcI+lAwSw8D1D3+m/eDIFQBCnlapQr6wsKVNba0m?= =?Windows-1252?Q?ZItZOO+Q6mlFnZzrK5z5Kbr785n5ImmcrtBVbaEAikNQJDJAW5MY8IKE?= =?Windows-1252?Q?29Cz3lBWlr3MS15LNpNbYYoNTW31NhF1KlQU/mJFD4Px1Ua7Hmn9BA31?= =?Windows-1252?Q?BPiRAhvspZ2n6sswvf8yypc4blOk6xyprtQYhi4Kk+TWFURwjURsGTNy?= =?Windows-1252?Q?mt/GUgfh7Q6XxXbOOlRB6qqWeoj1gAr/bEBZN3dLXW9rSKlCFNfTf2ru?= =?Windows-1252?Q?V+dR7oMo+GpQbBwMP+cf1aH/n58UN9mblJ7GOduFG/XU0ZX5HIRcrvcE?= =?Windows-1252?Q?EqZn9jd7r3lPEDZ6ot3LEfp/ziv5Iil3QWwPlBA26bzq95Wz9KX05cju?= =?Windows-1252?Q?MbUV0U4BuICN+MK2Qijsy4imJCeq+3Uv6n27hIPTvCe38gVpTZnWgCW8?= =?Windows-1252?Q?gYpdWggjN/LB1W/SxjQd7g=3D=3D?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 19:27:23.2245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 391071a0-1ba1-4fd9-0552-08dc85958678 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509FF.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB11028 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 05 Jun 2024 12:27:34 -0700 Resent-From: prachotan.bathi@arm.com Reply-To: devel@edk2.groups.io,prachotan.bathi@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: RZBT4CvQVHcETwZPR4NoYPL9x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_AM0PR08MB44831A4DEC9D384FA71C0579EFF92AM0PR08MB4483eurp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=wfkLKHeF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_AM0PR08MB44831A4DEC9D384FA71C0579EFF92AM0PR08MB4483eurp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Sunny Thanks for reviewing. Here's the updated PR for your review: https://github.com/tianocore/edk2-test/pull/96 [https://opengraph.githubassets.com/f2f41b8e5ab4b752bd722613f51dc6ea43cf452= 487d02210da33e18645b38eda/tianocore/edk2-test/pull/96] EDK2-Test: Bug 4244 - SCT improvement - Print out the PCIe device pat=85 by= PrachotanReddy =B7 Pull Request #96 =B7 tianocore/edk2-test https://bugzilla.tianocore.org/show_bug.cgi?id=3D4244 Tests Modified: Adapt= erInfoBBTestConformance HIIConfigAccessBBTestConformance PxeBaseCodeBBTestC= onformance SimpleNetworkBBTestConformance UEFI-SC... github.com ________________________________ From: Sunny Wang Sent: Wednesday, June 5, 2024 12:32 PM To: devel@edk2.groups.io ; Prachotan Bathi Cc: G Edhaya Chandran ; Barton Gao ; Carolyn Gjertsen ; Samer El-Haj-Mahmoud= ; Eric Jin ; Arvin Chen = ; Supreeth Venkatesh ; S= unny Wang Subject: RE: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT improvem= ent - Print out the PCIe device path fo.. Thanks for working on this, @Prachotan Bathi I directly reviewed and added comments on pull request. https://github.com/= tianocore/edk2-test/pull/96 Best Regards, Sunny -----Original Message----- From: devel@edk2.groups.io On Behalf Of Prachotan Ba= thi via groups.io Sent: Monday, June 3, 2024 1:28 PM To: devel@edk2.groups.io Cc: G Edhaya Chandran ; Barton Gao ; Carolyn Gjertsen ; Samer El-Haj-Mahmoud= ; Eric Jin ; Arvin Chen = ; Supreeth Venkatesh Subject: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT improvement = - Print out the PCIe device path fo.. Tests Modified: AdapterInfoBBTestConformance ComponentName2BBTestConformance HIIConfigAccessBBTestConformance PxeBaseCodeBBTestConformance SimpleNetworkBBTestConformance UEFI-SCT Cc: G Edhaya Chandran Cc: Barton Gao Cc: Carolyn Gjertsen Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Supreeth Venkatesh Signed-off-by: Prachotan Bathi --- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/Adapte= rInfoProtocolBBTest.inf | 2 + uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/PxeBBT= est.inf | 3 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simp= leNetworkBBTest.inf | 4 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/Adapte= rInfoBBTestMain.h | 17 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HI= IConfigAccessBBTestMain.h | 6 + uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/PxeBas= eCodeBBTestMain.h | 6 + uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simp= leNetworkBBTestMain.h | 6 + uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/Adapte= rInfoBBTestConformance.c | 63 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/Adapte= rInfoBBTestMain.c | 96 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HI= IConfigAccessBBTestConformance.c | 48 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HI= IConfigAccessBBTestMain.c | 67 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/PxeBas= eCodeBBTestConformance.c | 305 +++++- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/PxeBas= eCodeBBTestMain.c | 1158 +++++++++----------- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simp= leNetworkBBTestConformance.c | 258 ++++- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simp= leNetworkBBTestMain.c | 96 ++ 15 files changed, 1451 insertions(+), 684 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoProtocolBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pro= tocol/AdapterInfo/BlackBoxTest/AdapterInfoProtocolBBTest.inf index b3bf99440705..464029ec10ce 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoProtocolBBTest.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoProtocolBBTest.inf @@ -49,3 +49,5 @@ [LibraryClasses] EfiTestLib [Protocols] + gEfiAdapterInformationProtocolGuid + gBlackBoxEfiDevicePathProtocolGuid \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCod= e/BlackBoxTest/PxeBBTest.inf index 41367ce496b3..29392ca83dca 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBBTest.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBBTest.inf @@ -57,4 +57,5 @@ [Protocols] gEfiTestLoggingLibraryGuid gBlackBoxEfiSimpleNetworkProtocolGuid gBlackBoxEfiPxeBaseCodeProtocolGuid - gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid + gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid + gBlackBoxEfiDevicePathProtocolGuid diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protoco= l/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTest.inf index 1d2d1d395fbb..14b24173f311 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTest.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTest.inf @@ -51,4 +51,6 @@ [LibraryClasses] EfiTestLib [Protocols] - gEfiTestLoggingLibraryGuid + gEfiTestLoggingLibraryGuid + gBlackBoxEfiSimpleNetworkProtocolGuid + gBlackBoxEfiDevicePathProtocolGuid \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= AdapterInfo/BlackBoxTest/AdapterInfoBBTestMain.h index 9952fbcab833..a1ef9db3b127 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.h @@ -28,9 +28,11 @@ Abstract: #define _ADAPTER_INFORMATION_BB_TEST_MAIN #include "Efi.h" +#include +#include "SctLib.h" +#include "Guid.h" #include #include -#include "Guid.h" #define EFI_ADAPTER_INFORMATION_PROTOCOL_TEST_REVISION 0x00010000 @@ -160,12 +162,9 @@ BBTestGetSupportedTypesFunctionTest ( IN EFI_HANDLE SupportHandle ); - -VOID -SctInitializeLib ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - - +EFI_STATUS +LocateDevicePathFromAdapterInfo( + IN EFI_ADAPTER_INFORMATION_PROTOCOL *AdapterInfo2, + IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib); #endif diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.h index 0e17954d7762..812698779f12 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h @@ -148,6 +148,12 @@ GetDevicePath ( OUT EFI_STRING *DevicePathStr ); +EFI_STATUS +GetDevicePathProtocol ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, + IN EFI_DEVICE_PATH_PROTOCOL **DevicePath + ); + EFI_STATUS GetCorrespondingRequest ( IN EFI_STRING MultiConfigAltResp, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestMain.h index b94f200ff7aa..dfef671824f2 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.h @@ -578,6 +578,12 @@ LogChar8String( IN UINTN Len ); +EFI_STATUS +LocateDevicePathFromBcInterface ( + IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface2, + IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, //reuse t= he EFI_DEVICE_PATH_PROTOCOL as EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib + ); // // Entry GUIDs // diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Proto= col/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestMain.h index ea14aaa77963..60ffabe257ee 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.h @@ -357,6 +357,12 @@ BBTestReceiveConformanceTest ( IN EFI_HANDLE SupportHandle ); +EFI_STATUS +LocateDevicePathFromSnpInterface ( + IN EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface2, + IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, //reuse t= he EFI_DEVICE_PATH_PROTOCOL as EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib + ); // // Prototypes of Internal Functions diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pr= otocol/AdapterInfo/BlackBoxTest/AdapterInfoBBTestConformance.c index 19ccac93c7c7..7317e53ff1fc 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestConformance.c @@ -93,7 +93,8 @@ BBTestGetInformationConformanceTest ( EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; EFI_ADAPTER_INFORMATION_PROTOCOL *AdapterInfo; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // init // @@ -111,6 +112,25 @@ BBTestGetInformationConformanceTest ( return Status; } + Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } + + // //Call check points // @@ -137,7 +157,8 @@ BBTestSetInformationConformanceTest ( EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; EFI_ADAPTER_INFORMATION_PROTOCOL *AdapterInfo; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // init // @@ -155,6 +176,23 @@ BBTestSetInformationConformanceTest ( return Status; } + Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // //Call check points // @@ -178,7 +216,8 @@ BBTestGetSupportedTypesConformanceTest ( EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; EFI_ADAPTER_INFORMATION_PROTOCOL *AdapterInfo; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // init // @@ -195,7 +234,23 @@ BBTestGetSupportedTypesConformanceTest ( if ( EFI_ERROR(Status) ) { return Status; } - + Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // //Call check points // diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= AdapterInfo/BlackBoxTest/AdapterInfoBBTestMain.c index cc37a497614e..8e884b4374e7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.c @@ -207,3 +207,99 @@ UnloadAdapterInfoBBTest ( gBBTestProtocolInterface ); } + +EFI_STATUS LocateDevicePathFromAdapterInfo(IN EFI_ADAPTER_INFORMATION_PROT= OCOL *AdapterInfo2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDA= RD_TEST_LIBRARY_PROTOCOL *StandardLib) +{ + EFI_STATUS Status; + + UINTN NoHandles, Index; + EFI_HANDLE *HandleBuffer; + EFI_ADAPTER_INFORMATION_PROTOCOL *OtherAdapterInfo2; + + // + // Locate the Handle that the AdapterInfo is bound to + // + Status =3D gtBS->LocateHandleBuffer( + ByProtocol, + &gEfiAdapterInformationProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + return Status; + } + + if (NoHandles <=3D 0) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Device Error", + __FILE__, + (UINTN)__LINE__); + return EFI_DEVICE_ERROR; + } + + // + // Find the exact handle that AdapterInfo bound to + // + for (Index =3D 0; Index < NoHandles; Index++) + { + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gEfiAdapterInformationProtocolGuid, + (VOID **) &OtherAdapterInfo2); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - HandleProtocol", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + + gtBS->FreePool(HandleBuffer); + return Status; + } + + if (OtherAdapterInfo2 =3D=3D AdapterInfo2) + { + break; + } + } + + // + // Locate the Loaded DevicePath Protocol bound to ADAPTER_INFORMATION Pr= otocol + // + if (Index >=3D NoHandles) + { + // + // No Handle Found!! + // + gtBS->FreePool(HandleBuffer); + return EFI_DEVICE_ERROR; + } + + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiDevicePathProtocolGuid, + (VOID **) DevicePath); + + gtBS->FreePool(HandleBuffer); + return Status; +} \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConformanc= e.c index 964a64cd1d34..16ca0b323914 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c @@ -120,7 +120,8 @@ BBTestExtractConfigConformanceTest ( EFI_STATUS Status; EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // init // @@ -137,6 +138,28 @@ BBTestExtractConfigConformanceTest ( if (EFI_ERROR(Status)) { return Status; } + // + // Get Loaded Device Path of current EFI_HII_CONFIG_ACCESS_PROTOCOL + // And out put device path or device name + // + + Status =3D GetDevicePathProtocol(HIIConfigAccess,&DevicePath); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Get the Config Routing Protocol Interface @@ -170,7 +193,8 @@ BBTestRouteConfigConformanceTest ( EFI_STATUS Status; EFI_HII_CONFIG_ACCESS_PROTOCOL *HIIConfigAccess; EFI_HII_CONFIG_ROUTING_PROTOCOL *HIIConfigRouting; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // init // @@ -187,7 +211,23 @@ BBTestRouteConfigConformanceTest ( if (EFI_ERROR(Status)) { return Status; } - + Status =3D GetDevicePathProtocol(HIIConfigAccess,&DevicePath); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Get the Config Routing Protocol Interface // @@ -195,7 +235,7 @@ BBTestRouteConfigConformanceTest ( if ( EFI_ERROR(Status) ) { return Status; } - + // //Call check points // diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c index 099b10f7a38a..2929d8f04c26 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c @@ -381,6 +381,71 @@ GetDevicePath ( return Status; } +EFI_STATUS +GetDevicePathProtocol ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, + IN EFI_DEVICE_PATH_PROTOCOL **DevicePath + ) +{ + EFI_STATUS Status; + UINTN Index; + UINTN NoHandles; + EFI_HANDLE *HandleBuffer; + EFI_HANDLE ConfigAccessHandle =3D NULL; + EFI_HII_CONFIG_ACCESS_PROTOCOL *TestedConfigAccess; + UINTN Length; + UINTN PathHdrSize; + + // + // locate all Hii Configuration Access Protocol Instances + // + Status =3D gtBS->LocateHandleBuffer ( + ByProtocol, + &gBlackBoxEfiHIIConfigAccessProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer + ); + if (EFI_ERROR(Status) || (NoHandles =3D=3D 0)) { + return EFI_NOT_FOUND; + } + + // + // scan for the handle that matched with the Hii Configuration Access Pr= otocol that + // passed in by the test framework + // + for (Index =3D 0; Index < NoHandles; Index++) { + Status =3D gtBS->HandleProtocol ( + HandleBuffer[Index], + &gBlackBoxEfiHIIConfigAccessProtocolGuid, + (VOID **) &TestedConfigAccess + ); + if (EFI_ERROR(Status)) { + continue; + } + + if (TestedConfigAccess =3D=3D ConfigAccess) { + ConfigAccessHandle =3D HandleBuffer[Index]; + break; + } + } + + gtBS->FreePool (HandleBuffer); + + if (ConfigAccessHandle =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + // + // find controller handles managed by the component name handle. + // + Status =3D gtBS->HandleProtocol ( + ConfigAccessHandle, + &gBlackBoxEfiDevicePathProtocolGuid, + (void **)DevicePath + ); + return Status; +} EFI_STATUS GetCorrespondingRequest ( @@ -654,4 +719,4 @@ MultiAltRespToMultiReq ( SctFreePool (FreePtr); return EFI_SUCCESS; -} +} \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pr= otocol/PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestConformance.c index d03eb850c5ad..77b5afe388a3 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestConformance.c @@ -50,6 +50,8 @@ BBTestNewStartConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -68,7 +70,23 @@ BBTestNewStartConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface // @@ -237,6 +255,8 @@ BBTestNewStopConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -255,7 +275,23 @@ BBTestNewStopConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface // @@ -418,6 +454,8 @@ BBTestStartConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -436,7 +474,23 @@ BBTestStartConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol state to enabled // @@ -522,6 +576,8 @@ BBTestStopConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -540,7 +596,23 @@ BBTestStopConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Make sure the EFI_PXE_BASE_CODE_PROTOCOL Protocol is disabled // @@ -606,6 +678,8 @@ BBTestDhcpConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -624,7 +698,23 @@ BBTestDhcpConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol to disabled // @@ -791,6 +881,8 @@ BBTestDiscoverConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -809,7 +901,23 @@ BBTestDiscoverConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol to disabled // @@ -988,6 +1096,8 @@ BBTestMtftpConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; UINTN BlockSize=3D512; EFI_IP_ADDRESS ServerIp; CHAR8 *FileName; @@ -1013,7 +1123,23 @@ BBTestMtftpConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Fill Parameters (ServerIp, FileName, BufferPtr) // Get parameter from ini file. @@ -1473,6 +1599,8 @@ BBTestUdpWriteConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; EFI_IP_ADDRESS DestIp; EFI_PXE_BASE_CODE_UDP_PORT DestPort; UINTN BufferSize; @@ -1501,7 +1629,23 @@ BBTestUdpWriteConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { @@ -1689,6 +1833,8 @@ BBTestUdpReadConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; UINT16 OpFlags; UINTN BufferSize; VOID *BufferPtr; @@ -1713,7 +1859,23 @@ BBTestUdpReadConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Malloc for data BufferSize =3D MAX_UDP_SIZE; Status =3D gtBS->AllocatePool (EfiBootServicesData, BufferSize, (VOID **= ) &BufferPtr); @@ -2004,6 +2166,8 @@ BBTestSetIpFilterConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; EFI_PXE_BASE_CODE_IP_FILTER BcIpFilter; // @@ -2023,7 +2187,23 @@ BBTestSetIpFilterConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { @@ -2083,11 +2263,12 @@ BBTestArpConformanceAutoTest ( EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; - EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_IP_ADDRESS IpAddr; + EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - // // Get support library (Standard Lib, Profile Lib, Logging Lib) // @@ -2110,7 +2291,23 @@ BBTestArpConformanceAutoTest ( ); return Status; } - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface // @@ -2130,7 +2327,7 @@ BBTestArpConformanceAutoTest ( return Status; } } - + // // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in Ipv4 // @@ -2232,6 +2429,8 @@ BBTestArpConformanceManualTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; EFI_IP_ADDRESS IpAddr; EFI_MAC_ADDRESS MacAddr; EFI_INI_FILE_HANDLE FileHandle; @@ -2263,7 +2462,23 @@ BBTestArpConformanceManualTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { @@ -2452,6 +2667,8 @@ BBTestSetParametersConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -2470,7 +2687,23 @@ BBTestSetParametersConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { @@ -2531,6 +2764,8 @@ BBTestSetStationIpConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -2549,7 +2784,23 @@ BBTestSetStationIpConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { @@ -2603,6 +2854,8 @@ BBTestSetPacketsConformanceTest ( EFI_STATUS Status; EFI_TEST_ASSERTION AssertionType; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface @@ -2621,7 +2874,23 @@ BBTestSetPacketsConformanceTest ( // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be tested // BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface; - + Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePath,Standar= dLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->Mode->Starte= d, FALSE); if (EFI_ERROR(Status)) { diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestMain.c index a2db1fb77e51..191f46002230 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.c @@ -5,12 +5,12 @@ This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e found at + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - + **/ /*++ @@ -28,316 +28,94 @@ Abstract: #include "PxeBaseCodeBBTestMain.h" #include "PxeBaseCodeBBTestSupport.h" -EFI_EVENT TimerEvent; -UINTN gCallBackInvoked; -EFI_PXE_BASE_CODE_FUNCTION gFunction; -EFI_PXE_CALLBACK gOldCallBack; -EFI_HANDLE gHandle; +EFI_EVENT TimerEvent; +UINTN gCallBackInvoked; +EFI_PXE_BASE_CODE_FUNCTION gFunction; +EFI_PXE_CALLBACK gOldCallBack; +EFI_HANDLE gHandle; EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL NewCallBackProtocol =3D { - EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION, - NewCallBack -}; + EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION, + NewCallBack}; EFI_BB_TEST_PROTOCOL_FIELD gEfiPxeBcTestProtField =3D { - PXE_BASE_CODE_TEST_REVISION, - EFI_PXE_BASE_CODE_PROTOCOL_GUID, - L"PXE Base Code Protocol Test", - L"Test PXE Base Code Protocol" -}; + PXE_BASE_CODE_TEST_REVISION, + EFI_PXE_BASE_CODE_PROTOCOL_GUID, + L"PXE Base Code Protocol Test", + L"Test PXE Base Code Protocol"}; EFI_GUID gSupportProtocolGuid1[] =3D { - EFI_STANDARD_TEST_LIBRARY_GUID, - EFI_NULL_GUID -}; + EFI_STANDARD_TEST_LIBRARY_GUID, + EFI_NULL_GUID}; EFI_BB_TEST_ENTRY_FIELD gPxeTestEntryField[] =3D { - { - PXE_START_FUNCTION_TEST_GUID, - L"Start_Func", - L"Function Test of Start", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestNewStartFunctionTest - }, - { - PXE_STOP_FUNCTION_TEST_GUID, - L"Stop_Func", - L"Function Test of Stop", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestNewStopFunctionTest - }, - { - PXE_SETIPFILTER_FUNCTION_TEST_GUID, - L"SetIpFilter_Func", - L"Function Test of SetIpFilter", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestSetIpFilterFunctionTest - }, - { - PXE_START_CONFORMANCE_TEST_GUID, - L"Start_Conf", - L"Conformance Test for Start", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestNewStartConformanceTest - }, - { - PXE_STOP_CONFORMANCE_TEST_GUID, - L"Stop_Conf", - L"Conformance Test for Stop", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestNewStopConformanceTest - }, - { - PXE_ARP_CONFORMANCE_AUTO_TEST_GUID, - L"Arp_Conf", - L"Auto Conformance Test for Arp", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestArpConformanceAutoTest - }, - -#ifdef EFI_TEST_EXHAUSTIVE //Switch off the 5 old test case + {PXE_START_FUNCTION_TEST_GUID, + L"Start_Func", + L"Function Test of Start", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestNewStartFunctionTest}, + {PXE_STOP_FUNCTION_TEST_GUID, + L"Stop_Func", + L"Function Test of Stop", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestNewStopFunctionTest}, + {PXE_SETIPFILTER_FUNCTION_TEST_GUID, + L"SetIpFilter_Func", + L"Function Test of SetIpFilter", + EFI_TEST_LEVEL_DEFAULT, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestSetIpFilterFunctionTest}, + {PXE_START_CONFORMANCE_TEST_GUID, + L"Start_Conf", + L"Conformance Test for Start", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestNewStartConformanceTest}, + {PXE_STOP_CONFORMANCE_TEST_GUID, + L"Stop_Conf", + L"Conformance Test for Stop", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestNewStopConformanceTest}, + {PXE_ARP_CONFORMANCE_AUTO_TEST_GUID, + L"Arp_Conf", + L"Auto Conformance Test for Arp", + EFI_TEST_LEVEL_MINIMAL, + gSupportProtocolGuid1, + EFI_TEST_CASE_AUTO, + BBTestArpConformanceAutoTest}, + +#ifdef EFI_TEST_EXHAUSTIVE // Switch off the 5 old test case PXE_START_FUNCTION_TEST_GUID, L"Start_Func", L"Function Test of Start", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, - BBTestStartFunctionTest - }, - { - PXE_STOP_FUNCTION_TEST_GUID, - L"Stop_Func", - L"Function Test of Stop", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestStopFunctionTest - }, - { - PXE_SETIPFILTER_FUNCTION_TEST_GUID, - L"SetIpFilter_Func", - L"Function Test of SetIpFilter", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestSetIpFilterFunctionTest - }, - { - PXE_START_CONFORMANCE_TEST_GUID, - L"Start_Conf", - L"Conformance Test for Start", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestStartConformanceTest - }, - { - PXE_STOP_CONFORMANCE_TEST_GUID, - L"Stop_Conf", - L"Conformance Test for Stop", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_AUTO, - BBTestStopConformanceTest - }, + BBTestStartFunctionTest}, + {PXE_STOP_FUNCTION_TEST_GUID, L"Stop_Func", L"Func= tion Test of Stop", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST= _CASE_AUTO, BBTestStopFunctionTest}, {PXE_SETIPFILTER_FUNCTION_TEST_GUID, L= "SetIpFilter_Func", L"Function Test of SetIpFilter", EFI_TEST_LEVEL_DEFAULT= , gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, BBTestSetIpFilterFunctionTest}= , {PXE_START_CONFORMANCE_TEST_GUID, L"Start_Conf", L"Conformance Test for S= tart", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, B= BTestStartConformanceTest}, {PXE_STOP_CONFORMANCE_TEST_GUID, L"Stop_Conf", = L"Conformance Test for Stop", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1= , EFI_TEST_CASE_AUTO, BBTestStopConformanceTest}, -//#ifdef EFI_TEST_EXHAUSTIVE - { - PXE_DHCP_FUNCTION_TEST_GUID, - L"Dhcp_Func_Manual", - L"Manual Function Test of Dhcp", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestDhcpFunctionTest - }, - { - PXE_DISCOVER_FUNCTION_TEST_GUID, - L"Discover_Func_Manual", - L"Manual Function Test of Discover", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestDiscoverFunctionTest - }, - { - PXE_MTFTP_FUNCTION_TEST_GUID, - L"Mtftp_Func_Manual", - L"Manual Function Test of Mtftp", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestMtftpFunctionTest - }, - { - PXE_UDPWRITE_FUNCTION_TEST_GUID, - L"UdpWrite_Func_Manual", - L"Manual Function Test of UdpWrite", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestUdpWriteFunctionTest - }, - { - PXE_UDPREAD_FUNCTION_TEST_GUID, - L"UdpRead_Func_Manual", - L"Manual Function Test of UdpRead", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestUdpReadFunctionTest - }, - { - PXE_ARP_FUNCTION_TEST_GUID, - L"Arp_Func_Manual", - L"Manual Function Test of Arp", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestArpFunctionTest - }, - { - PXE_SETPARAMETERS_FUNCTION_TEST_GUID, - L"SetParameters_Func_Manual", - L"Manual Function Test of SetParameters", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetParametersFunctionTest - }, - { - PXE_SETSTATIONIP_FUNCTION_TEST_GUID, - L"SetStationIp_Func_Manual", - L"Manual Function Test of SetStationIp", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetStationIpFunctionTest - }, - { - PXE_SETPACKETS_FUNCTION_TEST_GUID, - L"SetPackets_Func_Manual", - L"Manual Function Test of SetPackets", - EFI_TEST_LEVEL_DEFAULT, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetPacketsFunctionTest - }, - { - PXE_DHCP_CONFORMANCE_TEST_GUID, - L"Dhcp_Conf_Manual", - L"Manual Conformance Test for Dhcp", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestDhcpConformanceTest - }, - { - PXE_DISCOVER_CONFORMANCE_TEST_GUID, - L"Discover_Conf_Manual", - L"Manual Conformance Test for Discover", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestDiscoverConformanceTest - }, - { - PXE_Mtftp_CONFORMANCE_TEST_GUID, - L"Mtftp_Conf_Manual", - L"Manual Conformance Test for Mtftp", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestMtftpConformanceTest - }, - { - PXE_UDPWRITE_CONFORMANCE_TEST_GUID, - L"Dhcp_Conf_Manual", - L"Manual Conformance Test for UdpWrite", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestUdpWriteConformanceTest - }, - { - PXE_UDPREAD_CONFORMANCE_TEST_GUID, - L"UdpRead_Conf_Manual", - L"Manual Conformance Test for UdpRead", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestUdpReadConformanceTest - }, - { - PXE_SETIPFILTER_CONFORMANCE_TEST_GUID, - L"SetIpFilter_Conf_Manual", - L"Manual Conformance Test for SetIpFilter", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetIpFilterConformanceTest - }, - { - PXE_ARP_CONFORMANCE_MANUAL_TEST_GUID, - L"ARP_Conf_Manual", - L"Manual Conformance Test for ARP", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestArpConformanceManualTest - }, - { - PXE_SETPARAMETERS_CONFORMANCE_TEST_GUID, - L"SetParameters_Conf_Manual", - L"Manual Conformance Test for SetParameters", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetParametersConformanceTest - }, - { - PXE_SETSTATIONIP_CONFORMANCE_TEST_GUID, - L"SetStationIp_Conf_Manual", - L"Manual Conformance Test for SetStationIp", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetStationIpConformanceTest - }, - { - PXE_SETPACKETS_CONFORMANCE_TEST_GUID, - L"SetPackets_Conf_Manual", - L"Manual Conformance Test for SetPackets", - EFI_TEST_LEVEL_MINIMAL, - gSupportProtocolGuid1, - EFI_TEST_CASE_MANUAL, - BBTestSetPacketsConformanceTest - }, + // #ifdef EFI_TEST_EXHAUSTIVE + {PXE_DHCP_FUNCTION_TEST_GUID, L"Dhcp_Func_Manual", L"Manual Function T= est of Dhcp", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_= MANUAL, BBTestDhcpFunctionTest}, {PXE_DISCOVER_FUNCTION_TEST_GUID, L"Discov= er_Func_Manual", L"Manual Function Test of Discover", EFI_TEST_LEVEL_DEFAUL= T, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestDiscoverFunctionTest}= , {PXE_MTFTP_FUNCTION_TEST_GUID, L"Mtftp_Func_Manual", L"Manual Function Te= st of Mtftp", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_= MANUAL, BBTestMtftpFunctionTest}, {PXE_UDPWRITE_FUNCTION_TEST_GUID, L"UdpWr= ite_Func_Manual", L"Manual Function Test of UdpWrite", EFI_TEST_LEVEL_DEFAU= LT, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestUdpWriteFunctionTest= }, {PXE_UDPREAD_FUNCTION_TEST_GUID, L"UdpRead_Func_Manual", L"Manual Functi= on Test of UdpRead", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TES= T_CASE_MANUAL, BBTestUdpReadFunctionTest}, {PXE_ARP_FUNCTION_TEST_GUID, L"A= rp_Func_Manual", L"Manual Function Test of Arp", EFI_TEST_LEVEL_DEFAULT, gS= upportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestArpFunctionTest}, {PXE_SET= PARAMETERS_FUNCTION_TEST_GUID, L"SetParameters_Func_Manual", L"Manual Funct= ion Test of SetParameters", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, = EFI_TEST_CASE_MANUAL, BBTestSetParametersFunctionTest}, {PXE_SETSTATIONIP_F= UNCTION_TEST_GUID, L"SetStationIp_Func_Manual", L"Manual Function Test of S= etStationIp", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_= MANUAL, BBTestSetStationIpFunctionTest}, {PXE_SETPACKETS_FUNCTION_TEST_GUID= , L"SetPackets_Func_Manual", L"Manual Function Test of SetPackets", EFI_TES= T_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetPack= etsFunctionTest}, {PXE_DHCP_CONFORMANCE_TEST_GUID, L"Dhcp_Conf_Manual", L"M= anual Conformance Test for Dhcp", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolG= uid1, EFI_TEST_CASE_MANUAL, BBTestDhcpConformanceTest}, {PXE_DISCOVER_CONFO= RMANCE_TEST_GUID, L"Discover_Conf_Manual", L"Manual Conformance Test for Di= scover", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUA= L, BBTestDiscoverConformanceTest}, {PXE_Mtftp_CONFORMANCE_TEST_GUID, L"Mtft= p_Conf_Manual", L"Manual Conformance Test for Mtftp", EFI_TEST_LEVEL_MINIMA= L, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestMtftpConformanceTest}= , {PXE_UDPWRITE_CONFORMANCE_TEST_GUID, L"Dhcp_Conf_Manual", L"Manual Confor= mance Test for UdpWrite", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EF= I_TEST_CASE_MANUAL, BBTestUdpWriteConformanceTest}, {PXE_UDPREAD_CONFORMANC= E_TEST_GUID, L"UdpRead_Conf_Manual", L"Manual Conformance Test for UdpRead"= , EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTe= stUdpReadConformanceTest}, {PXE_SETIPFILTER_CONFORMANCE_TEST_GUID, L"SetIpF= ilter_Conf_Manual", L"Manual Conformance Test for SetIpFilter", EFI_TEST_LE= VEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetIpFilter= ConformanceTest}, {PXE_ARP_CONFORMANCE_MANUAL_TEST_GUID, L"ARP_Conf_Manual"= , L"Manual Conformance Test for ARP", EFI_TEST_LEVEL_MINIMAL, gSupportProto= colGuid1, EFI_TEST_CASE_MANUAL, BBTestArpConformanceManualTest}, {PXE_SETPA= RAMETERS_CONFORMANCE_TEST_GUID, L"SetParameters_Conf_Manual", L"Manual Conf= ormance Test for SetParameters", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGu= id1, EFI_TEST_CASE_MANUAL, BBTestSetParametersConformanceTest}, {PXE_SETSTA= TIONIP_CONFORMANCE_TEST_GUID, L"SetStationIp_Conf_Manual", L"Manual Conform= ance Test for SetStationIp", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1,= EFI_TEST_CASE_MANUAL, BBTestSetStationIpConformanceTest}, {PXE_SETPACKETS_= CONFORMANCE_TEST_GUID, L"SetPackets_Conf_Manual", L"Manual Conformance Test= for SetPackets", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_C= ASE_MANUAL, BBTestSetPacketsConformanceTest}, #endif - EFI_NULL_GUID -}; - + EFI_NULL_GUID +} +; EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface; EFI_STATUS EFIAPI -BBTestPxeBcUnload ( - IN EFI_HANDLE ImageHandle - ); +BBTestPxeBcUnload( + IN EFI_HANDLE ImageHandle); /** * Creates/installs the BlackBox Interface and eminating Entry Point node= list. @@ -349,34 +127,34 @@ BBTestPxeBcUnload ( */ EFI_STATUS EFIAPI -InitializeBBTestPxeBCProtocol ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) +InitializeBBTestPxeBCProtocol( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable) { EFI_STATUS Status; - EfiInitializeTestLib (ImageHandle, SystemTable); - SctInitializeLib (ImageHandle, SystemTable); - SctInitializeDriver (ImageHandle, SystemTable); + EfiInitializeTestLib(ImageHandle, SystemTable); + SctInitializeLib(ImageHandle, SystemTable); + SctInitializeDriver(ImageHandle, SystemTable); - Status =3D gtBS->CreateEvent (EVT_TIMER, 0, (EFI_EVENT_NOTIFY) NULL, NUL= L, &TimerEvent); - if (EFI_ERROR(Status)) { + Status =3D gtBS->CreateEvent(EVT_TIMER, 0, (EFI_EVENT_NOTIFY)NULL, NULL,= &TimerEvent); + if (EFI_ERROR(Status)) + { return Status; } - Status =3D GetSystemDevicePathAndFilePath (ImageHandle); - if (EFI_ERROR(Status)) { + Status =3D GetSystemDevicePathAndFilePath(ImageHandle); + if (EFI_ERROR(Status)) + { return Status; } - return EfiInitAndInstallBBTestInterface ( - &ImageHandle, - &gEfiPxeBcTestProtField, - gPxeTestEntryField, - BBTestPxeBcUnload, - &gBBTestProtocolInterface - ); + return EfiInitAndInstallBBTestInterface( + &ImageHandle, + &gEfiPxeBcTestProtField, + gPxeTestEntryField, + BBTestPxeBcUnload, + &gBBTestProtocolInterface); } /** @@ -386,29 +164,29 @@ InitializeBBTestPxeBCProtocol ( */ EFI_STATUS EFIAPI -BBTestPxeBcUnload ( - IN EFI_HANDLE ImageHandle - ) +BBTestPxeBcUnload( + IN EFI_HANDLE ImageHandle) { EFI_STATUS Status; - if (gDevicePath !=3D NULL) { - gtBS->FreePool (gDevicePath); + if (gDevicePath !=3D NULL) + { + gtBS->FreePool(gDevicePath); } - if (gFilePath !=3D NULL) { - gtBS->FreePool (gFilePath); + if (gFilePath !=3D NULL) + { + gtBS->FreePool(gFilePath); } - Status =3D gtBS->CloseEvent (TimerEvent); - if (EFI_ERROR(Status)) { - + Status =3D gtBS->CloseEvent(TimerEvent); + if (EFI_ERROR(Status)) + { } - return EfiUninstallAndFreeBBTestInterface ( - ImageHandle, - gBBTestProtocolInterface - ); + return EfiUninstallAndFreeBBTestInterface( + ImageHandle, + gBBTestProtocolInterface); } /******************************* Internal Function ***********************= *************/ @@ -422,42 +200,44 @@ BBTestPxeBcUnload ( * @return EFI_SUCCESS Finish the test successfully. */ EFI_STATUS -ChangePxeState ( - IN EFI_PXE_BASE_CODE_PROTOCOL *PxeInterface, - IN BOOLEAN UsingIpv6, - IN BOOLEAN Cur, - IN BOOLEAN Nxt - ) +ChangePxeState( + IN EFI_PXE_BASE_CODE_PROTOCOL *PxeInterface, + IN BOOLEAN UsingIpv6, + IN BOOLEAN Cur, + IN BOOLEAN Nxt) { - if (Cur=3D=3DNxt) { + if (Cur =3D=3D Nxt) + { return EFI_SUCCESS; } - if (Cur =3D=3D TRUE) { - return PxeInterface->Stop (PxeInterface); + if (Cur =3D=3D TRUE) + { + return PxeInterface->Stop(PxeInterface); } - return PxeInterface->Start (PxeInterface, UsingIpv6); + return PxeInterface->Start(PxeInterface, UsingIpv6); } EFI_STATUS -ReInitPxeBaseCode ( - IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface -) +ReInitPxeBaseCode( + IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface) { - EFI_STATUS Status; + EFI_STATUS Status; // Re-initialize the EFI_PXE_BASE_CODE_PROTOCOL if (BcInterface->Mode->Started =3D=3D TRUE) { - Status =3D BcInterface->Stop (BcInterface); - if (EFI_ERROR(Status)){ + Status =3D BcInterface->Stop(BcInterface); + if (EFI_ERROR(Status)) + { return Status; } } - Status =3D BcInterface->Start (BcInterface, FALSE); - if (EFI_ERROR(Status)){ + Status =3D BcInterface->Start(BcInterface, FALSE); + if (EFI_ERROR(Status)) + { return Status; } @@ -469,19 +249,19 @@ ReInitPxeBaseCode ( * @return TRUE to indicate user operation complete. */ BOOLEAN -WaitForAnyInput () +WaitForAnyInput() { - UINTN NoWait =3D 1, WaitIndex; - EFI_EVENT WaitList[1]; - EFI_STATUS Status; - EFI_INPUT_KEY Key; + UINTN NoWait =3D 1, WaitIndex; + EFI_EVENT WaitList[1]; + EFI_STATUS Status; + EFI_INPUT_KEY Key; - SctPrint (L"Press any key to continue..."); + SctPrint(L"Press any key to continue..."); // // Set 1 second periodic timer // - Status =3D gtBS->SetTimer (TimerEvent, TimerPeriodic, 10000000); + Status =3D gtBS->SetTimer(TimerEvent, TimerPeriodic, 10000000); // // Set up a wait list for a key and the timer @@ -492,50 +272,50 @@ WaitForAnyInput () // // Wait for either // - while (NoWait) { - Status =3D gtBS->WaitForEvent (NoWait, WaitList, &WaitIndex); + while (NoWait) + { + Status =3D gtBS->WaitForEvent(NoWait, WaitList, &WaitIndex); - switch (WaitIndex) { - case 0: - // - // Read the key - // - Status =3D gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if (EFI_SUCCESS =3D=3D Status) - NoWait =3D 0; - break; + switch (WaitIndex) + { + case 0: + // + // Read the key + // + Status =3D gtST->ConIn->ReadKeyStroke(gtST->ConIn, &Key); + if (EFI_SUCCESS =3D=3D Status) + NoWait =3D 0; + break; - default: - break; + default: + break; } } - SctPrint (L"\r\n"); + SctPrint(L"\r\n"); // // Done, cancle periodic timer // - Status =3D gtBS->SetTimer (TimerEvent, TimerCancel, 0); + Status =3D gtBS->SetTimer(TimerEvent, TimerCancel, 0); return TRUE; - } - BOOLEAN -WaitForUserCheck () +WaitForUserCheck() { - UINTN NoWait =3D 1, WaitIndex; - EFI_EVENT WaitList[1]; - EFI_STATUS Status; - EFI_INPUT_KEY Key; - BOOLEAN PressYes=3DFALSE; + UINTN NoWait =3D 1, WaitIndex; + EFI_EVENT WaitList[1]; + EFI_STATUS Status; + EFI_INPUT_KEY Key; + BOOLEAN PressYes =3D FALSE; - SctPrint (L"\r\nPress \"Y\" or \"N\"..."); + SctPrint(L"\r\nPress \"Y\" or \"N\"..."); // // Set 1 second periodic timer // - Status =3D gtBS->SetTimer (TimerEvent, TimerPeriodic, 10000000); + Status =3D gtBS->SetTimer(TimerEvent, TimerPeriodic, 10000000); // // Set up a wait list for a key and the timer @@ -546,83 +326,88 @@ WaitForUserCheck () // // Wait for either // - while (NoWait) { - Status =3D gtBS->WaitForEvent (NoWait, WaitList, &WaitIndex); + while (NoWait) + { + Status =3D gtBS->WaitForEvent(NoWait, WaitList, &WaitIndex); - switch (WaitIndex) { - case 0: - // - // Read the key - // - Status =3D gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - SctAPrint ((char *)(&Key.UnicodeChar)); - switch (Key.UnicodeChar) { - case 'Y': - case 'y': - NoWait =3D 0; - PressYes =3D TRUE; - break; + switch (WaitIndex) + { + case 0: + // + // Read the key + // + Status =3D gtST->ConIn->ReadKeyStroke(gtST->ConIn, &Key); + SctAPrint((char *)(&Key.UnicodeChar)); + switch (Key.UnicodeChar) + { + case 'Y': + case 'y': + NoWait =3D 0; + PressYes =3D TRUE; + break; - case 'N': - case 'n': - NoWait =3D 0; - PressYes =3D FALSE; - break; - - default : - SctPrint (L"\n"); - break; - } + case 'N': + case 'n': + NoWait =3D 0; + PressYes =3D FALSE; break; default: + SctPrint(L"\n"); break; + } + break; + + default: + break; } } - SctPrint (L"\r\n"); + SctPrint(L"\r\n"); // // Done, cancle periodic timer // - Status =3D gtBS->SetTimer (TimerEvent, TimerCancel, 0); + Status =3D gtBS->SetTimer(TimerEvent, TimerCancel, 0); return PressYes; - } EFI_PXE_BASE_CODE_CALLBACK_STATUS EFIAPI -NewCallBack ( - IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This, - IN EFI_PXE_BASE_CODE_FUNCTION Function, - IN BOOLEAN Received, - IN UINT32 PacketLen, - IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL - ) +NewCallBack( + IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This, + IN EFI_PXE_BASE_CODE_FUNCTION Function, + IN BOOLEAN Received, + IN UINT32 PacketLen, + IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL) { - if (Function =3D=3D gFunction) { - gCallBackInvoked ++; + if (Function =3D=3D gFunction) + { + gCallBackInvoked++; return EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT; - } else if (gOldCallBack !=3D NULL) { - return gOldCallBack (This, Function, Received, PacketLen, Packet); - } else { + } + else if (gOldCallBack !=3D NULL) + { + return gOldCallBack(This, Function, Received, PacketLen, Packet); + } + else + { return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE; } } EFI_STATUS -HookReturnAbortCallBack ( - IN EFI_PXE_BASE_CODE_FUNCTION FuncNum, - IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface - ) +HookReturnAbortCallBack( + IN EFI_PXE_BASE_CODE_FUNCTION FuncNum, + IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface) { - EFI_STATUS Status; - EFI_HANDLE *HandleBuffer; - UINTN HandleCount; - UINTN Index; - EFI_PXE_BASE_CODE_PROTOCOL *Interface; + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN HandleCount; + UINTN Index; + EFI_PXE_BASE_CODE_PROTOCOL *Interface; EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *BcCallBack; - BOOLEAN NewMakeCallback; + BOOLEAN NewMakeCallback; // // init global variables @@ -634,14 +419,14 @@ HookReturnAbortCallBack ( // // Locate all handles of Pxe protocol // - Status =3D gtBS->LocateHandleBuffer ( - ByProtocol, - &gBlackBoxEfiPxeBaseCodeProtocolGuid, - NULL, - &HandleCount, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { + Status =3D gtBS->LocateHandleBuffer( + ByProtocol, + &gBlackBoxEfiPxeBaseCodeProtocolGuid, + NULL, + &HandleCount, + &HandleBuffer); + if (EFI_ERROR(Status)) + { return EFI_NOT_FOUND; } @@ -649,67 +434,70 @@ HookReturnAbortCallBack ( // Looking for the handle corresponding to the BcInterface // gHandle =3D NULL; - for (Index =3D 0; Index < HandleCount; Index +=3D 1) { - Status =3D gtBS->HandleProtocol ( - HandleBuffer[Index], - &gBlackBoxEfiPxeBaseCodeProtocolGuid, - (VOID **)&Interface - ); - if (BcInterface =3D=3D Interface) { + for (Index =3D 0; Index < HandleCount; Index +=3D 1) + { + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiPxeBaseCodeProtocolGuid, + (VOID **)&Interface); + if (BcInterface =3D=3D Interface) + { gHandle =3D HandleBuffer[Index]; break; } } - gtBS->FreePool (HandleBuffer); + gtBS->FreePool(HandleBuffer); - if (gHandle =3D=3D NULL) { + if (gHandle =3D=3D NULL) + { return EFI_NOT_FOUND; } // // Is Pxe Callback probocol installed? // - Status =3D gtBS->HandleProtocol ( - gHandle, - &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, - (VOID **)&BcCallBack - ); - if (Status =3D=3D EFI_SUCCESS) { + Status =3D gtBS->HandleProtocol( + gHandle, + &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, + (VOID **)&BcCallBack); + if (Status =3D=3D EFI_SUCCESS) + { // Replace the previous call back function gOldCallBack =3D BcCallBack->Callback; BcCallBack->Callback =3D NewCallBack; - } else { + } + else + { // // Install a call back protocol // - Status =3D gtBS->InstallProtocolInterface ( - &gHandle, - &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, - EFI_NATIVE_INTERFACE, - &NewCallBackProtocol - ); - if (EFI_ERROR(Status)) { + Status =3D gtBS->InstallProtocolInterface( + &gHandle, + &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, + EFI_NATIVE_INTERFACE, + &NewCallBackProtocol); + if (EFI_ERROR(Status)) + { return Status; } // // Enable PXE to use call back // NewMakeCallback =3D TRUE; - Status =3D BcInterface->SetParameters ( - BcInterface, - NULL, - NULL, - NULL, - NULL, - &NewMakeCallback - ); - if (EFI_ERROR(Status)) { - gtBS->UninstallProtocolInterface ( - gHandle, - &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, - &NewCallBackProtocol - ); + Status =3D BcInterface->SetParameters( + BcInterface, + NULL, + NULL, + NULL, + NULL, + &NewMakeCallback); + if (EFI_ERROR(Status)) + { + gtBS->UninstallProtocolInterface( + gHandle, + &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, + &NewCallBackProtocol); return Status; } } @@ -718,48 +506,50 @@ HookReturnAbortCallBack ( } EFI_STATUS -UnHookReturnAbortCallBack ( - IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface - ) +UnHookReturnAbortCallBack( + IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface) { - EFI_STATUS Status; + EFI_STATUS Status; EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *BcCallBack; - BOOLEAN NewMakeCallback; + BOOLEAN NewMakeCallback; - if (gOldCallBack !=3D NULL) { - Status =3D gtBS->HandleProtocol ( - gHandle, - &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, - (VOID **)&BcCallBack - ); - if (EFI_ERROR(Status)) { + if (gOldCallBack !=3D NULL) + { + Status =3D gtBS->HandleProtocol( + gHandle, + &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, + (VOID **)&BcCallBack); + if (EFI_ERROR(Status)) + { return Status; } // restore the previous call back function BcCallBack->Callback =3D gOldCallBack; gOldCallBack =3D NULL; - } else { + } + else + { // // Disable PXE to use call back // NewMakeCallback =3D FALSE; - Status =3D BcInterface->SetParameters ( - BcInterface, - NULL, - NULL, - NULL, - NULL, - &NewMakeCallback - ); - if (EFI_ERROR(Status)) { + Status =3D BcInterface->SetParameters( + BcInterface, + NULL, + NULL, + NULL, + NULL, + &NewMakeCallback); + if (EFI_ERROR(Status)) + { return Status; } - Status =3D gtBS->UninstallProtocolInterface ( - gHandle, - &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, - &NewCallBackProtocol - ); - if (EFI_ERROR(Status)) { + Status =3D gtBS->UninstallProtocolInterface( + gHandle, + &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid, + &NewCallBackProtocol); + if (EFI_ERROR(Status)) + { return Status; } } @@ -768,44 +558,44 @@ UnHookReturnAbortCallBack ( } BOOLEAN -IsPxePacketValid ( - IN EFI_PXE_PACKET_TYPE PacketType, - IN EFI_PXE_BASE_CODE_PACKET *Packet - ) +IsPxePacketValid( + IN EFI_PXE_PACKET_TYPE PacketType, + IN EFI_PXE_BASE_CODE_PACKET *Packet) { - //BootpOpCode + // BootpOpCode switch (PacketType) { - case EFI_PXE_PACKET_TYPE_DHCP_DISCOVER: - return TRUE; + case EFI_PXE_PACKET_TYPE_DHCP_DISCOVER: + return TRUE; - case EFI_PXE_PACKET_TYPE_DHCP_ACK: - return TRUE; + case EFI_PXE_PACKET_TYPE_DHCP_ACK: + return TRUE; - case EFI_PXE_PACKET_TYPE_PROXY_OFFER: - return TRUE; + case EFI_PXE_PACKET_TYPE_PROXY_OFFER: + return TRUE; - case EFI_PXE_PACKET_TYPE_PXE_DISCOVER: - return TRUE; + case EFI_PXE_PACKET_TYPE_PXE_DISCOVER: + return TRUE; - case EFI_PXE_PACKET_TYPE_PXE_OFFER: - return TRUE; + case EFI_PXE_PACKET_TYPE_PXE_OFFER: + return TRUE; - default: - return FALSE; + default: + return FALSE; } } BOOLEAN -IsBufZeroed ( - IN CHAR8 *Buf, - IN UINTN Len - ) +IsBufZeroed( + IN CHAR8 *Buf, + IN UINTN Len) { UINTN i; - for (i=3D0; iRaw),1472/2); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Raw Packet]", SctStrLen(L"[Raw Pack= et]")); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Raw), 1472 / 2); TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpOpcode; - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Opcode]", SctStrLen (L"[Bootp= Opcode]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Opcode]", SctStrLen(L"[Bootp = Opcode]")); LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16); TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpHwType; - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Type]", SctStrLen (L"[Boot= p Hw Type]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Type]", SctStrLen(L"[Bootp= Hw Type]")); LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16); TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpHwAddrLen; - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Addr Len]", SctStrLen (L"[= Bootp Hw Addr Len]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Addr Len]", SctStrLen(L"[B= ootp Hw Addr Len]")); LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16); TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpGateHops; - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Gate Hop]", SctStrLen (L"[Boo= tp Gate Hop]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Gate Hop]", SctStrLen(L"[Boot= p Gate Hop]")); LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Iden]", SctStrLen (L"[Bootp I= den]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Iden]", SctStrLen(L"[Bootp Id= en]")); LOG_UINT32_HEX_DFLT(LoggingLib, (Packet->Dhcpv4.BootpIdent)); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Seconds]", SctStrLen (L"[Boot= p Seconds]")); - LOG_UINT16_HEX_DFLT(LoggingLib,Packet->Dhcpv4.BootpSeconds); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Seconds]", SctStrLen(L"[Bootp= Seconds]")); + LOG_UINT16_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpSeconds); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Flags]", SctStrLen (L"[Bootp = Flags]")); - LOG_UINT16_HEX_DFLT(LoggingLib,(Packet->Dhcpv4.BootpFlags)); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Flags]", SctStrLen(L"[Bootp F= lags]")); + LOG_UINT16_HEX_DFLT(LoggingLib, (Packet->Dhcpv4.BootpFlags)); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp CiAddr]", SctStrLen (L"[Bootp= CiAddr]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp CiAddr]", SctStrLen(L"[Bootp = CiAddr]")); LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpCiAddr); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp YiAddr]", SctStrLen (L"[Bootp= YiAddr]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp YiAddr]", SctStrLen(L"[Bootp = YiAddr]")); LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpYiAddr); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SiAddr]", SctStrLen (L"[Bootp= SiAddr]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SiAddr]", SctStrLen(L"[Bootp = SiAddr]")); LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpSiAddr); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp GiAddr]", SctStrLen (L"[Bootp= GiAddr]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp GiAddr]", SctStrLen(L"[Bootp = GiAddr]")); LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpGiAddr); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp HwAddr]", SctStrLen (L"[Bootp= HwAddr]")); - LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpSrvName), 32)= ; + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp HwAddr]", SctStrLen(L"[Bootp = HwAddr]")); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpSrvName), 32= ); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SrvName]", SctStrLen (L"[Boot= p SrvName]")); - LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpHwAddr), 8); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SrvName]", SctStrLen(L"[Bootp= SrvName]")); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpHwAddr), 8); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp BootFile]", SctStrLen (L"[Boo= tp BootFile]")); - LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpBootFile), 64= ); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp BootFile]", SctStrLen(L"[Boot= p BootFile]")); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpBootFile), 6= 4); - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Magik]", SctStrLen (L"[Bootp = Magik]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Magik]", SctStrLen(L"[Bootp M= agik]")); LOG_UINT32_HEX_DFLT(LoggingLib, Packet->Dhcpv4.DhcpMagik); return EFI_SUCCESS; } EFI_STATUS -PrintArpTable ( - IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, - IN EFI_PXE_BASE_CODE_MODE *Mode - ) +PrintArpTable( + IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, + IN EFI_PXE_BASE_CODE_MODE *Mode) { - UINTN i, cnt; - CHAR16 *Buffer; + UINTN i, cnt; + CHAR16 *Buffer; - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, L"Arp Entry = is", (UINT32)SctStrLen (L"Arp Entry is"), EFI_DUMP_ASCII); + LoggingLib->DumpBuf(LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, L"Arp Entry i= s", (UINT32)SctStrLen(L"Arp Entry is"), EFI_DUMP_ASCII); cnt =3D 0; for (i =3D 0; i < EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES; i++) { - if (FALSE =3D=3D IsBufZeroed ((CHAR8 *)(&Mode->ArpCache[i]), sizeof (E= FI_PXE_BASE_CODE_ARP_ENTRY))) + if (FALSE =3D=3D IsBufZeroed((CHAR8 *)(&Mode->ArpCache[i]), sizeof(EFI= _PXE_BASE_CODE_ARP_ENTRY))) { - cnt ++; + cnt++; Buffer =3D (CHAR16 *)(&Mode->ArpCache[i]); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, Buffer, = (UINT32)SctStrLen (Buffer), EFI_DUMP_HEX); + LoggingLib->DumpBuf(LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, Buffer, (= UINT32)SctStrLen(Buffer), EFI_DUMP_HEX); } } if (cnt =3D=3D Mode->ArpCacheEntries) return EFI_SUCCESS; - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Arp Cache Unmatched", SctStrLen (L"A= rp Cache Unmatched")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Arp Cache Unmatched", SctStrLen(L"Ar= p Cache Unmatched")); return EFI_INVALID_PARAMETER; } EFI_STATUS SetIpAndMask( - IN EFI_IP_ADDRESS *EfiIp, - IN EFI_IP_ADDRESS *EfiMask, - IN UINT32 NumIpv4, - IN UINT32 NumMask - ) + IN EFI_IP_ADDRESS *EfiIp, + IN EFI_IP_ADDRESS *EfiMask, + IN UINT32 NumIpv4, + IN UINT32 NumMask) { - EFI_STATUS Status; + EFI_STATUS Status; if (NULL !=3D EfiIp) { - Status =3D SetIpAddress (EfiIp, NumIpv4); + Status =3D SetIpAddress(EfiIp, NumIpv4); if (EFI_ERROR(Status)) return Status; } if (NULL !=3D EfiMask) { - Status =3D SetIpAddress (EfiMask, NumMask); + Status =3D SetIpAddress(EfiMask, NumMask); if (EFI_ERROR(Status)) return Status; } @@ -940,10 +726,9 @@ SetIpAndMask( } EFI_STATUS -SetIpAddress ( - IN OUT EFI_IP_ADDRESS *EfiIp, - IN UINT32 NumIpv4 - ) +SetIpAddress( + IN OUT EFI_IP_ADDRESS *EfiIp, + IN UINT32 NumIpv4) { if (NULL =3D=3D EfiIp) return EFI_INVALID_PARAMETER; @@ -957,21 +742,24 @@ SetIpAddress ( } BOOLEAN -IsIpMaskEqual ( - IN EFI_IP_ADDRESS *NewStationIp, - IN EFI_IP_ADDRESS *NewSubnetMask, - IN EFI_IP_ADDRESS *OldStationIp, - IN EFI_IP_ADDRESS *OldSubnetMask - ) +IsIpMaskEqual( + IN EFI_IP_ADDRESS *NewStationIp, + IN EFI_IP_ADDRESS *NewSubnetMask, + IN EFI_IP_ADDRESS *OldStationIp, + IN EFI_IP_ADDRESS *OldSubnetMask) { - if (NULL !=3D NewStationIp){ - if (FALSE =3D=3D (0 =3D=3D SctCompareMem (NewStationIp, OldStationIp, = sizeof (EFI_IP_ADDRESS)))) { + if (NULL !=3D NewStationIp) + { + if (FALSE =3D=3D (0 =3D=3D SctCompareMem(NewStationIp, OldStationIp, s= izeof(EFI_IP_ADDRESS)))) + { return FALSE; } } - if (NULL !=3D NewSubnetMask){ - if (FALSE =3D=3D (0 =3D=3D SctCompareMem (NewSubnetMask, OldSubnetMask= , sizeof (EFI_IP_ADDRESS)))){ + if (NULL !=3D NewSubnetMask) + { + if (FALSE =3D=3D (0 =3D=3D SctCompareMem(NewSubnetMask, OldSubnetMask,= sizeof(EFI_IP_ADDRESS)))) + { return FALSE; } } @@ -979,55 +767,59 @@ IsIpMaskEqual ( } EFI_STATUS -CopyPxePacket ( - IN EFI_PXE_BASE_CODE_PACKET *DestPacket, - IN EFI_PXE_BASE_CODE_PACKET *SrcPacket - ) +CopyPxePacket( + IN EFI_PXE_BASE_CODE_PACKET *DestPacket, + IN EFI_PXE_BASE_CODE_PACKET *SrcPacket) { - if (NULL =3D=3D DestPacket) { + if (NULL =3D=3D DestPacket) + { return EFI_SUCCESS; } - if (NULL =3D=3D SrcPacket) { + if (NULL =3D=3D SrcPacket) + { return EFI_INVALID_PARAMETER; } - SctCopyMem (DestPacket, SrcPacket, sizeof (EFI_PXE_BASE_CODE_PACKET)); + SctCopyMem(DestPacket, SrcPacket, sizeof(EFI_PXE_BASE_CODE_PACKET)); return EFI_SUCCESS; } BOOLEAN -IsPxePacketEqual ( - IN EFI_PXE_BASE_CODE_PACKET *DestPacket, - IN EFI_PXE_BASE_CODE_PACKET *SrcPacket - ) +IsPxePacketEqual( + IN EFI_PXE_BASE_CODE_PACKET *DestPacket, + IN EFI_PXE_BASE_CODE_PACKET *SrcPacket) { - if (NULL =3D=3D DestPacket && NULL =3D=3D SrcPacket) { + if (NULL =3D=3D DestPacket && NULL =3D=3D SrcPacket) + { return TRUE; } - if (0=3D=3DSctCompareMem (DestPacket, SrcPacket, sizeof (EFI_PXE_BASE_CO= DE_PACKET))){ + if (0 =3D=3D SctCompareMem(DestPacket, SrcPacket, sizeof(EFI_PXE_BASE_CO= DE_PACKET))) + { return TRUE; } return FALSE; } BOOLEAN -IsIpFilterEqual ( - IN EFI_PXE_BASE_CODE_IP_FILTER *SrcIpFilter, - IN EFI_PXE_BASE_CODE_IP_FILTER *DstIpFilter - ) +IsIpFilterEqual( + IN EFI_PXE_BASE_CODE_IP_FILTER *SrcIpFilter, + IN EFI_PXE_BASE_CODE_IP_FILTER *DstIpFilter) { - if (NULL =3D=3D SrcIpFilter && NULL =3D=3D DstIpFilter) { + if (NULL =3D=3D SrcIpFilter && NULL =3D=3D DstIpFilter) + { return TRUE; } if (NULL !=3D SrcIpFilter && NULL !=3D DstIpFilter) { - if (SrcIpFilter->IpCnt !=3D DstIpFilter->IpCnt) { + if (SrcIpFilter->IpCnt !=3D DstIpFilter->IpCnt) + { return FALSE; } - if (0=3D=3DSctCompareMem (SrcIpFilter->IpList, DstIpFilter->IpList, si= zeof (EFI_IP_ADDRESS) * SrcIpFilter->IpCnt)){ + if (0 =3D=3D SctCompareMem(SrcIpFilter->IpList, DstIpFilter->IpList, s= izeof(EFI_IP_ADDRESS) * SrcIpFilter->IpCnt)) + { return TRUE; } } @@ -1035,71 +827,167 @@ IsIpFilterEqual ( } EFI_STATUS -LogUdpPacket ( - IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, - IN EFI_IP_ADDRESS *DestIp, - IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort, - IN EFI_IP_ADDRESS *SrcIp, - IN EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, - IN UINTN BufferSize, - IN VOID *BufferPtr - ) +LogUdpPacket( + IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, + IN EFI_IP_ADDRESS *DestIp, + IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort, + IN EFI_IP_ADDRESS *SrcIp, + IN EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, + IN UINTN BufferSize, + IN VOID *BufferPtr) { - if (NULL!=3DDestIp) + if (NULL !=3D DestIp) { - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest IP]", SctStrLen (L"[Dest IP]= ")); - //LOG_IP_HEX_DFLT (LoggingLib, DestIp->v4.Addr); - LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)&DestIp, sizeof (EFI_IP_ADDRESS)= /2); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest IP]", SctStrLen(L"[Dest IP]"= )); + // LOG_IP_HEX_DFLT (LoggingLib, DestIp->v4.Addr); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)&DestIp, sizeof(EFI_IP_ADDRESS)= / 2); } if (NULL !=3D DestPort) { - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest Port]", SctStrLen (L"[Dest P= ort]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest Port]", SctStrLen(L"[Dest Po= rt]")); LOG_UINT16_HEX_DFLT(LoggingLib, *DestPort); } if (NULL !=3D SrcIp) { - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src IP]", SctStrLen (L"[Src IP]")= ); - //LOG_IP_HEX_DFLT (LoggingLib, SrcIp->v4.Addr); - LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)&SrcIp, sizeof (EFI_IP_ADDRESS)/= 2); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src IP]", SctStrLen(L"[Src IP]"))= ; + // LOG_IP_HEX_DFLT (LoggingLib, SrcIp->v4.Addr); + LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)&SrcIp, sizeof(EFI_IP_ADDRESS) = / 2); } if (NULL !=3D SrcPort) { - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src Port]", SctStrLen (L"[Src Por= t]")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src Port]", SctStrLen(L"[Src Port= ]")); LOG_UINT16_HEX_DFLT(LoggingLib, *SrcPort); } - if (0!=3DBufferSize) + if (0 !=3D BufferSize) { - LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Received UDP Packet", SctStrLen (L= "Received UDP Packet")); + LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Received UDP Packet", SctStrLen(L"= Received UDP Packet")); LOG_BUF_HEX_DFLT(LoggingLib, BufferPtr, BufferSize); } return EFI_SUCCESS; } EFI_STATUS -LogChar8String ( - IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, - IN CHAR8 *Buffer, - IN UINTN Len - ) +LogChar8String( + IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib, + IN CHAR8 *Buffer, + IN UINTN Len) { - EFI_STATUS Status; - CHAR16 *TempBuffer; + EFI_STATUS Status; + CHAR16 *TempBuffer; - if (NULL =3D=3D Buffer) { + if (NULL =3D=3D Buffer) + { return EFI_INVALID_PARAMETER; } - Status =3D gtBS->AllocatePool (EfiRuntimeServicesData, Len * sizeof (CHA= R16), (VOID **) &TempBuffer); - if (EFI_ERROR(Status)) { + Status =3D gtBS->AllocatePool(EfiRuntimeServicesData, Len * sizeof(CHAR1= 6), (VOID **)&TempBuffer); + if (EFI_ERROR(Status)) + { return Status; } - SctZeroMem (&TempBuffer, Len * sizeof (CHAR16)); + SctZeroMem(&TempBuffer, Len * sizeof(CHAR16)); - LOG_CHAR16_ASCII_DFLT (LoggingLib, TempBuffer, Len); + LOG_CHAR16_ASCII_DFLT(LoggingLib, TempBuffer, Len); - gtBS->FreePool (TempBuffer); + gtBS->FreePool(TempBuffer); return EFI_SUCCESS; } + +EFI_STATUS LocateDevicePathFromBcInterface(IN EFI_PXE_BASE_CODE_PROTOCOL *= BcInterface2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDARD_TES= T_LIBRARY_PROTOCOL *StandardLib) +{ + EFI_STATUS Status; + + UINTN NoHandles, Index; + EFI_HANDLE *HandleBuffer; + EFI_PXE_BASE_CODE_PROTOCOL *OtherBcInterface2; + + // + // Locate the Handle that the BcInterface is bound to + // + Status =3D gtBS->LocateHandleBuffer( + ByProtocol, + &gBlackBoxEfiPxeBaseCodeProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + return Status; + } + + if (NoHandles <=3D 0) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Device Error", + __FILE__, + (UINTN)__LINE__); + return EFI_DEVICE_ERROR; + } + + // + // Find the exact handle that BcInterface bound to + // + for (Index =3D 0; Index < NoHandles; Index++) + { + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiPxeBaseCodeProtocolGuid, + (VOID **) &OtherBcInterface2); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - HandleProtocol", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + + gtBS->FreePool(HandleBuffer); + return Status; + } + + if (OtherBcInterface2 =3D=3D BcInterface2) + { + break; + } + } + + // + // Locate the Loaded Image DevicePath Protocol bound to PXE_BASE_CODE Pr= otocol + // + if (Index >=3D NoHandles) + { + // + // No Handle Found!! + // + gtBS->FreePool(HandleBuffer); + return EFI_DEVICE_ERROR; + } + + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiDevicePathProtocolGuid, + (VOID **) DevicePath); + + gtBS->FreePool(HandleBuffer); + return Status; +} \ No newline at end of file diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EF= I/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c index e73c7cebcbcf..b1b9005059bb 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c @@ -54,6 +54,8 @@ BBTestStartConformanceTest ( EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -72,6 +74,23 @@ BBTestStartConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStart= ed. // If not, change the state to EfiSimpleNetworkStarted. @@ -160,7 +179,8 @@ BBTestStopConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -179,6 +199,23 @@ BBTestStopConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -266,7 +303,8 @@ BBTestInitializeConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -285,6 +323,23 @@ BBTestInitializeConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -377,7 +432,8 @@ BBTestResetConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -396,6 +452,23 @@ BBTestResetConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -488,7 +561,8 @@ BBTestShutdownConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -507,6 +581,23 @@ BBTestShutdownConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -594,7 +685,8 @@ BBTestReceiveFilterConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_MAC_ADDRESS MAC; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -613,6 +705,23 @@ BBTestReceiveFilterConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -840,7 +949,8 @@ BBTestStationAddressConformanceTest ( EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; EFI_SIMPLE_NETWORK_STATE State1, State2; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -859,6 +969,23 @@ BBTestStationAddressConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -988,7 +1115,8 @@ BBTestStatisticsConformanceTest ( EFI_SIMPLE_NETWORK_STATE State1, State2; EFI_NETWORK_STATISTICS StatisticsTable; UINTN StatisticsSize; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -1007,6 +1135,23 @@ BBTestStatisticsConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -1164,7 +1309,8 @@ BBTestMCastIpToMacConformanceTest ( EFI_SIMPLE_NETWORK_STATE State1, State2; EFI_IP_ADDRESS IP; EFI_MAC_ADDRESS MAC; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -1183,6 +1329,23 @@ BBTestMCastIpToMacConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -1279,6 +1442,8 @@ BBTestNVDataConformanceTest ( EFI_SIMPLE_NETWORK_STATE State1, State2, State3; VOID *Buffer; UINT32 CheckPoint1State; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -1297,6 +1462,23 @@ BBTestNVDataConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the network interface support NvData if not return // @@ -1526,7 +1708,8 @@ BBTestGetStatusConformanceTest ( VOID *TxBuf; UINT32 InterruptStatus; //UINT32 *pInterruptStatus; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -1545,6 +1728,23 @@ BBTestGetStatusConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -1717,7 +1917,8 @@ BBTestTransmitConformanceTest ( EFI_MAC_ADDRESS SrcAddr; EFI_MAC_ADDRESS DestAddr; UINT16 Protocol; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -1736,6 +1937,23 @@ BBTestTransmitConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. @@ -1993,7 +2211,8 @@ BBTestReceiveConformanceTest ( EFI_MAC_ADDRESS SrcAddr; EFI_MAC_ADDRESS DestAddr; UINT16 Protocol; - + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + CHAR16 *DevicePathStr; // // Get the Standard Library Interface // @@ -2012,6 +2231,23 @@ BBTestReceiveConformanceTest ( // SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DevicePath,Stand= ardLib); + if (Status =3D=3D EFI_SUCCESS) { + DevicePathStr =3D NULL; + DevicePathStr =3D SctDevicePathToStr (DevicePath); + if (DevicePathStr !=3D NULL) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"Device Path: %s\r\n", + DevicePathStr + ); + Status =3D gtBS->FreePool (DevicePathStr); + if (EFI_ERROR(Status)) + return Status; + DevicePathStr=3DNULL; + } + } // // Check whether the state of network interface is EfiSimpleNetworkStopp= ed. // If not, change the state to EfiSimpleNetworkStopped. diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Proto= col/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestMain.c index 918fac7dbd7f..21d20b82b025 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.c @@ -336,3 +336,99 @@ BBTestSimpleNetworkUnload ( ); } + +EFI_STATUS LocateDevicePathFromSnpInterface(IN EFI_SIMPLE_NETWORK_PROTOCOL= *SnpInterface2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDARD_= TEST_LIBRARY_PROTOCOL *StandardLib) +{ + EFI_STATUS Status; + + UINTN NoHandles, Index; + EFI_HANDLE *HandleBuffer; + EFI_SIMPLE_NETWORK_PROTOCOL *OtherSnpInterface2; + + // + // Locate the Handle that the SnpInterface is bound to + // + Status =3D gtBS->LocateHandleBuffer( + ByProtocol, + &gBlackBoxEfiSimpleNetworkProtocolGuid, + NULL, + &NoHandles, + &HandleBuffer); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + return Status; + } + + if (NoHandles <=3D 0) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.LocateHandle - LocateHandle", + L"%a:%d:Device Error", + __FILE__, + (UINTN)__LINE__); + return EFI_DEVICE_ERROR; + } + + // + // Find the exact handle that SnpInterface bound to + // + for (Index =3D 0; Index < NoHandles; Index++) + { + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiSimpleNetworkProtocolGuid, + (VOID **) &OtherSnpInterface2); + if (EFI_ERROR(Status)) + { + StandardLib->RecordAssertion( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - HandleProtocol", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status); + + gtBS->FreePool(HandleBuffer); + return Status; + } + + if (OtherSnpInterface2 =3D=3D SnpInterface2) + { + break; + } + } + + // + // Locate the Loaded DevicePath Protocol bound to SIMPLE_NETWORK Protoco= l + // + if (Index >=3D NoHandles) + { + // + // No Handle Found!! + // + gtBS->FreePool(HandleBuffer); + return EFI_DEVICE_ERROR; + } + + Status =3D gtBS->HandleProtocol( + HandleBuffer[Index], + &gBlackBoxEfiDevicePathProtocolGuid, + (VOID **) DevicePath); + + gtBS->FreePool(HandleBuffer); + return Status; +} \ No newline at end of file -- 2.34.1 =06=AE=8B=A9=B2* =8Ay,b=8B=ABy=C7=A2=BD=E6=A5=96g=AC=B1=A8=1E=B2=C7=A7=B6=DA-=86+ =AE=8B=A9V= '=B0=FD=17=A9=97#=A7=96)=DE=D7_x=DF=B8m=B6=9B?=FD=E7d=DA =E8=BA=9B"=A3=F8?u=EB=DE=97=F9=9E=B2=C6 {=FDu=F7�=FB2=EB^N=18=ACN=8A= br=1Bm=A6=CF=FF=82=BA.=A6=C8=A8=FEk=7F=D7N=B8=EF]=BA=E3=FE}=F3�=3D= =ECj=E8=BA=93=B0�=EA=DDz=F7=A5=FA=8C'z=B7�=93h+=A2=EAl=8A=85'= =B2=E6=ECr=B8=9Bz=1Bm=A6=CF=FFy=D96=82=BA.=A6=C8=A8=FE=0F=DDz=F7=A5=FE=E9= =EC=B9=B4=AE=9E|=96jx=1A=AEg( IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119487): https://edk2.groups.io/g/devel/message/119487 Mute This Topic: https://groups.io/mt/106471264/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_AM0PR08MB44831A4DEC9D384FA71C0579EFF92AM0PR08MB4483eurp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi Sunny
Thanks for reviewing. Here's the updated PR for your review:
3D""
https://bugzilla.tianocore.org/show_bug.cgi?id=3D4244 Tests Modified: Adapt= erInfoBBTestConformance HIIConfigAccessBBTestConformance PxeBaseCodeBBTestC= onformance SimpleNetworkBBTestConformance UEFI-SC...
github.com


From: Sunny Wang <Sunny.= Wang@arm.com>
Sent: Wednesday, June 5, 2024 12:32 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Prachotan Bat= hi <Prachotan.Bathi@arm.com>
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao &l= t;gaojie@byosoft.com.cn>; Carolyn Gjertsen <Carolyn.Gjertsen@amd.com&= gt;; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin &l= t;eric.jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Supreeth Venkatesh <Supreeth.Venkatesh@amd.com>; Sunny Wang <Sunn= y.Wang@arm.com>
Subject: RE: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT i= mprovement - Print out the PCIe device path fo..
 
Thanks for working on this, @Prachotan Bathi
I directly reviewed and added comments on pull request. https://github.com/tianocore/edk2-test/pull/96

Best Regards,
Sunny

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pracho= tan Bathi via groups.io
Sent: Monday, June 3, 2024 1:28 PM
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaoji= e@byosoft.com.cn>; Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>; Sa= mer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin <eric.= jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Supreeth Venkatesh <Supreeth.Venkatesh@amd.com>
Subject: [edk2-devel] [PATCH v1 1/1] EDK2-Test: Bug 4244 - SCT improvement = - Print out the PCIe device path fo..

Tests Modified:

AdapterInfoBBTestConformance
ComponentName2BBTestConformance
HIIConfigAccessBBTestConformance
PxeBaseCodeBBTestConformance
SimpleNetworkBBTestConformance

UEFI-SCT
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Supreeth Venkatesh <Supreeth.Venkatesh@amd.com>

Signed-off-by: Prachotan Bathi <prachotan.bathi@arm.com>
---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoProtocolBBTest.inf        = ;  |    2 +
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBBTest.inf          &nb= sp;            =    |    3 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTest.inf        &nb= sp;     |    4 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.h         = ;       |   17 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h        |&= nbsp;   6 +
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.h         = ;       |    6 +
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.h        &= nbsp;   |    6 +
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestConformance.c       &nbs= p; |   63 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.c         = ;       |   96 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c |   48 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c        |&= nbsp;  67 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestConformance.c       &nbs= p; |  305 +++++-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.c         = ;       | 1158 +++++++++-----------
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c     |  258 ++++-=
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.c        &= nbsp;   |   96 ++
 15 files changed, 1451 insertions(+), 684 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoProtocolBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pro= tocol/AdapterInfo/BlackBoxTest/AdapterInfoProtocolBBTest.inf
index b3bf99440705..464029ec10ce 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoProtocolBBTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoProtocolBBTest.inf
@@ -49,3 +49,5 @@ [LibraryClasses]
   EfiTestLib
 
 [Protocols]
+  gEfiAdapterInformationProtocolGuid
+  gBlackBoxEfiDevicePathProtocolGuid
\ No newline at end of file
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCod= e/BlackBoxTest/PxeBBTest.inf
index 41367ce496b3..29392ca83dca 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBBTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBBTest.inf
@@ -57,4 +57,5 @@ [Protocols]
   gEfiTestLoggingLibraryGuid
   gBlackBoxEfiSimpleNetworkProtocolGuid
   gBlackBoxEfiPxeBaseCodeProtocolGuid
-  gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid
+  gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid
+  gBlackBoxEfiDevicePathProtocolGuid
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protoco= l/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTest.inf
index 1d2d1d395fbb..14b24173f311 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTest.inf
@@ -51,4 +51,6 @@ [LibraryClasses]
   EfiTestLib
 
 [Protocols]
-  gEfiTestLoggingLibraryGuid
+  gEfiTestLoggingLibraryGuid
+  gBlackBoxEfiSimpleNetworkProtocolGuid
+  gBlackBoxEfiDevicePathProtocolGuid
\ No newline at end of file
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= AdapterInfo/BlackBoxTest/AdapterInfoBBTestMain.h
index 9952fbcab833..a1ef9db3b127 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.h
@@ -28,9 +28,11 @@ Abstract:
 #define _ADAPTER_INFORMATION_BB_TEST_MAIN
 
 #include "Efi.h"
+#include <Base.h>
+#include "SctLib.h"
+#include "Guid.h"
 #include <Library/EfiTestLib.h>
 #include <UEFI/Protocol/AdapterInfo.h>
-#include "Guid.h"
 
 
 #define EFI_ADAPTER_INFORMATION_PROTOCOL_TEST_REVISION  &nb= sp; 0x00010000
@@ -160,12 +162,9 @@ BBTestGetSupportedTypesFunctionTest (
   IN EFI_HANDLE        &= nbsp;        SupportHandle
   );
 
-
-VOID
-SctInitializeLib (
-  IN EFI_HANDLE         =         ImageHandle,
-  IN EFI_SYSTEM_TABLE        =    *SystemTable
-  );
-
-
+EFI_STATUS
+LocateDevicePathFromAdapterInfo(
+  IN EFI_ADAPTER_INFORMATION_PROTOCOL *AdapterInfo2,
+  IN EFI_DEVICE_PATH_PROTOCOL **DevicePath,
+  IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib);
 #endif
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.h
index 0e17954d7762..812698779f12 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.h
@@ -148,6 +148,12 @@ GetDevicePath (
   OUT EFI_STRING        =             &nb= sp;      *DevicePathStr
   );
 
+EFI_STATUS
+GetDevicePathProtocol (
+  IN  EFI_HII_CONFIG_ACCESS_PROTOCOL    *ConfigAc= cess,
+  IN EFI_DEVICE_PATH_PROTOCOL **DevicePath
+  );
+
 EFI_STATUS
 GetCorrespondingRequest (
   IN     EFI_STRING    MultiC= onfigAltResp,
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestMain.h
index b94f200ff7aa..dfef671824f2 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.h
@@ -578,6 +578,12 @@ LogChar8String(
   IN UINTN         =             &nb= sp;        Len
   );
 
+EFI_STATUS
+LocateDevicePathFromBcInterface (
+  IN EFI_PXE_BASE_CODE_PROTOCOL      &n= bsp;      *BcInterface2,
+  IN EFI_DEVICE_PATH_PROTOCOL      &nbs= p;          **DevicePath, = ;     //reuse the EFI_DEVICE_PATH_PROTOCOL as EFI_LOADE= D_IMAGE_DEVICE_PATH_PROTOCOL
+  IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL     =   *StandardLib
+  );
 //
 // Entry GUIDs
 //
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Proto= col/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestMain.h
index ea14aaa77963..60ffabe257ee 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.h
@@ -357,6 +357,12 @@ BBTestReceiveConformanceTest (
   IN EFI_HANDLE        &= nbsp;        SupportHandle
   );
 
+EFI_STATUS
+LocateDevicePathFromSnpInterface (
+  IN EFI_SIMPLE_NETWORK_PROTOCOL      &= nbsp;      *SnpInterface2,
+  IN EFI_DEVICE_PATH_PROTOCOL      &nbs= p;          **DevicePath, = ;     //reuse the EFI_DEVICE_PATH_PROTOCOL as EFI_LOADE= D_IMAGE_DEVICE_PATH_PROTOCOL
+  IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL     =   *StandardLib
+  );
 
 //
 // Prototypes of Internal Functions
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pr= otocol/AdapterInfo/BlackBoxTest/AdapterInfoBBTestConformance.c
index 19ccac93c7c7..7317e53ff1fc 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestConformance.c
@@ -93,7 +93,8 @@ BBTestGetInformationConformanceTest (
   EFI_STANDARD_TEST_LIBRARY_PROTOCOL    *Standard= Lib;
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_ADAPTER_INFORMATION_PROTOCOL     = *AdapterInfo;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // init
   //
@@ -111,6 +112,25 @@ BBTestGetInformationConformanceTest (
     return Status;
   }
 
+  Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
+
+
   //
   //Call check points
   //
@@ -137,7 +157,8 @@ BBTestSetInformationConformanceTest (
   EFI_STANDARD_TEST_LIBRARY_PROTOCOL    *Standard= Lib;
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_ADAPTER_INFORMATION_PROTOCOL     = *AdapterInfo;
-            &n= bsp;            = ;            &n= bsp; 
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;  &nb= sp;            =             &nb= sp;           
   //
   // init
   //
@@ -155,6 +176,23 @@ BBTestSetInformationConformanceTest (
     return Status;
   }
 
+  Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   //Call check points
   //
@@ -178,7 +216,8 @@ BBTestGetSupportedTypesConformanceTest (
   EFI_STANDARD_TEST_LIBRARY_PROTOCOL    *Standard= Lib;
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_ADAPTER_INFORMATION_PROTOCOL     = *AdapterInfo;
-            &n= bsp;            = ;            &n= bsp; 
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;  &nb= sp;            =             &nb= sp;           
   //
   // init
   //
@@ -195,7 +234,23 @@ BBTestGetSupportedTypesConformanceTest (
   if ( EFI_ERROR(Status) ) {
     return Status;
   }
-
+  Status=3DLocateDevicePathFromAdapterInfo(AdapterInfo,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   //Call check points
   //
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBo= xTest/AdapterInfoBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= AdapterInfo/BlackBoxTest/AdapterInfoBBTestMain.c
index cc37a497614e..8e884b4374e7 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/AdapterInfo/BlackBoxTest/A= dapterInfoBBTestMain.c
@@ -207,3 +207,99 @@ UnloadAdapterInfoBBTest (
            &nb= sp; gBBTestProtocolInterface
            &nb= sp; );
 }
+
+EFI_STATUS LocateDevicePathFromAdapterInfo(IN EFI_ADAPTER_INFORMATION_PROT= OCOL *AdapterInfo2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDA= RD_TEST_LIBRARY_PROTOCOL *StandardLib)
+{
+  EFI_STATUS Status;
+
+  UINTN NoHandles, Index;
+  EFI_HANDLE *HandleBuffer;
+  EFI_ADAPTER_INFORMATION_PROTOCOL *OtherAdapterInfo2;
+
+  //
+  // Locate the Handle that the AdapterInfo is bound to
+  //
+  Status =3D gtBS->LocateHandleBuffer(
+      ByProtocol,
+      &gEfiAdapterInformationProtocolGuid, +      NULL,
+      &NoHandles,
+      &HandleBuffer);
+  if (EFI_ERROR(Status))
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Status - %r",=
+        __FILE__,
+        (UINTN)__LINE__,
+        Status);
+    return Status;
+  }
+
+  if (NoHandles <=3D 0)
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Device Error"= ,
+        __FILE__,
+        (UINTN)__LINE__);
+    return EFI_DEVICE_ERROR;
+  }
+
+  //
+  // Find the exact handle that AdapterInfo bound to
+  //
+  for (Index =3D 0; Index < NoHandles; Index++)
+  {
+    Status =3D gtBS->HandleProtocol(
+        HandleBuffer[Index],
+        &gEfiAdapterInformationProt= ocolGuid,
+        (VOID **) &OtherAdapterInfo= 2);
+    if (EFI_ERROR(Status))
+    {
+      StandardLib->RecordAssertion(
+          StandardLib,
+          EFI_TEST_ASSERTION_= FAILED,
+          gTestGenericFailure= Guid,
+          L"BS.HandlePro= tocol - HandleProtocol",
+          L"%a:%d:Status= - %r",
+          __FILE__,
+          (UINTN)__LINE__, +          Status);
+
+      gtBS->FreePool(HandleBuffer);
+      return Status;
+    }
+
+    if (OtherAdapterInfo2 =3D=3D AdapterInfo2)
+    {
+      break;
+    }
+  }
+
+  //
+  // Locate the Loaded DevicePath Protocol bound to ADAPTER_INFORMATI= ON Protocol
+  //
+  if (Index >=3D NoHandles)
+  {
+    //
+    // No Handle Found!!
+    //
+    gtBS->FreePool(HandleBuffer);
+    return EFI_DEVICE_ERROR;
+  }
+
+  Status =3D gtBS->HandleProtocol(
+      HandleBuffer[Index],
+      &gBlackBoxEfiDevicePathProtocolGuid, +      (VOID **) DevicePath);
+
+  gtBS->FreePool(HandleBuffer);
+  return Status;
+}
\ No newline at end of file
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/EFI/Protocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestConformanc= e.c
index 964a64cd1d34..16ca0b323914 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestConformance.c
@@ -120,7 +120,8 @@ BBTestExtractConfigConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_HII_CONFIG_ACCESS_PROTOCOL     &n= bsp;  *HIIConfigAccess;
   EFI_HII_CONFIG_ROUTING_PROTOCOL     &= nbsp; *HIIConfigRouting;

+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // init
   //
@@ -137,6 +138,28 @@ BBTestExtractConfigConformanceTest (
   if (EFI_ERROR(Status)) {
     return Status;
   }
+  //
+  // Get Loaded Device Path of current EFI_HII_CONFIG_ACCESS_PROTOCOL=
+  // And out put device path or device name
+  //

+  Status =3D GetDevicePathProtocol(HIIConfigAccess,&DevicePath);<= br> +  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
 
   //
   // Get the Config Routing Protocol Interface
@@ -170,7 +193,8 @@ BBTestRouteConfigConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_HII_CONFIG_ACCESS_PROTOCOL     &n= bsp;  *HIIConfigAccess;
   EFI_HII_CONFIG_ROUTING_PROTOCOL     &= nbsp; *HIIConfigRouting;

+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // init
   //
@@ -187,7 +211,23 @@ BBTestRouteConfigConformanceTest (
   if (EFI_ERROR(Status)) {
     return Status;
   }
-
+  Status =3D GetDevicePathProtocol(HIIConfigAccess,&DevicePath);<= br> +  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Get the Config Routing Protocol Interface
   //
@@ -195,7 +235,7 @@ BBTestRouteConfigConformanceTest (
   if ( EFI_ERROR(Status) ) {
     return Status;
   }

+
   //
   //Call check points
   //
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/Bla= ckBoxTest/HIIConfigAccessBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/P= rotocol/HIIConfigAccess/BlackBoxTest/HIIConfigAccessBBTestMain.c
index 099b10f7a38a..2929d8f04c26 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/HIIConfigAccess/BlackBoxTe= st/HIIConfigAccessBBTestMain.c
@@ -381,6 +381,71 @@ GetDevicePath (
   return Status;
 }
 
+EFI_STATUS
+GetDevicePathProtocol (
+  IN  EFI_HII_CONFIG_ACCESS_PROTOCOL    *ConfigAc= cess,
+  IN EFI_DEVICE_PATH_PROTOCOL **DevicePath
+  )
+{
+  EFI_STATUS         &nb= sp;            =   Status;
+  UINTN          &n= bsp;            = ;      Index;
+  UINTN          &n= bsp;            = ;      NoHandles;
+  EFI_HANDLE         &nb= sp;            =   *HandleBuffer;
+  EFI_HANDLE         &nb= sp;            =   ConfigAccessHandle =3D NULL;
+  EFI_HII_CONFIG_ACCESS_PROTOCOL    *TestedConfigAcces= s;
+  UINTN          &n= bsp;            = ;      Length;
+  UINTN          &n= bsp;            = ;      PathHdrSize;
+
+  //
+  // locate all Hii Configuration Access Protocol Instances
+  //
+  Status =3D gtBS->LocateHandleBuffer (
+            &n= bsp;      ByProtocol,
+            &n= bsp;      &gBlackBoxEfiHIIConfigAccessProtocol= Guid,
+            &n= bsp;      NULL,
+            &n= bsp;      &NoHandles,
+            &n= bsp;      &HandleBuffer
+            &n= bsp;      );
+  if (EFI_ERROR(Status) || (NoHandles =3D=3D 0)) {
+    return EFI_NOT_FOUND;
+  }
+
+  //
+  // scan for the handle that matched with the Hii Configuration Acce= ss Protocol that
+  // passed in by the test framework
+  //
+  for (Index =3D 0; Index < NoHandles; Index++) {
+    Status =3D gtBS->HandleProtocol (
+            &n= bsp;        HandleBuffer[Index],
+            &n= bsp;        &gBlackBoxEfiHIIConfigAc= cessProtocolGuid,
+            &n= bsp;        (VOID **) &TestedConfigA= ccess
+            &n= bsp;        );
+    if (EFI_ERROR(Status)) {
+      continue;
+    }
+
+    if (TestedConfigAccess =3D=3D ConfigAccess) {
+      ConfigAccessHandle =3D HandleBuffer[Index];=
+      break;
+    }
+  }
+
+  gtBS->FreePool (HandleBuffer);
+
+  if (ConfigAccessHandle =3D=3D NULL) {
+    return EFI_NOT_FOUND;
+  }
+
+  //
+  // find controller handles managed by the component name handle. +  //
+  Status =3D gtBS->HandleProtocol (
+            &n= bsp;      ConfigAccessHandle,
+            &n= bsp;      &gBlackBoxEfiDevicePathProtocolGuid,=
+            &n= bsp;      (void **)DevicePath
+            &n= bsp;      );
+  return Status;
+}
 
 EFI_STATUS
 GetCorrespondingRequest (
@@ -654,4 +719,4 @@ MultiAltRespToMultiReq (
   SctFreePool (FreePtr);
  
   return EFI_SUCCESS;
-}
+}
\ No newline at end of file
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Pr= otocol/PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestConformance.c
index d03eb850c5ad..77b5afe388a3 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestConformance.c
@@ -50,6 +50,8 @@ BBTestNewStartConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -68,7 +70,23 @@ BBTestNewStartConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface
   //
@@ -237,6 +255,8 @@ BBTestNewStopConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -255,7 +275,23 @@ BBTestNewStopConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface
   //
@@ -418,6 +454,8 @@ BBTestStartConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -436,7 +474,23 @@ BBTestStartConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol state to enabled=
   //
@@ -522,6 +576,8 @@ BBTestStopConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -540,7 +596,23 @@ BBTestStopConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Make sure the EFI_PXE_BASE_CODE_PROTOCOL Protocol is disabl= ed
   //
@@ -606,6 +678,8 @@ BBTestDhcpConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -624,7 +698,23 @@ BBTestDhcpConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol to disabled
   //
@@ -791,6 +881,8 @@ BBTestDiscoverConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -809,7 +901,23 @@ BBTestDiscoverConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Change EFI_PXE_BASE_CODE_PROTOCOL Protocol to disabled
   //
@@ -988,6 +1096,8 @@ BBTestMtftpConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   UINTN         &nb= sp;            =            BlockSize=3D51= 2;
   EFI_IP_ADDRESS        =             &nb= sp;   ServerIp;
   CHAR8         &nb= sp;            =            *FileName;
@@ -1013,7 +1123,23 @@ BBTestMtftpConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Fill Parameters (ServerIp, FileName, BufferPtr)
   // Get parameter from ini file.
@@ -1473,6 +1599,8 @@ BBTestUdpWriteConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   EFI_IP_ADDRESS        =             &nb= sp;   DestIp;
   EFI_PXE_BASE_CODE_UDP_PORT      =       DestPort;
   UINTN         &nb= sp;            =            BufferSize; @@ -1501,7 +1629,23 @@ BBTestUdpWriteConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
@@ -1689,6 +1833,8 @@ BBTestUdpReadConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   UINT16         &n= bsp;            = ;          OpFlags;
   UINTN         &nb= sp;            =            BufferSize;    VOID         &nbs= p;            &= nbsp;           *BufferPt= r;
@@ -1713,7 +1859,23 @@ BBTestUdpReadConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Malloc for data
   BufferSize =3D MAX_UDP_SIZE;
   Status =3D gtBS->AllocatePool (EfiBootServicesData, BufferS= ize, (VOID **) &BufferPtr);
@@ -2004,6 +2166,8 @@ BBTestSetIpFilterConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   EFI_PXE_BASE_CODE_IP_FILTER      = ;     BcIpFilter;
 
   //
@@ -2023,7 +2187,23 @@ BBTestSetIpFilterConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
@@ -2083,11 +2263,12 @@ BBTestArpConformanceAutoTest (
   EFI_TEST_LOGGING_LIBRARY_PROTOCOL     *Log= gingLib;
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
-  EFI_PXE_BASE_CODE_PROTOCOL       = ;     *BcInterface;
   EFI_IP_ADDRESS        =             &nb= sp;   IpAddr;
+  EFI_PXE_BASE_CODE_PROTOCOL       = ;     *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
   //
   // Get support library (Standard Lib, Profile Lib, Logging Lib= )
   //
@@ -2110,7 +2291,23 @@ BBTestArpConformanceAutoTest (
            &nb= sp;       );
     return Status;
   }
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Disable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface
   //
@@ -2130,7 +2327,7 @@ BBTestArpConformanceAutoTest (
       return Status;
     }
   }
-

   //
   // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in Ipv= 4
   //
@@ -2232,6 +2429,8 @@ BBTestArpConformanceManualTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   EFI_IP_ADDRESS        =             &nb= sp;   IpAddr;
   EFI_MAC_ADDRESS        = ;            &n= bsp;  MacAddr;
   EFI_INI_FILE_HANDLE       &= nbsp;           FileHandl= e;
@@ -2263,7 +2462,23 @@ BBTestArpConformanceManualTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
@@ -2452,6 +2667,8 @@ BBTestSetParametersConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -2470,7 +2687,23 @@ BBTestSetParametersConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
@@ -2531,6 +2764,8 @@ BBTestSetStationIpConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -2549,7 +2784,23 @@ BBTestSetStationIpConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
@@ -2603,6 +2854,8 @@ BBTestSetPacketsConformanceTest (
   EFI_STATUS        &nbs= p;            &= nbsp;      Status;
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_PXE_BASE_CODE_PROTOCOL      =       *BcInterface;
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
 
   //
   // Get the Standard Library Interface
@@ -2621,7 +2874,23 @@ BBTestSetPacketsConformanceTest (
   // Get the EFI_PXE_BASE_CODE_PROTOCOL Protocol interface to be= tested
   //
   BcInterface =3D (EFI_PXE_BASE_CODE_PROTOCOL *)ClientInterface;=
-
+  Status=3DLocateDevicePathFromBcInterface(BcInterface,&DevicePat= h,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   // Disable EFI_PXE_BASE_CODE_PROTOCOL protocol if needed
   Status =3D ChangePxeState (BcInterface, FALSE, BcInterface->= ;Mode->Started, FALSE);
   if (EFI_ERROR(Status)) {
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBo= xTest/PxeBaseCodeBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestMain.c
index a2db1fb77e51..191f46002230 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest/P= xeBaseCodeBBTestMain.c
@@ -5,12 +5,12 @@
 
   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 lic= ense may be found at
+  which accompanies this distribution.  The full text of the lic= ense may be found at
   htt= p://opensource.org/licenses/bsd-license.php
-
+
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "A= S IS" BASIS,
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS OR IMPLIED.
-
+
 **/
 /*++
 
@@ -28,316 +28,94 @@ Abstract:
 #include "PxeBaseCodeBBTestMain.h"
 #include "PxeBaseCodeBBTestSupport.h"
 
-EFI_EVENT           = ;            TimerEv= ent;
-UINTN           &nb= sp;            =    gCallBackInvoked;
-EFI_PXE_BASE_CODE_FUNCTION      gFunction;
-EFI_PXE_CALLBACK         &nbs= p;      gOldCallBack;
-EFI_HANDLE          &nbs= p;           gHandle;
+EFI_EVENT TimerEvent;
+UINTN gCallBackInvoked;
+EFI_PXE_BASE_CODE_FUNCTION gFunction;
+EFI_PXE_CALLBACK gOldCallBack;
+EFI_HANDLE gHandle;
 
 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL NewCallBackProtocol =3D {
-  EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION,
-  NewCallBack
-};
+    EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION,
+    NewCallBack};
 
 EFI_BB_TEST_PROTOCOL_FIELD gEfiPxeBcTestProtField =3D {
-  PXE_BASE_CODE_TEST_REVISION,
-  EFI_PXE_BASE_CODE_PROTOCOL_GUID,
-  L"PXE Base Code Protocol Test",
-  L"Test PXE Base Code Protocol"
-};
+    PXE_BASE_CODE_TEST_REVISION,
+    EFI_PXE_BASE_CODE_PROTOCOL_GUID,
+    L"PXE Base Code Protocol Test",
+    L"Test PXE Base Code Protocol"};
 
 EFI_GUID gSupportProtocolGuid1[] =3D {
-  EFI_STANDARD_TEST_LIBRARY_GUID,
-  EFI_NULL_GUID
-};
+    EFI_STANDARD_TEST_LIBRARY_GUID,
+    EFI_NULL_GUID};
 
 EFI_BB_TEST_ENTRY_FIELD gPxeTestEntryField[] =3D {
-  {
-    PXE_START_FUNCTION_TEST_GUID,
-    L"Start_Func",
-    L"Function Test of Start",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestNewStartFunctionTest
-  },
-  {
-    PXE_STOP_FUNCTION_TEST_GUID,
-    L"Stop_Func",
-    L"Function Test of Stop",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestNewStopFunctionTest
-  },
-  {
-    PXE_SETIPFILTER_FUNCTION_TEST_GUID,
-    L"SetIpFilter_Func",
-    L"Function Test of SetIpFilter",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestSetIpFilterFunctionTest
-  },
-  {
-    PXE_START_CONFORMANCE_TEST_GUID,
-    L"Start_Conf",
-    L"Conformance Test for Start",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestNewStartConformanceTest
-  },
-  {
-    PXE_STOP_CONFORMANCE_TEST_GUID,
-    L"Stop_Conf",
-    L"Conformance Test for Stop",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestNewStopConformanceTest
-  },
-  {
-    PXE_ARP_CONFORMANCE_AUTO_TEST_GUID,
-    L"Arp_Conf",
-    L"Auto Conformance Test for Arp",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestArpConformanceAutoTest
-  },

-#ifdef EFI_TEST_EXHAUSTIVE        =    //Switch off the 5 old test case
+    {PXE_START_FUNCTION_TEST_GUID,
+     L"Start_Func",
+     L"Function Test of Start",
+     EFI_TEST_LEVEL_DEFAULT,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestNewStartFunctionTest},
+    {PXE_STOP_FUNCTION_TEST_GUID,
+     L"Stop_Func",
+     L"Function Test of Stop",
+     EFI_TEST_LEVEL_DEFAULT,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestNewStopFunctionTest},
+    {PXE_SETIPFILTER_FUNCTION_TEST_GUID,
+     L"SetIpFilter_Func",
+     L"Function Test of SetIpFilter",
+     EFI_TEST_LEVEL_DEFAULT,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestSetIpFilterFunctionTest},
+    {PXE_START_CONFORMANCE_TEST_GUID,
+     L"Start_Conf",
+     L"Conformance Test for Start",
+     EFI_TEST_LEVEL_MINIMAL,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestNewStartConformanceTest},
+    {PXE_STOP_CONFORMANCE_TEST_GUID,
+     L"Stop_Conf",
+     L"Conformance Test for Stop",
+     EFI_TEST_LEVEL_MINIMAL,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestNewStopConformanceTest},
+    {PXE_ARP_CONFORMANCE_AUTO_TEST_GUID,
+     L"Arp_Conf",
+     L"Auto Conformance Test for Arp",
+     EFI_TEST_LEVEL_MINIMAL,
+     gSupportProtocolGuid1,
+     EFI_TEST_CASE_AUTO,
+     BBTestArpConformanceAutoTest},
+
+#ifdef EFI_TEST_EXHAUSTIVE // Switch off the 5 old test case
     PXE_START_FUNCTION_TEST_GUID,
     L"Start_Func",
     L"Function Test of Start",
     EFI_TEST_LEVEL_DEFAULT,
     gSupportProtocolGuid1,
     EFI_TEST_CASE_AUTO,
-    BBTestStartFunctionTest
-  },
-  {
-    PXE_STOP_FUNCTION_TEST_GUID,
-    L"Stop_Func",
-    L"Function Test of Stop",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestStopFunctionTest
-  },
-  {
-    PXE_SETIPFILTER_FUNCTION_TEST_GUID,
-    L"SetIpFilter_Func",
-    L"Function Test of SetIpFilter",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestSetIpFilterFunctionTest
-  },
-  {
-    PXE_START_CONFORMANCE_TEST_GUID,
-    L"Start_Conf",
-    L"Conformance Test for Start",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestStartConformanceTest
-  },
-  {
-    PXE_STOP_CONFORMANCE_TEST_GUID,
-    L"Stop_Conf",
-    L"Conformance Test for Stop",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_AUTO,
-    BBTestStopConformanceTest
-  },
+    BBTestStartFunctionTest},
+            &n= bsp;           {PXE_STOP_= FUNCTION_TEST_GUID, L"Stop_Func", L"Function Test of Stop&qu= ot;, EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, BBT= estStopFunctionTest}, {PXE_SETIPFILTER_FUNCTION_TEST_GUID, L"SetIpFilt= er_Func", L"Function Test of SetIpFilter", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_T= EST_CASE_AUTO, BBTestSetIpFilterFunctionTest}, {PXE_START_CONFORMANCE_TEST_= GUID, L"Start_Conf", L"Conformance Test for Start", EFI= _TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, BBTestStartConformanceTest}, {PXE_STOP_CONFORMANCE_TEST_GUID, L"Stop_= Conf", L"Conformance Test for Stop", EFI_TEST_LEVEL_MINIMAL,= gSupportProtocolGuid1, EFI_TEST_CASE_AUTO, BBTestStopConformanceTest},
 
-//#ifdef EFI_TEST_EXHAUSTIVE
-  {
-    PXE_DHCP_FUNCTION_TEST_GUID,
-    L"Dhcp_Func_Manual",
-    L"Manual Function Test of Dhcp",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestDhcpFunctionTest
-  },
-  {
-    PXE_DISCOVER_FUNCTION_TEST_GUID,
-    L"Discover_Func_Manual",
-    L"Manual Function Test of Discover",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestDiscoverFunctionTest
-  },
-  {
-    PXE_MTFTP_FUNCTION_TEST_GUID,
-    L"Mtftp_Func_Manual",
-    L"Manual Function Test of Mtftp",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestMtftpFunctionTest
-  },
-  {
-    PXE_UDPWRITE_FUNCTION_TEST_GUID,
-    L"UdpWrite_Func_Manual",
-    L"Manual Function Test of UdpWrite",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestUdpWriteFunctionTest
-  },
-  {
-    PXE_UDPREAD_FUNCTION_TEST_GUID,
-    L"UdpRead_Func_Manual",
-    L"Manual Function Test of UdpRead",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestUdpReadFunctionTest
-  },
-  {
-    PXE_ARP_FUNCTION_TEST_GUID,
-    L"Arp_Func_Manual",
-    L"Manual Function Test of Arp",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestArpFunctionTest
-  },
-  {
-    PXE_SETPARAMETERS_FUNCTION_TEST_GUID,
-    L"SetParameters_Func_Manual",
-    L"Manual Function Test of SetParameters",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetParametersFunctionTest
-  },
-  {
-    PXE_SETSTATIONIP_FUNCTION_TEST_GUID,
-    L"SetStationIp_Func_Manual",
-    L"Manual Function Test of SetStationIp",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetStationIpFunctionTest
-  },
-  {
-    PXE_SETPACKETS_FUNCTION_TEST_GUID,
-    L"SetPackets_Func_Manual",
-    L"Manual Function Test of SetPackets",
-    EFI_TEST_LEVEL_DEFAULT,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetPacketsFunctionTest
-  },
-  {
-    PXE_DHCP_CONFORMANCE_TEST_GUID,
-    L"Dhcp_Conf_Manual",
-    L"Manual Conformance Test for Dhcp",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestDhcpConformanceTest
-  },
-  {
-    PXE_DISCOVER_CONFORMANCE_TEST_GUID,
-    L"Discover_Conf_Manual",
-    L"Manual Conformance Test for Discover",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestDiscoverConformanceTest
-  },
-  {
-    PXE_Mtftp_CONFORMANCE_TEST_GUID,
-    L"Mtftp_Conf_Manual",
-    L"Manual Conformance Test for Mtftp",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestMtftpConformanceTest
-  },
-  {
-    PXE_UDPWRITE_CONFORMANCE_TEST_GUID,
-    L"Dhcp_Conf_Manual",
-    L"Manual Conformance Test for UdpWrite",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestUdpWriteConformanceTest
-  },
-  {
-    PXE_UDPREAD_CONFORMANCE_TEST_GUID,
-    L"UdpRead_Conf_Manual",
-    L"Manual Conformance Test for UdpRead",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestUdpReadConformanceTest
-  },
-  {
-    PXE_SETIPFILTER_CONFORMANCE_TEST_GUID,
-    L"SetIpFilter_Conf_Manual",
-    L"Manual Conformance Test for SetIpFilter", -    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetIpFilterConformanceTest
-  },
-  {
-    PXE_ARP_CONFORMANCE_MANUAL_TEST_GUID,
-    L"ARP_Conf_Manual",
-    L"Manual Conformance Test for ARP",
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestArpConformanceManualTest
-  },
-  {
-    PXE_SETPARAMETERS_CONFORMANCE_TEST_GUID,
-    L"SetParameters_Conf_Manual",
-    L"Manual Conformance Test for SetParameters",=
-    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetParametersConformanceTest
-  },
-  {
-    PXE_SETSTATIONIP_CONFORMANCE_TEST_GUID,
-    L"SetStationIp_Conf_Manual",
-    L"Manual Conformance Test for SetStationIp",<= br> -    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetStationIpConformanceTest
-  },
-  {
-    PXE_SETPACKETS_CONFORMANCE_TEST_GUID,
-    L"SetPackets_Conf_Manual",
-    L"Manual Conformance Test for SetPackets", -    EFI_TEST_LEVEL_MINIMAL,
-    gSupportProtocolGuid1,
-    EFI_TEST_CASE_MANUAL,
-    BBTestSetPacketsConformanceTest
-  },
+            &n= bsp;           // #ifdef = EFI_TEST_EXHAUSTIVE
+    {PXE_DHCP_FUNCTION_TEST_GUID, L"Dhcp_Func_Manual&q= uot;, L"Manual Function Test of Dhcp", EFI_TEST_LEVEL_DEFAULT, gS= upportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestDhcpFunctionTest}, {PXE_DI= SCOVER_FUNCTION_TEST_GUID, L"Discover_Func_Manual", L"Manual= Function Test of Discover", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI= _TEST_CASE_MANUAL, BBTestDiscoverFunctionTest}, {PXE_MTFTP_FUNCTION_TEST_GU= ID, L"Mtftp_Func_Manual", L"Manual Function Test of Mtftp&qu= ot;, EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestMtftpFunctionTest}, {PXE_UDPWRITE_FUNCTION_TEST_GUID, L"UdpWrit= e_Func_Manual", L"Manual Function Test of UdpWrite", EFI_TES= T_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestUdpWrit= eFunctionTest}, {PXE_UDPREAD_FUNCTION_TEST_GUID, L"UdpRead_Func_Manual= ", L"Manual Function Test of UdpRead", EFI_TEST_LEVEL_DEFAULT, gSup= portProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestUdpReadFunctionTest}, {PXE_A= RP_FUNCTION_TEST_GUID, L"Arp_Func_Manual", L"Manual Function= Test of Arp", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestArpFunctionTest}, {PXE_SETPARAMETERS_FUNCTION_= TEST_GUID, L"SetParameters_Func_Manual", L"Manual Function T= est of SetParameters", EFI_TEST_LEVEL_DEFAULT, gSupportProtocolGuid1, = EFI_TEST_CASE_MANUAL, BBTestSetParametersFunctionTest}, {PXE_SETSTATIONIP_FUNCTION_TEST_GUID, L"SetStationIp_Func_Manual"= ;, L"Manual Function Test of SetStationIp", EFI_TEST_LEVEL_DEFAUL= T, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetStationIpFunctionT= est}, {PXE_SETPACKETS_FUNCTION_TEST_GUID, L"SetPackets_Func_Manual&quo= t;, L"Manual Function Test of SetPackets", EFI_TEST_LEVEL_DEFAULT, g= SupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetPacketsFunctionTest}, = {PXE_DHCP_CONFORMANCE_TEST_GUID, L"Dhcp_Conf_Manual", L"Manu= al Conformance Test for Dhcp", EFI_TEST_LEVEL_MINIMAL, gSupportProtoco= lGuid1, EFI_TEST_CASE_MANUAL, BBTestDhcpConformanceTest}, {PXE_DISCOVER_CONFORMANC= E_TEST_GUID, L"Discover_Conf_Manual", L"Manual Conformance T= est for Discover", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_= TEST_CASE_MANUAL, BBTestDiscoverConformanceTest}, {PXE_Mtftp_CONFORMANCE_TE= ST_GUID, L"Mtftp_Conf_Manual", L"Manual Conformance Test for Mtftp&q= uot;, EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, = BBTestMtftpConformanceTest}, {PXE_UDPWRITE_CONFORMANCE_TEST_GUID, L"Dh= cp_Conf_Manual", L"Manual Conformance Test for UdpWrite", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTes= tUdpWriteConformanceTest}, {PXE_UDPREAD_CONFORMANCE_TEST_GUID, L"UdpRe= ad_Conf_Manual", L"Manual Conformance Test for UdpRead", EFI= _TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestUdpReadConformanceTest}, {PXE_SETIPFILTER_CONFORMANCE_TEST_GUID, L&q= uot;SetIpFilter_Conf_Manual", L"Manual Conformance Test for SetIp= Filter", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_= MANUAL, BBTestSetIpFilterConformanceTest}, {PXE_ARP_CONFORMANCE_MANUAL_TEST= _GUID, L"ARP_Conf_Manual", L"Manual Conformance Test for ARP"= , EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTe= stArpConformanceManualTest}, {PXE_SETPARAMETERS_CONFORMANCE_TEST_GUID, L&qu= ot;SetParameters_Conf_Manual", L"Manual Conformance Test for SetParameters", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EF= I_TEST_CASE_MANUAL, BBTestSetParametersConformanceTest}, {PXE_SETSTATIONIP_= CONFORMANCE_TEST_GUID, L"SetStationIp_Conf_Manual", L"Manual= Conformance Test for SetStationIp", EFI_TEST_LEVEL_MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetStationIpConformance= Test}, {PXE_SETPACKETS_CONFORMANCE_TEST_GUID, L"SetPackets_Conf_Manual= ", L"Manual Conformance Test for SetPackets", EFI_TEST_LEVEL= _MINIMAL, gSupportProtocolGuid1, EFI_TEST_CASE_MANUAL, BBTestSetPacketsConformanceTest},
 #endif
 
-  EFI_NULL_GUID
-};
-
+            &n= bsp;           EFI_NULL_G= UID
+}
+;
 
 EFI_BB_TEST_PROTOCOL *gBBTestProtocolInterface;
 
 EFI_STATUS
 EFIAPI
-BBTestPxeBcUnload (
-  IN EFI_HANDLE       ImageHandle
-  );
+BBTestPxeBcUnload(
+    IN EFI_HANDLE ImageHandle);
 
 /**
  *  Creates/installs the BlackBox Interface and eminating Entry = Point node list.
@@ -349,34 +127,34 @@ BBTestPxeBcUnload (
  */
 EFI_STATUS
 EFIAPI
-InitializeBBTestPxeBCProtocol (
-  IN EFI_HANDLE         =   ImageHandle,
-  IN EFI_SYSTEM_TABLE     *SystemTable
-  )
+InitializeBBTestPxeBCProtocol(
+    IN EFI_HANDLE ImageHandle,
+    IN EFI_SYSTEM_TABLE *SystemTable)
 {
   EFI_STATUS Status;
 
-  EfiInitializeTestLib (ImageHandle, SystemTable);
-  SctInitializeLib (ImageHandle, SystemTable);
-  SctInitializeDriver (ImageHandle, SystemTable);
+  EfiInitializeTestLib(ImageHandle, SystemTable);
+  SctInitializeLib(ImageHandle, SystemTable);
+  SctInitializeDriver(ImageHandle, SystemTable);
 
-  Status =3D gtBS->CreateEvent (EVT_TIMER, 0, (EFI_EVENT_NOTIFY) N= ULL, NULL, &TimerEvent);
-  if (EFI_ERROR(Status)) {
+  Status =3D gtBS->CreateEvent(EVT_TIMER, 0, (EFI_EVENT_NOTIFY)NUL= L, NULL, &TimerEvent);
+  if (EFI_ERROR(Status))
+  {
     return Status;
   }
 
-  Status =3D GetSystemDevicePathAndFilePath (ImageHandle);
-  if (EFI_ERROR(Status)) {
+  Status =3D GetSystemDevicePathAndFilePath(ImageHandle);
+  if (EFI_ERROR(Status))
+  {
     return Status;
   }
 
-  return EfiInitAndInstallBBTestInterface (
-           &ImageHan= dle,
-           &gEfiPxeB= cTestProtField,
-           gPxeTestEntry= Field,
-           BBTestPxeBcUn= load,
-           &gBBTestP= rotocolInterface
-           );
+  return EfiInitAndInstallBBTestInterface(
+      &ImageHandle,
+      &gEfiPxeBcTestProtField,
+      gPxeTestEntryField,
+      BBTestPxeBcUnload,
+      &gBBTestProtocolInterface);
 }
 
 /**
@@ -386,29 +164,29 @@ InitializeBBTestPxeBCProtocol (
  */
 EFI_STATUS
 EFIAPI
-BBTestPxeBcUnload (
-  IN EFI_HANDLE       ImageHandle
-  )
+BBTestPxeBcUnload(
+    IN EFI_HANDLE ImageHandle)
 {
   EFI_STATUS Status;
 
-  if (gDevicePath !=3D NULL) {
-    gtBS->FreePool (gDevicePath);
+  if (gDevicePath !=3D NULL)
+  {
+    gtBS->FreePool(gDevicePath);
   }
 
-  if (gFilePath !=3D NULL) {
-    gtBS->FreePool (gFilePath);
+  if (gFilePath !=3D NULL)
+  {
+    gtBS->FreePool(gFilePath);
   }
 
-  Status =3D gtBS->CloseEvent (TimerEvent);
-  if (EFI_ERROR(Status)) {
-
+  Status =3D gtBS->CloseEvent(TimerEvent);
+  if (EFI_ERROR(Status))
+  {
   }
 
-  return EfiUninstallAndFreeBBTestInterface (
-           ImageHandle,<= br> -           gBBTestProtoc= olInterface
-           );
+  return EfiUninstallAndFreeBBTestInterface(
+      ImageHandle,
+      gBBTestProtocolInterface);
 }
 
 /******************************* Internal Function ******************= ******************/
@@ -422,42 +200,44 @@ BBTestPxeBcUnload (
  *  @return EFI_SUCCESS Finish the test successfully.
  */
 EFI_STATUS
-ChangePxeState (
-  IN EFI_PXE_BASE_CODE_PROTOCOL     *PxeInterface= ,
-  IN BOOLEAN         &nb= sp;            =   UsingIpv6,
-  IN BOOLEAN         &nb= sp;            =   Cur,
-  IN BOOLEAN         &nb= sp;            =   Nxt
-  )
+ChangePxeState(
+    IN EFI_PXE_BASE_CODE_PROTOCOL *PxeInterface,
+    IN BOOLEAN UsingIpv6,
+    IN BOOLEAN Cur,
+    IN BOOLEAN Nxt)
 {
-  if (Cur=3D=3DNxt) {
+  if (Cur =3D=3D Nxt)
+  {
     return EFI_SUCCESS;
   }
 
-  if (Cur =3D=3D TRUE) {
-    return PxeInterface->Stop (PxeInterface);
+  if (Cur =3D=3D TRUE)
+  {
+    return PxeInterface->Stop(PxeInterface);
   }
 
-  return PxeInterface->Start (PxeInterface, UsingIpv6);
+  return PxeInterface->Start(PxeInterface, UsingIpv6);
 }
 
 EFI_STATUS
-ReInitPxeBaseCode (
-  IN EFI_PXE_BASE_CODE_PROTOCOL    *BcInterface
-)
+ReInitPxeBaseCode(
+    IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface)
 {
-  EFI_STATUS     Status;
+  EFI_STATUS Status;
 
   // Re-initialize the EFI_PXE_BASE_CODE_PROTOCOL
   if (BcInterface->Mode->Started =3D=3D TRUE)
   {
-    Status =3D BcInterface->Stop (BcInterface);
-    if (EFI_ERROR(Status)){
+    Status =3D BcInterface->Stop(BcInterface);
+    if (EFI_ERROR(Status))
+    {
       return Status;
     }
   }
 
-  Status =3D BcInterface->Start (BcInterface, FALSE);
-  if (EFI_ERROR(Status)){
+  Status =3D BcInterface->Start(BcInterface, FALSE);
+  if (EFI_ERROR(Status))
+  {
     return Status;
   }
 
@@ -469,19 +249,19 @@ ReInitPxeBaseCode (
  *  @return TRUE to indicate user operation complete.
  */
 BOOLEAN
-WaitForAnyInput ()
+WaitForAnyInput()
 {
-  UINTN          &n= bsp;        NoWait =3D 1, WaitIndex;
-  EFI_EVENT         &nbs= p;     WaitList[1];
-  EFI_STATUS         &nb= sp;    Status;
-  EFI_INPUT_KEY         =   Key;
+  UINTN NoWait =3D 1, WaitIndex;
+  EFI_EVENT WaitList[1];
+  EFI_STATUS Status;
+  EFI_INPUT_KEY Key;
 
-  SctPrint (L"Press any key to continue...");
+  SctPrint(L"Press any key to continue...");
 
   //
   // Set 1 second periodic timer
   //
-  Status =3D gtBS->SetTimer (TimerEvent, TimerPeriodic, 10000000);=
+  Status =3D gtBS->SetTimer(TimerEvent, TimerPeriodic, 10000000);<= br>  
   //
   // Set up a wait list for a key and the timer
@@ -492,50 +272,50 @@ WaitForAnyInput ()
   //
   // Wait for either
   //
-  while (NoWait) {
-    Status =3D gtBS->WaitForEvent (NoWait, WaitList, &am= p;WaitIndex);
+  while (NoWait)
+  {
+    Status =3D gtBS->WaitForEvent(NoWait, WaitList, &= ;WaitIndex);
 
-    switch (WaitIndex) {
-      case 0:
-        //
-        // Read the key
-        //
-        Status =3D gtST->ConIn->R= eadKeyStroke (gtST->ConIn, &Key);
-        if (EFI_SUCCESS =3D=3D Status)<= br> -          NoWait =3D 0;
-        break;
+    switch (WaitIndex)
+    {
+    case 0:
+      //
+      // Read the key
+      //
+      Status =3D gtST->ConIn->ReadKeyStroke= (gtST->ConIn, &Key);
+      if (EFI_SUCCESS =3D=3D Status)
+        NoWait =3D 0;
+      break;
 
-      default:
-        break;
+    default:
+      break;
     }
   }
-  SctPrint (L"\r\n");
+  SctPrint(L"\r\n");
 
   //
   // Done, cancle periodic timer
   //
-  Status =3D gtBS->SetTimer (TimerEvent, TimerCancel, 0);
+  Status =3D gtBS->SetTimer(TimerEvent, TimerCancel, 0);
 
   return TRUE;
-
 }
 
-
 BOOLEAN
-WaitForUserCheck ()
+WaitForUserCheck()
 {
-  UINTN          &n= bsp;        NoWait =3D 1, WaitIndex;
-  EFI_EVENT         &nbs= p;     WaitList[1];
-  EFI_STATUS         &nb= sp;    Status;
-  EFI_INPUT_KEY         =   Key;
-  BOOLEAN          =        PressYes=3DFALSE;
+  UINTN NoWait =3D 1, WaitIndex;
+  EFI_EVENT WaitList[1];
+  EFI_STATUS Status;
+  EFI_INPUT_KEY Key;
+  BOOLEAN PressYes =3D FALSE;
 
-  SctPrint (L"\r\nPress \"Y\" or \"N\"...&qu= ot;);
+  SctPrint(L"\r\nPress \"Y\" or \"N\"...&quo= t;);
 
   //
   // Set 1 second periodic timer
   //
-  Status =3D gtBS->SetTimer (TimerEvent, TimerPeriodic, 10000000);=
+  Status =3D gtBS->SetTimer(TimerEvent, TimerPeriodic, 10000000);<= br>  
   //
   // Set up a wait list for a key and the timer
@@ -546,83 +326,88 @@ WaitForUserCheck ()
   //
   // Wait for either
   //
-  while (NoWait) {
-    Status =3D gtBS->WaitForEvent (NoWait, WaitList, &am= p;WaitIndex);
+  while (NoWait)
+  {
+    Status =3D gtBS->WaitForEvent(NoWait, WaitList, &= ;WaitIndex);
 
-    switch (WaitIndex) {
-      case 0:
-        //
-        // Read the key
-        //
-        Status =3D gtST->ConIn->R= eadKeyStroke (gtST->ConIn, &Key);
-        SctAPrint ((char *)(&Key.Un= icodeChar));
-        switch (Key.UnicodeChar) {
-          case 'Y':
-          case 'y':
-            NoWait = =3D 0;
-            PressYe= s =3D TRUE;
-            break;<= br> +    switch (WaitIndex)
+    {
+    case 0:
+      //
+      // Read the key
+      //
+      Status =3D gtST->ConIn->ReadKeyStroke= (gtST->ConIn, &Key);
+      SctAPrint((char *)(&Key.UnicodeChar));<= br> +      switch (Key.UnicodeChar)
+      {
+      case 'Y':
+      case 'y':
+        NoWait =3D 0;
+        PressYes =3D TRUE;
+        break;
 
-          case 'N':
-          case 'n':
-            NoWait = =3D 0;
-            PressYe= s =3D FALSE;
-            break;<= br> -
-          default :
-            SctPrin= t (L"\n");
-            break;<= br> -        }
+      case 'N':
+      case 'n':
+        NoWait =3D 0;
+        PressYes =3D FALSE;
         break;
 
       default:
+        SctPrint(L"\n");
         break;
+      }
+      break;
+
+    default:
+      break;
     }
   }
-  SctPrint (L"\r\n");
+  SctPrint(L"\r\n");
 
   //
   // Done, cancle periodic timer
   //
-  Status =3D gtBS->SetTimer (TimerEvent, TimerCancel, 0);
+  Status =3D gtBS->SetTimer(TimerEvent, TimerCancel, 0);
 
   return PressYes;
-
 }
 
 EFI_PXE_BASE_CODE_CALLBACK_STATUS
 EFIAPI
-NewCallBack (
-  IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL  *This,
-  IN EFI_PXE_BASE_CODE_FUNCTION      &n= bsp;    Function,
-  IN BOOLEAN         &nb= sp;            =         Received,
-  IN UINT32         &nbs= p;            &= nbsp;        PacketLen,
-  IN EFI_PXE_BASE_CODE_PACKET      &nbs= p;      *Packet OPTIONAL
-  )
+NewCallBack(
+    IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This,
+    IN EFI_PXE_BASE_CODE_FUNCTION Function,
+    IN BOOLEAN Received,
+    IN UINT32 PacketLen,
+    IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL)
 {
-  if (Function =3D=3D gFunction) {
-    gCallBackInvoked ++;
+  if (Function =3D=3D gFunction)
+  {
+    gCallBackInvoked++;
     return EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT; -  } else if (gOldCallBack !=3D NULL) {
-    return gOldCallBack (This, Function, Received, PacketLe= n, Packet);
-  } else {
+  }
+  else if (gOldCallBack !=3D NULL)
+  {
+    return gOldCallBack(This, Function, Received, PacketLen= , Packet);
+  }
+  else
+  {
     return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;=
   }
 }
 
 EFI_STATUS
-HookReturnAbortCallBack (
-  IN EFI_PXE_BASE_CODE_FUNCTION      &n= bsp;  FuncNum,
-  IN EFI_PXE_BASE_CODE_PROTOCOL      &n= bsp;  *BcInterface
-  )
+HookReturnAbortCallBack(
+    IN EFI_PXE_BASE_CODE_FUNCTION FuncNum,
+    IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface)
 {
-  EFI_STATUS         &nb= sp;            =     Status;
-  EFI_HANDLE         &nb= sp;            =     *HandleBuffer;
-  UINTN          &n= bsp;            = ;        HandleCount;
-  UINTN          &n= bsp;            = ;        Index;
-  EFI_PXE_BASE_CODE_PROTOCOL       = ;   *Interface;
+  EFI_STATUS Status;
+  EFI_HANDLE *HandleBuffer;
+  UINTN HandleCount;
+  UINTN Index;
+  EFI_PXE_BASE_CODE_PROTOCOL *Interface;
   EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *BcCallBack;
-  BOOLEAN          =             &nb= sp;      NewMakeCallback;
+  BOOLEAN NewMakeCallback;
 
   //
   // init global variables
@@ -634,14 +419,14 @@ HookReturnAbortCallBack (
   //
   // Locate all handles of Pxe protocol
   //
-  Status =3D gtBS->LocateHandleBuffer (
-            &n= bsp;      ByProtocol,
-            &n= bsp;      &gBlackBoxEfiPxeBaseCodeProtocolGuid= ,
-            &n= bsp;      NULL,
-            &n= bsp;      &HandleCount,
-            &n= bsp;      &HandleBuffer
-            &n= bsp;      );
-  if (EFI_ERROR (Status)) {
+  Status =3D gtBS->LocateHandleBuffer(
+      ByProtocol,
+      &gBlackBoxEfiPxeBaseCodeProtocolGuid, +      NULL,
+      &HandleCount,
+      &HandleBuffer);
+  if (EFI_ERROR(Status))
+  {
     return EFI_NOT_FOUND;
   }
 
@@ -649,67 +434,70 @@ HookReturnAbortCallBack (
   // Looking for the handle corresponding to the BcInterface
   //
   gHandle =3D NULL;
-  for (Index =3D 0; Index < HandleCount; Index +=3D 1) {
-    Status =3D gtBS->HandleProtocol (
-            &n= bsp;        HandleBuffer[Index],
-            &n= bsp;        &gBlackBoxEfiPxeBaseCode= ProtocolGuid,
-            &n= bsp;        (VOID **)&Interface
-            &n= bsp;      );
-    if (BcInterface =3D=3D Interface) {
+  for (Index =3D 0; Index < HandleCount; Index +=3D 1)
+  {
+    Status =3D gtBS->HandleProtocol(
+        HandleBuffer[Index],
+        &gBlackBoxEfiPxeBaseCodePro= tocolGuid,
+        (VOID **)&Interface);
+    if (BcInterface =3D=3D Interface)
+    {
       gHandle =3D HandleBuffer[Index];
       break;
     }
   }
 
-  gtBS->FreePool (HandleBuffer);
+  gtBS->FreePool(HandleBuffer);
 
-  if (gHandle =3D=3D NULL) {
+  if (gHandle =3D=3D NULL)
+  {
     return EFI_NOT_FOUND;
   }
 
   //
   // Is Pxe Callback probocol installed?
   //
-  Status =3D gtBS->HandleProtocol (
-            &n= bsp;      gHandle,
-            &n= bsp;      &gBlackBoxEfiPxeBaseCodeCallbackProt= ocolGuid,
-            &n= bsp;      (VOID **)&BcCallBack
-            &n= bsp;      );
-  if (Status =3D=3D EFI_SUCCESS) {
+  Status =3D gtBS->HandleProtocol(
+      gHandle,
+      &gBlackBoxEfiPxeBaseCodeCallbackProtoco= lGuid,
+      (VOID **)&BcCallBack);
+  if (Status =3D=3D EFI_SUCCESS)
+  {
     // Replace the previous call back function
     gOldCallBack =3D BcCallBack->Callback;
     BcCallBack->Callback =3D NewCallBack;
-  } else {
+  }
+  else
+  {
     //
     // Install a call back protocol
     //
-    Status =3D gtBS->InstallProtocolInterface (
-            &n= bsp;        &gHandle,
-            &n= bsp;        &gBlackBoxEfiPxeBaseCode= CallbackProtocolGuid,
-            &n= bsp;        EFI_NATIVE_INTERFACE,
-            &n= bsp;        &NewCallBackProtocol
-            &n= bsp;        );
-    if (EFI_ERROR(Status)) {
+    Status =3D gtBS->InstallProtocolInterface(
+        &gHandle,
+        &gBlackBoxEfiPxeBaseCodeCal= lbackProtocolGuid,
+        EFI_NATIVE_INTERFACE,
+        &NewCallBackProtocol);
+    if (EFI_ERROR(Status))
+    {
       return Status;
     }
     //
     // Enable PXE to use call back
     //
     NewMakeCallback =3D TRUE;
-    Status =3D BcInterface->SetParameters (
-            &n= bsp;            = ;   BcInterface,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   &NewMakeCallback
-            &n= bsp;            = ;   );
-    if (EFI_ERROR(Status)) {
-      gtBS->UninstallProtocolInterface (
-            &n= bsp; gHandle,
-            &n= bsp; &gBlackBoxEfiPxeBaseCodeCallbackProtocolGuid,
-            &n= bsp; &NewCallBackProtocol
-            &n= bsp; );
+    Status =3D BcInterface->SetParameters(
+        BcInterface,
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        &NewMakeCallback);
+    if (EFI_ERROR(Status))
+    {
+      gtBS->UninstallProtocolInterface(
+          gHandle,
+          &gBlackBoxEfiPx= eBaseCodeCallbackProtocolGuid,
+          &NewCallBackPro= tocol);
       return Status;
     }
   }
@@ -718,48 +506,50 @@ HookReturnAbortCallBack (
 }
 
 EFI_STATUS
-UnHookReturnAbortCallBack (
-  IN EFI_PXE_BASE_CODE_PROTOCOL      &n= bsp;     *BcInterface
-  )
+UnHookReturnAbortCallBack(
+    IN EFI_PXE_BASE_CODE_PROTOCOL *BcInterface)
 {
-  EFI_STATUS         &nb= sp;            =     Status;
+  EFI_STATUS Status;
   EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *BcCallBack;
-  BOOLEAN          =             &nb= sp;      NewMakeCallback;
+  BOOLEAN NewMakeCallback;
 
-  if (gOldCallBack !=3D NULL) {
-    Status =3D gtBS->HandleProtocol (
-            &n= bsp;        gHandle,
-            &n= bsp;        &gBlackBoxEfiPxeBaseCode= CallbackProtocolGuid,
-            &n= bsp;        (VOID **)&BcCallBack
-            &n= bsp;        );
-    if (EFI_ERROR(Status)) {
+  if (gOldCallBack !=3D NULL)
+  {
+    Status =3D gtBS->HandleProtocol(
+        gHandle,
+        &gBlackBoxEfiPxeBaseCodeCal= lbackProtocolGuid,
+        (VOID **)&BcCallBack);
+    if (EFI_ERROR(Status))
+    {
       return Status;
     }
     // restore the previous call back function
     BcCallBack->Callback =3D gOldCallBack;
     gOldCallBack =3D NULL;
-  } else {
+  }
+  else
+  {
     //
     // Disable PXE to use call back
     //
     NewMakeCallback =3D FALSE;
-    Status =3D BcInterface->SetParameters (
-            &n= bsp;            = ;   BcInterface,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   NULL,
-            &n= bsp;            = ;   &NewMakeCallback
-            &n= bsp;            = ;   );
-    if (EFI_ERROR(Status)) {
+    Status =3D BcInterface->SetParameters(
+        BcInterface,
+        NULL,
+        NULL,
+        NULL,
+        NULL,
+        &NewMakeCallback);
+    if (EFI_ERROR(Status))
+    {
       return Status;
     }
-    Status =3D gtBS->UninstallProtocolInterface (
-            &n= bsp;        gHandle,
-            &n= bsp;        &gBlackBoxEfiPxeBaseCode= CallbackProtocolGuid,
-            &n= bsp;        &NewCallBackProtocol
-            &n= bsp;        );
-    if (EFI_ERROR(Status)) {
+    Status =3D gtBS->UninstallProtocolInterface(
+        gHandle,
+        &gBlackBoxEfiPxeBaseCodeCal= lbackProtocolGuid,
+        &NewCallBackProtocol);
+    if (EFI_ERROR(Status))
+    {
       return Status;
     }
   }
@@ -768,44 +558,44 @@ UnHookReturnAbortCallBack (
 }
 
 BOOLEAN
-IsPxePacketValid (
-  IN EFI_PXE_PACKET_TYPE       &nb= sp; PacketType,
-  IN EFI_PXE_BASE_CODE_PACKET    *Packet
-  )
+IsPxePacketValid(
+    IN EFI_PXE_PACKET_TYPE PacketType,
+    IN EFI_PXE_BASE_CODE_PACKET *Packet)
 {
-  //BootpOpCode
+  // BootpOpCode
   switch (PacketType)
   {
-    case EFI_PXE_PACKET_TYPE_DHCP_DISCOVER:
-      return TRUE;
+  case EFI_PXE_PACKET_TYPE_DHCP_DISCOVER:
+    return TRUE;
 
-    case EFI_PXE_PACKET_TYPE_DHCP_ACK:
-      return TRUE;
+  case EFI_PXE_PACKET_TYPE_DHCP_ACK:
+    return TRUE;
 
-    case EFI_PXE_PACKET_TYPE_PROXY_OFFER:
-      return TRUE;
+  case EFI_PXE_PACKET_TYPE_PROXY_OFFER:
+    return TRUE;
 
-    case EFI_PXE_PACKET_TYPE_PXE_DISCOVER:
-      return TRUE;
+  case EFI_PXE_PACKET_TYPE_PXE_DISCOVER:
+    return TRUE;
 
-    case EFI_PXE_PACKET_TYPE_PXE_OFFER:
-      return TRUE;
+  case EFI_PXE_PACKET_TYPE_PXE_OFFER:
+    return TRUE;
 
-    default:
-      return FALSE;
+  default:
+    return FALSE;
   }
 }
 
 BOOLEAN
-IsBufZeroed (
-  IN CHAR8          = ;      *Buf,
-  IN UINTN          = ;       Len
-  )
+IsBufZeroed(
+    IN CHAR8 *Buf,
+    IN UINTN Len)
 {
   UINTN i;
 
-  for (i=3D0; i<Len; i++) {
-    if (0 !=3D *(Buf + i)) {
+  for (i =3D 0; i < Len; i++)
+  {
+    if (0 !=3D *(Buf + i))
+    {
       return FALSE;
     }
   }
@@ -813,126 +603,122 @@ IsBufZeroed (
   return TRUE;
 }
 
-
 EFI_STATUS
-PrintPxePacket (
-  IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
-  IN CHAR16         &nbs= p;            &= nbsp;     *Title,
-  IN EFI_PXE_BASE_CODE_PACKET      &nbs= p;   *Packet
-  )
+PrintPxePacket(
+    IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
+    IN CHAR16 *Title,
+    IN EFI_PXE_BASE_CODE_PACKET *Packet)
 {
-  UINT16          &= nbsp;           &nbs= p;         TempUint16;
+  UINT16 TempUint16;
 
   if (NULL =3D=3D Packet || NULL =3D=3D LoggingLib)
     return EFI_INVALID_PARAMETER;
 
   // print the packet type
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, Title, SctStrLen (Title));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, Title, SctStrLen(Title));
 
   // print the raw packet
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Raw Packet]", SctStr= Len (L"[Raw Packet]"));
-  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*) (Packet->Raw),1472/2); +  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Raw Packet]", SctStr= Len(L"[Raw Packet]"));
+  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Raw), 1472 / 2);=
 
   TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpOpcode;
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Opcode]", SctS= trLen (L"[Bootp Opcode]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Opcode]", SctS= trLen(L"[Bootp Opcode]"));
   LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16);
 
   TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpHwType;
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Type]", Sct= StrLen (L"[Bootp Hw Type]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Type]", Sct= StrLen(L"[Bootp Hw Type]"));
   LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16);
 
   TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpHwAddrLen;
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Addr Len]",= SctStrLen (L"[Bootp Hw Addr Len]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Hw Addr Len]",= SctStrLen(L"[Bootp Hw Addr Len]"));
   LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16);
 
   TempUint16 =3D (UINT16)Packet->Dhcpv4.BootpGateHops;
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Gate Hop]", Sc= tStrLen (L"[Bootp Gate Hop]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Gate Hop]", Sc= tStrLen(L"[Bootp Gate Hop]"));
   LOG_UINT16_HEX_DFLT(LoggingLib, TempUint16);
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Iden]", SctStr= Len (L"[Bootp Iden]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Iden]", SctStr= Len(L"[Bootp Iden]"));
   LOG_UINT32_HEX_DFLT(LoggingLib, (Packet->Dhcpv4.BootpIdent)= );
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Seconds]", Sct= StrLen (L"[Bootp Seconds]"));
-  LOG_UINT16_HEX_DFLT(LoggingLib,Packet->Dhcpv4.BootpSeconds);
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Seconds]", Sct= StrLen(L"[Bootp Seconds]"));
+  LOG_UINT16_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpSeconds);  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Flags]", SctSt= rLen (L"[Bootp Flags]"));
-  LOG_UINT16_HEX_DFLT(LoggingLib,(Packet->Dhcpv4.BootpFlags));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Flags]", SctSt= rLen(L"[Bootp Flags]"));
+  LOG_UINT16_HEX_DFLT(LoggingLib, (Packet->Dhcpv4.BootpFlags));  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp CiAddr]", SctS= trLen (L"[Bootp CiAddr]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp CiAddr]", SctS= trLen(L"[Bootp CiAddr]"));
   LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpCiAddr);  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp YiAddr]", SctS= trLen (L"[Bootp YiAddr]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp YiAddr]", SctS= trLen(L"[Bootp YiAddr]"));
   LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpYiAddr);  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SiAddr]", SctS= trLen (L"[Bootp SiAddr]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SiAddr]", SctS= trLen(L"[Bootp SiAddr]"));
   LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpSiAddr);  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp GiAddr]", SctS= trLen (L"[Bootp GiAddr]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp GiAddr]", SctS= trLen(L"[Bootp GiAddr]"));
   LOG_IP_HEX_DFLT(LoggingLib, Packet->Dhcpv4.BootpGiAddr);  
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp HwAddr]", SctS= trLen (L"[Bootp HwAddr]"));
-  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpSrvNa= me), 32);
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp HwAddr]", SctS= trLen(L"[Bootp HwAddr]"));
+  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpSrvN= ame), 32);
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SrvName]", Sct= StrLen (L"[Bootp SrvName]"));
-  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpHwAdd= r), 8);
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp SrvName]", Sct= StrLen(L"[Bootp SrvName]"));
+  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpHwAd= dr), 8);
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp BootFile]", Sc= tStrLen (L"[Bootp BootFile]"));
-  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)(Packet->Dhcpv4.BootpBootF= ile), 64);
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp BootFile]", Sc= tStrLen(L"[Bootp BootFile]"));
+  LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)(Packet->Dhcpv4.BootpBoot= File), 64);
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Magik]", SctSt= rLen (L"[Bootp Magik]"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Bootp Magik]", SctSt= rLen(L"[Bootp Magik]"));
   LOG_UINT32_HEX_DFLT(LoggingLib, Packet->Dhcpv4.DhcpMagik);<= br>  
   return EFI_SUCCESS;
 }
 
 EFI_STATUS
-PrintArpTable (
-  IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
-  IN EFI_PXE_BASE_CODE_MODE       =      *Mode
-  )
+PrintArpTable(
+    IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
+    IN EFI_PXE_BASE_CODE_MODE *Mode)
 {
-  UINTN          &n= bsp;       i, cnt;
-  CHAR16          &= nbsp;     *Buffer;
+  UINTN i, cnt;
+  CHAR16 *Buffer;
 
-  LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, L&qu= ot;Arp Entry is", (UINT32)SctStrLen (L"Arp Entry is"), EFI_D= UMP_ASCII);
+  LoggingLib->DumpBuf(LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, L&quo= t;Arp Entry is", (UINT32)SctStrLen(L"Arp Entry is"), EFI_DUM= P_ASCII);
   cnt =3D 0;
   for (i =3D 0; i < EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES; i++)    {
-    if (FALSE =3D=3D IsBufZeroed ((CHAR8 *)(&Mode->A= rpCache[i]), sizeof (EFI_PXE_BASE_CODE_ARP_ENTRY)))
+    if (FALSE =3D=3D IsBufZeroed((CHAR8 *)(&Mode->Ar= pCache[i]), sizeof(EFI_PXE_BASE_CODE_ARP_ENTRY)))
     {
-      cnt ++;
+      cnt++;
       Buffer =3D (CHAR16 *)(&Mode->Ar= pCache[i]);
-      LoggingLib->DumpBuf (LoggingLib, EFI_VER= BOSE_LEVEL_DEFAULT, Buffer, (UINT32)SctStrLen (Buffer), EFI_DUMP_HEX);
+      LoggingLib->DumpBuf(LoggingLib, EFI_VERB= OSE_LEVEL_DEFAULT, Buffer, (UINT32)SctStrLen(Buffer), EFI_DUMP_HEX);
     }
   }
 
   if (cnt =3D=3D Mode->ArpCacheEntries)
     return EFI_SUCCESS;
 
-  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Arp Cache Unmatched",= SctStrLen (L"Arp Cache Unmatched"));
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Arp Cache Unmatched",= SctStrLen(L"Arp Cache Unmatched"));
   return EFI_INVALID_PARAMETER;
 }
 
 EFI_STATUS
 SetIpAndMask(
-  IN EFI_IP_ADDRESS       *EfiIp,
-  IN EFI_IP_ADDRESS       *EfiMask,
-  IN UINT32         &nbs= p;     NumIpv4,
-  IN UINT32         &nbs= p;     NumMask
-  )
+    IN EFI_IP_ADDRESS *EfiIp,
+    IN EFI_IP_ADDRESS *EfiMask,
+    IN UINT32 NumIpv4,
+    IN UINT32 NumMask)
 {
-  EFI_STATUS         &nb= sp;   Status;
+  EFI_STATUS Status;
 
   if (NULL !=3D EfiIp)
   {
-    Status =3D SetIpAddress (EfiIp, NumIpv4);
+    Status =3D SetIpAddress(EfiIp, NumIpv4);
     if (EFI_ERROR(Status))
       return Status;
   }
 
   if (NULL !=3D EfiMask)
   {
-    Status =3D SetIpAddress (EfiMask, NumMask);
+    Status =3D SetIpAddress(EfiMask, NumMask);
     if (EFI_ERROR(Status))
       return Status;
   }
@@ -940,10 +726,9 @@ SetIpAndMask(
 }
 
 EFI_STATUS
-SetIpAddress (
-  IN OUT EFI_IP_ADDRESS *EfiIp,
-  IN     UINT32     &nbs= p;   NumIpv4
-  )
+SetIpAddress(
+    IN OUT EFI_IP_ADDRESS *EfiIp,
+    IN UINT32 NumIpv4)
 {
   if (NULL =3D=3D EfiIp)
     return EFI_INVALID_PARAMETER;
@@ -957,21 +742,24 @@ SetIpAddress (
 }
 
 BOOLEAN
-IsIpMaskEqual (
-  IN EFI_IP_ADDRESS *NewStationIp,
-  IN EFI_IP_ADDRESS *NewSubnetMask,
-  IN EFI_IP_ADDRESS *OldStationIp,
-  IN EFI_IP_ADDRESS *OldSubnetMask
-  )
+IsIpMaskEqual(
+    IN EFI_IP_ADDRESS *NewStationIp,
+    IN EFI_IP_ADDRESS *NewSubnetMask,
+    IN EFI_IP_ADDRESS *OldStationIp,
+    IN EFI_IP_ADDRESS *OldSubnetMask)
 {
-  if (NULL !=3D NewStationIp){
-    if (FALSE =3D=3D (0 =3D=3D SctCompareMem (NewStationIp,= OldStationIp, sizeof (EFI_IP_ADDRESS)))) {
+  if (NULL !=3D NewStationIp)
+  {
+    if (FALSE =3D=3D (0 =3D=3D SctCompareMem(NewStationIp, = OldStationIp, sizeof(EFI_IP_ADDRESS))))
+    {
       return FALSE;
     }
   }
 
-  if (NULL !=3D NewSubnetMask){
-    if (FALSE =3D=3D (0 =3D=3D SctCompareMem (NewSubnetMask= , OldSubnetMask, sizeof (EFI_IP_ADDRESS)))){
+  if (NULL !=3D NewSubnetMask)
+  {
+    if (FALSE =3D=3D (0 =3D=3D SctCompareMem(NewSubnetMask,= OldSubnetMask, sizeof(EFI_IP_ADDRESS))))
+    {
       return FALSE;
     }
   }
@@ -979,55 +767,59 @@ IsIpMaskEqual (
 }
 
 EFI_STATUS
-CopyPxePacket (
-  IN EFI_PXE_BASE_CODE_PACKET *DestPacket,
-  IN EFI_PXE_BASE_CODE_PACKET *SrcPacket
-  )
+CopyPxePacket(
+    IN EFI_PXE_BASE_CODE_PACKET *DestPacket,
+    IN EFI_PXE_BASE_CODE_PACKET *SrcPacket)
 {
-  if (NULL =3D=3D DestPacket) {
+  if (NULL =3D=3D DestPacket)
+  {
     return EFI_SUCCESS;
   }
 
-  if (NULL =3D=3D SrcPacket) {
+  if (NULL =3D=3D SrcPacket)
+  {
     return EFI_INVALID_PARAMETER;
   }
 
-  SctCopyMem (DestPacket, SrcPacket, sizeof (EFI_PXE_BASE_CODE_PACKET= ));
+  SctCopyMem(DestPacket, SrcPacket, sizeof(EFI_PXE_BASE_CODE_PACKET))= ;
   return EFI_SUCCESS;
 }
 
 BOOLEAN
-IsPxePacketEqual (
-  IN EFI_PXE_BASE_CODE_PACKET *DestPacket,
-  IN EFI_PXE_BASE_CODE_PACKET *SrcPacket
-  )
+IsPxePacketEqual(
+    IN EFI_PXE_BASE_CODE_PACKET *DestPacket,
+    IN EFI_PXE_BASE_CODE_PACKET *SrcPacket)
 {
-  if (NULL =3D=3D DestPacket && NULL =3D=3D SrcPacket) {
+  if (NULL =3D=3D DestPacket && NULL =3D=3D SrcPacket)
+  {
     return TRUE;
   }
-  if (0=3D=3DSctCompareMem (DestPacket, SrcPacket, sizeof (EFI_PXE_BA= SE_CODE_PACKET))){
+  if (0 =3D=3D SctCompareMem(DestPacket, SrcPacket, sizeof(EFI_PXE_BA= SE_CODE_PACKET)))
+  {
     return TRUE;
   }
   return FALSE;
 }
 
 BOOLEAN
-IsIpFilterEqual (
-  IN EFI_PXE_BASE_CODE_IP_FILTER *SrcIpFilter,
-  IN EFI_PXE_BASE_CODE_IP_FILTER *DstIpFilter
-  )
+IsIpFilterEqual(
+    IN EFI_PXE_BASE_CODE_IP_FILTER *SrcIpFilter,
+    IN EFI_PXE_BASE_CODE_IP_FILTER *DstIpFilter)
 {
-  if (NULL =3D=3D SrcIpFilter && NULL =3D=3D DstIpFilter) { +  if (NULL =3D=3D SrcIpFilter && NULL =3D=3D DstIpFilter)
+  {
     return TRUE;
   }
 
   if (NULL !=3D SrcIpFilter && NULL !=3D DstIpFilter)    {
-    if (SrcIpFilter->IpCnt !=3D DstIpFilter->IpCnt) {=
+    if (SrcIpFilter->IpCnt !=3D DstIpFilter->IpCnt) +    {
       return FALSE;
     }
 
-    if (0=3D=3DSctCompareMem (SrcIpFilter->IpList, DstIp= Filter->IpList, sizeof (EFI_IP_ADDRESS) * SrcIpFilter->IpCnt)){
+    if (0 =3D=3D SctCompareMem(SrcIpFilter->IpList, DstI= pFilter->IpList, sizeof(EFI_IP_ADDRESS) * SrcIpFilter->IpCnt))
+    {
       return TRUE;
     }
   }
@@ -1035,71 +827,167 @@ IsIpFilterEqual (
 }
 
 EFI_STATUS
-LogUdpPacket (
-  IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
-  IN EFI_IP_ADDRESS        &n= bsp;           *DestIp, -  IN EFI_PXE_BASE_CODE_UDP_PORT      &n= bsp; *DestPort,
-  IN EFI_IP_ADDRESS        &n= bsp;           *SrcIp, -  IN EFI_PXE_BASE_CODE_UDP_PORT      &n= bsp; *SrcPort,
-  IN UINTN          = ;            &n= bsp;       BufferSize,
-  IN VOID          =             &nb= sp;       *BufferPtr
-  )
+LogUdpPacket(
+    IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
+    IN EFI_IP_ADDRESS *DestIp,
+    IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
+    IN EFI_IP_ADDRESS *SrcIp,
+    IN EFI_PXE_BASE_CODE_UDP_PORT *SrcPort,
+    IN UINTN BufferSize,
+    IN VOID *BufferPtr)
 {
-  if (NULL!=3DDestIp)
+  if (NULL !=3D DestIp)
   {
-    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest IP]"= ;, SctStrLen (L"[Dest IP]"));
-    //LOG_IP_HEX_DFLT (LoggingLib, DestIp->v4.Addr);
-    LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)&DestIp, size= of (EFI_IP_ADDRESS)/2);
+    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest IP]"= ;, SctStrLen(L"[Dest IP]"));
+    // LOG_IP_HEX_DFLT (LoggingLib, DestIp->v4.Addr); +    LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)&DestIp, siz= eof(EFI_IP_ADDRESS) / 2);
   }
 
   if (NULL !=3D DestPort)
   {
-    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest Port]&qu= ot;, SctStrLen (L"[Dest Port]"));
+    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Dest Port]&qu= ot;, SctStrLen(L"[Dest Port]"));
     LOG_UINT16_HEX_DFLT(LoggingLib, *DestPort);
   }
 
   if (NULL !=3D SrcIp)
   {
-    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src IP]"= , SctStrLen (L"[Src IP]"));
-    //LOG_IP_HEX_DFLT (LoggingLib, SrcIp->v4.Addr);
-    LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16*)&SrcIp, sizeo= f (EFI_IP_ADDRESS)/2);
+    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src IP]"= , SctStrLen(L"[Src IP]"));
+    // LOG_IP_HEX_DFLT (LoggingLib, SrcIp->v4.Addr);
+    LOG_BUF_HEX_DFLT(LoggingLib, (CHAR16 *)&SrcIp, size= of(EFI_IP_ADDRESS) / 2);
   }
 
   if (NULL !=3D SrcPort)
   {
-    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src Port]&quo= t;, SctStrLen (L"[Src Port]"));
+    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"[Src Port]&quo= t;, SctStrLen(L"[Src Port]"));
     LOG_UINT16_HEX_DFLT(LoggingLib, *SrcPort);
   }
-  if (0!=3DBufferSize)
+  if (0 !=3D BufferSize)
   {
-    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Received UDP P= acket", SctStrLen (L"Received UDP Packet"));
+    LOG_CHAR16_ASCII_DFLT(LoggingLib, L"Received UDP P= acket", SctStrLen(L"Received UDP Packet"));
     LOG_BUF_HEX_DFLT(LoggingLib, BufferPtr, BufferSize= );
   }
   return EFI_SUCCESS;
 }
 
 EFI_STATUS
-LogChar8String (
-  IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL     &= nbsp;     *LoggingLib,
-  IN CHAR8          = ;            &n= bsp;            = ;    *Buffer,
-  IN UINTN          = ;            &n= bsp;            = ;     Len
-  )
+LogChar8String(
+    IN EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib,
+    IN CHAR8 *Buffer,
+    IN UINTN Len)
 {
-  EFI_STATUS         &nb= sp; Status;
-  CHAR16          &= nbsp;   *TempBuffer;
+  EFI_STATUS Status;
+  CHAR16 *TempBuffer;
 
-  if (NULL =3D=3D Buffer) {
+  if (NULL =3D=3D Buffer)
+  {
     return EFI_INVALID_PARAMETER;
   }
 
-  Status =3D gtBS->AllocatePool (EfiRuntimeServicesData, Len * siz= eof (CHAR16), (VOID **) &TempBuffer);
-  if (EFI_ERROR(Status)) {
+  Status =3D gtBS->AllocatePool(EfiRuntimeServicesData, Len * size= of(CHAR16), (VOID **)&TempBuffer);
+  if (EFI_ERROR(Status))
+  {
     return Status;
   }
-  SctZeroMem (&TempBuffer, Len * sizeof (CHAR16));
+  SctZeroMem(&TempBuffer, Len * sizeof(CHAR16));
 
-  LOG_CHAR16_ASCII_DFLT (LoggingLib, TempBuffer, Len);
+  LOG_CHAR16_ASCII_DFLT(LoggingLib, TempBuffer, Len);
 
-  gtBS->FreePool (TempBuffer);
+  gtBS->FreePool(TempBuffer);
   return EFI_SUCCESS;
 }
+
+EFI_STATUS LocateDevicePathFromBcInterface(IN EFI_PXE_BASE_CODE_PROTOCOL *= BcInterface2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDARD_TES= T_LIBRARY_PROTOCOL *StandardLib)
+{
+  EFI_STATUS Status;
+
+  UINTN NoHandles, Index;
+  EFI_HANDLE *HandleBuffer;
+  EFI_PXE_BASE_CODE_PROTOCOL *OtherBcInterface2;
+
+  //
+  // Locate the Handle that the BcInterface is bound to
+  //
+  Status =3D gtBS->LocateHandleBuffer(
+      ByProtocol,
+      &gBlackBoxEfiPxeBaseCodeProtocolGuid, +      NULL,
+      &NoHandles,
+      &HandleBuffer);
+  if (EFI_ERROR(Status))
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Status - %r",=
+        __FILE__,
+        (UINTN)__LINE__,
+        Status);
+    return Status;
+  }
+
+  if (NoHandles <=3D 0)
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Device Error"= ,
+        __FILE__,
+        (UINTN)__LINE__);
+    return EFI_DEVICE_ERROR;
+  }
+
+  //
+  // Find the exact handle that BcInterface bound to
+  //
+  for (Index =3D 0; Index < NoHandles; Index++)
+  {
+    Status =3D gtBS->HandleProtocol(
+        HandleBuffer[Index],
+        &gBlackBoxEfiPxeBaseCodePro= tocolGuid,
+        (VOID **) &OtherBcInterface= 2);
+    if (EFI_ERROR(Status))
+    {
+      StandardLib->RecordAssertion(
+          StandardLib,
+          EFI_TEST_ASSERTION_= FAILED,
+          gTestGenericFailure= Guid,
+          L"BS.HandlePro= tocol - HandleProtocol",
+          L"%a:%d:Status= - %r",
+          __FILE__,
+          (UINTN)__LINE__, +          Status);
+
+      gtBS->FreePool(HandleBuffer);
+      return Status;
+    }
+
+    if (OtherBcInterface2 =3D=3D BcInterface2)
+    {
+      break;
+    }
+  }
+
+  //
+  // Locate the Loaded Image DevicePath Protocol bound to PXE_BASE_CO= DE Protocol
+  //
+  if (Index >=3D NoHandles)
+  {
+    //
+    // No Handle Found!!
+    //
+    gtBS->FreePool(HandleBuffer);
+    return EFI_DEVICE_ERROR;
+  }
+
+  Status =3D gtBS->HandleProtocol(
+      HandleBuffer[Index],
+      &gBlackBoxEfiDevicePathProtocolGuid, +      (VOID **) DevicePath);
+
+  gtBS->FreePool(HandleBuffer);
+  return Status;
+}
\ No newline at end of file
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EF= I/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
index e73c7cebcbcf..b1b9005059bb 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestConformance.c
@@ -54,6 +54,8 @@ BBTestStartConformanceTest (
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
 
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -72,6 +74,23 @@ BBTestStartConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStarted.
   // If not, change the state to EfiSimpleNetworkStarted.
@@ -160,7 +179,8 @@ BBTestStopConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -179,6 +199,23 @@ BBTestStopConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -266,7 +303,8 @@ BBTestInitializeConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -285,6 +323,23 @@ BBTestInitializeConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -377,7 +432,8 @@ BBTestResetConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -396,6 +452,23 @@ BBTestResetConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -488,7 +561,8 @@ BBTestShutdownConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -507,6 +581,23 @@ BBTestShutdownConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -594,7 +685,8 @@ BBTestReceiveFilterConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_MAC_ADDRESS        = ;            &n= bsp;  MAC;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -613,6 +705,23 @@ BBTestReceiveFilterConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -840,7 +949,8 @@ BBTestStationAddressConformanceTest (
   EFI_TEST_ASSERTION       &n= bsp;            Asse= rtionType;
   EFI_SIMPLE_NETWORK_PROTOCOL      = ;     *SnpInterface;
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -859,6 +969,23 @@ BBTestStationAddressConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -988,7 +1115,8 @@ BBTestStatisticsConformanceTest (
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
   EFI_NETWORK_STATISTICS      &nbs= p;         StatisticsTable;
   UINTN         &nb= sp;            =            StatisticsSize= ;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -1007,6 +1135,23 @@ BBTestStatisticsConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -1164,7 +1309,8 @@ BBTestMCastIpToMacConformanceTest (
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2;
   EFI_IP_ADDRESS        =             &nb= sp;   IP;
   EFI_MAC_ADDRESS        = ;            &n= bsp;  MAC;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -1183,6 +1329,23 @@ BBTestMCastIpToMacConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -1279,6 +1442,8 @@ BBTestNVDataConformanceTest (
   EFI_SIMPLE_NETWORK_STATE      &n= bsp;       State1, State2, State3;
   VOID         &nbs= p;            &= nbsp;           *Buffer;<= br>    UINT32         &n= bsp;            = ;          CheckPoint1State; +  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -1297,6 +1462,23 @@ BBTestNVDataConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the network interface support NvData if not r= eturn
   //
@@ -1526,7 +1708,8 @@ BBTestGetStatusConformanceTest (
   VOID         &nbs= p;            &= nbsp;           *TxBuf;    UINT32         &n= bsp;            = ;          InterruptStatus;    //UINT32         =             &nb= sp;          *pInterruptStatus= ;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -1545,6 +1728,23 @@ BBTestGetStatusConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -1717,7 +1917,8 @@ BBTestTransmitConformanceTest (
   EFI_MAC_ADDRESS        = ;            &n= bsp;  SrcAddr;
   EFI_MAC_ADDRESS        = ;            &n= bsp;  DestAddr;
   UINT16         &n= bsp;            = ;          Protocol;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -1736,6 +1937,23 @@ BBTestTransmitConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
@@ -1993,7 +2211,8 @@ BBTestReceiveConformanceTest (
   EFI_MAC_ADDRESS        = ;            &n= bsp;  SrcAddr;
   EFI_MAC_ADDRESS        = ;            &n= bsp;  DestAddr;
   UINT16         &n= bsp;            = ;          Protocol;
-
+  EFI_DEVICE_PATH_PROTOCOL       &= nbsp;     *DevicePath;
+  CHAR16          &= nbsp;           &nbs= p;        *DevicePathStr;
   //
   // Get the Standard Library Interface
   //
@@ -2012,6 +2231,23 @@ BBTestReceiveConformanceTest (
   //
   SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterfac= e;
 
+  Status=3DLocateDevicePathFromSnpInterface(SnpInterface,&DeviceP= ath,StandardLib);
+  if (Status =3D=3D EFI_SUCCESS) {
+    DevicePathStr =3D NULL;
+    DevicePathStr =3D SctDevicePathToStr (DevicePath);
+    if (DevicePathStr !=3D NULL) {
+      StandardLib->RecordMessage (
+            &n= bsp;        StandardLib,
+            &n= bsp;        EFI_VERBOSE_LEVEL_DEFAULT, +            &n= bsp;        L"Device Path: %s\r\n&q= uot;,
+            &n= bsp;        DevicePathStr
+            &n= bsp;        );
+      Status =3D gtBS->FreePool (DevicePathStr= );
+      if (EFI_ERROR(Status))
+        return Status;
+      DevicePathStr=3DNULL;
+    }
+  }
   //
   // Check whether the state of network interface is EfiSimpleNe= tworkStopped.
   // If not, change the state to EfiSimpleNetworkStopped.
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Black= BoxTest/SimpleNetworkBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Proto= col/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestMain.c
index 918fac7dbd7f..21d20b82b025 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest= /SimpleNetworkBBTestMain.c
@@ -336,3 +336,99 @@ BBTestSimpleNetworkUnload (
            );
 }
 
+
+EFI_STATUS LocateDevicePathFromSnpInterface(IN EFI_SIMPLE_NETWORK_PROTOCOL= *SnpInterface2, IN EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_STANDARD_= TEST_LIBRARY_PROTOCOL *StandardLib)
+{
+  EFI_STATUS Status;
+
+  UINTN NoHandles, Index;
+  EFI_HANDLE *HandleBuffer;
+  EFI_SIMPLE_NETWORK_PROTOCOL *OtherSnpInterface2;
+
+  //
+  // Locate the Handle that the SnpInterface is bound to
+  //
+  Status =3D gtBS->LocateHandleBuffer(
+      ByProtocol,
+      &gBlackBoxEfiSimpleNetworkProtocolGuid,=
+      NULL,
+      &NoHandles,
+      &HandleBuffer);
+  if (EFI_ERROR(Status))
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Status - %r",=
+        __FILE__,
+        (UINTN)__LINE__,
+        Status);
+    return Status;
+  }
+
+  if (NoHandles <=3D 0)
+  {
+    StandardLib->RecordAssertion(
+        StandardLib,
+        EFI_TEST_ASSERTION_FAILED,
+        gTestGenericFailureGuid,
+        L"BS.LocateHandle - Locate= Handle",
+        L"%a:%d:Device Error"= ,
+        __FILE__,
+        (UINTN)__LINE__);
+    return EFI_DEVICE_ERROR;
+  }
+
+  //
+  // Find the exact handle that SnpInterface bound to
+  //
+  for (Index =3D 0; Index < NoHandles; Index++)
+  {
+    Status =3D gtBS->HandleProtocol(
+        HandleBuffer[Index],
+        &gBlackBoxEfiSimpleNetworkP= rotocolGuid,
+        (VOID **) &OtherSnpInterfac= e2);
+    if (EFI_ERROR(Status))
+    {
+      StandardLib->RecordAssertion(
+          StandardLib,
+          EFI_TEST_ASSERTION_= FAILED,
+          gTestGenericFailure= Guid,
+          L"BS.HandlePro= tocol - HandleProtocol",
+          L"%a:%d:Status= - %r",
+          __FILE__,
+          (UINTN)__LINE__, +          Status);
+
+      gtBS->FreePool(HandleBuffer);
+      return Status;
+    }
+
+    if (OtherSnpInterface2 =3D=3D SnpInterface2)
+    {
+      break;
+    }
+  }
+
+  //
+  // Locate the Loaded DevicePath Protocol bound to SIMPLE_NETWORK Pr= otocol
+  //
+  if (Index >=3D NoHandles)
+  {
+    //
+    // No Handle Found!!
+    //
+    gtBS->FreePool(HandleBuffer);
+    return EFI_DEVICE_ERROR;
+  }
+
+  Status =3D gtBS->HandleProtocol(
+      HandleBuffer[Index],
+      &gBlackBoxEfiDevicePathProtocolGuid, +      (VOID **) DevicePath);
+
+  gtBS->FreePool(HandleBuffer);
+  return Status;
+}
\ No newline at end of file
--
2.34.1

=AE=8B=A9=B2*
=8Ay,b=8B=ABy=C7=A2=BD=E6=A5=96g=AC=B1=A8=B2=C7=A7=B6=DA-=86+ =AE=8B= =A9V'=B0=FD=A9=97#=A7=96)=DE=D7_x=DF=B8m=B6=9B?=FD=E7d=DA
=E8=BA=9B"=A3=F8?u=EB=DE=97=F9=9E=B2=C6 {=FDu=F7=FB2=EB^N&#= 24;=ACN=8Abrm=A6=CF=FF=82=BA.=A6=C8=A8=FEk=D7N=B8=EF]=BA=E3=FE}= =F3=3D=ECj=E8=BA=93=B0=EA=DDz=F7=A5=FA=8C'z=B7=93h+=A2=EA= l=8A=85'=B2=E6=ECr=B8=9Bzm=A6=CF=FFy=D96=82=BA.=A6=C8=A8=FE=DDz= =F7=A5=FE=E9=EC=B9=B4=AE=9E|=96jx=AEg(
IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#119487) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_AM0PR08MB44831A4DEC9D384FA71C0579EFF92AM0PR08MB4483eurp_--