[edk2-platforms][PATCH V1 11/27] UserAuthFeaturePkg: Use MinPlatformPkg build include files
Isaac Oram
Use the MinPlatformPkg common core build files to build libraries
needed by this feature. Cc: Dandan Bi <dandan.bi@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf | 6 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 80 ++------------------ Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc | 18 +++++ 3 files changed, 27 insertions(+), 77 deletions(-) diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf index c534bebcc0..030dcbe763 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf @@ -7,6 +7,6 @@ # ## - INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf - INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf - INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf +INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf +INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf +INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc index 7eeaf441c1..2f39a5580c 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc @@ -18,12 +18,12 @@ # ################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif ################################################################################ # @@ -34,47 +34,9 @@ !include MdePkg/MdeLibs.dsc.inc [LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf - - ##################################### - # User Authentication Feature Package - ##################################### PlatformPasswordLib|UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf UserPasswordLib|UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.common.DXE_SMM_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - ################################################################################################### # # Components Section - list of the modules and components that will be processed by compilation @@ -93,21 +55,6 @@ # generated for it, but the binary will not be put into any firmware volume. # ################################################################################################### -# -# Feature PEI Components -# - -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.IA32] - ##################################### - # User Authentication Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. # # Feature DXE Components @@ -128,18 +75,3 @@ UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc index 74eb9213ce..10360c5737 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 09/27] SmbiosFeaturePkg: Use MinPlatformPkg build include files
Isaac Oram
Use the MinPlatformPkg common core build files to build libraries
needed by this feature. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 52 -------------------- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc | 18 +++++++ 3 files changed, 19 insertions(+), 53 deletions(-) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf index c3a3e81503..d46bacfbd2 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf @@ -7,4 +7,4 @@ # ## - INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf +INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc index 094dd957b8..7a165f39d7 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc @@ -33,28 +33,6 @@ !include MdePkg/MdeLibs.dsc.inc -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - ################################################################################ # # Component section - list of all components that need built for this feature. @@ -69,21 +47,6 @@ # generated for it, but the binary will not be put into any firmware volume. # ################################################################################ -# -# Feature PEI Components -# - -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.IA32] - ##################################### - # SMBIOS Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. # # Feature DXE Components @@ -101,18 +64,3 @@ # Add components here that should be included in the package build. SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc index 31141c0725..e72b341154 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 10/27] UserAuthFeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Liming Gao <gaoliming@...> Cc: Dandan Bi <dandan.bi@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf | 6 +++--- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 12 ++++++------ Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf index f0b33aa44c..c534bebcc0 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf @@ -7,6 +7,6 @@ # ## - INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf - INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf - INF UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf + INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf + INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf + INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc index d4f7a5ed23..7eeaf441c1 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc @@ -58,8 +58,8 @@ ##################################### # User Authentication Feature Package ##################################### - PlatformPasswordLib|UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf - UserPasswordLib|UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf + PlatformPasswordLib|UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf + UserPasswordLib|UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf [LibraryClasses.common.DXE_DRIVER] ####################################### @@ -122,12 +122,12 @@ # Add library instances here that are not included in package components and should be tested # in the package build. - UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf + UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf # Add components here that should be included in the package build. - UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf - UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf - UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf + UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf + UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf + UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf ################################################################################################### # diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf index 00be14df8a..278fe026a6 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [Pcd] gUserAuthFeaturePkgTokenSpaceGuid.PcdPasswordCleared ## CONSUMES diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf index 99d84ae637..a3124aa443 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf index 9ab7d83319..8f6a693d76 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf @@ -20,7 +20,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf index 2c6c3661fb..c47e20f052 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf @@ -26,7 +26,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [LibraryClasses] BaseLib diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf index 58066b588c..bee46a1af2 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf @@ -28,7 +28,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [LibraryClasses] BaseLib diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf index 891e2b981d..b53f70f0e3 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf @@ -27,7 +27,7 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec CryptoPkg/CryptoPkg.dec - UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf index 3ed23bd937..c3a3e81503 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf @@ -7,4 +7,4 @@ # ## - INF SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf + INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc index 31d44b68b3..094dd957b8 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc @@ -100,7 +100,7 @@ # in the package build. # Add components here that should be included in the package build. - SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf + SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf ################################################################################################### # diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf index bd8736b621..8e530c4945 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf @@ -33,7 +33,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec [LibraryClasses] BaseLib diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec index 6170f37969..db3cdbb0d0 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec @@ -38,7 +38,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVersion|0x2 @@ -71,7 +71,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Manufacturer|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.ProductName|0x2 @@ -87,7 +87,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } # @@ -111,7 +111,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Manufacturer|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Type|MiscChassisTypeRackMountChassis @@ -131,7 +131,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation.BootStatus|BootInformationStatusNoError -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files
Isaac Oram
Use the MinPlatformPkg common core build files to build libraries
needed by this feature. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 72 ++------------------ Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 18 +++++ 3 files changed, 26 insertions(+), 66 deletions(-) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf index 34caf3dacc..fdd16a4e03 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf @@ -7,4 +7,4 @@ # ## - INF S3FeaturePkg/S3Pei/S3Pei.inf +INF S3FeaturePkg/S3Pei/S3Pei.inf diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc index f94bd2b431..cc34e78507 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc @@ -18,12 +18,12 @@ # ################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif ################################################################################ # @@ -31,34 +31,7 @@ # ################################################################################ -!include MdePkg/MdeLibs.dsc.inc - -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - -[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf - - ####################################### - # Silicon Initialization Package - ####################################### +[LibraryClasses.common.PEIM] SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf ################################################################################ @@ -92,34 +65,3 @@ # Add components here that should be included in the package build. S3FeaturePkg/S3Pei/S3Pei.inf - -# -# Feature DXE Components -# - -# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.X64] - ##################################### - # S3 Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc index 28ee49d429..e16a1f8d00 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 06/27] S3FeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf index 3cd5cd9628..34caf3dacc 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf @@ -7,4 +7,4 @@ # ## - INF PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf + INF S3FeaturePkg/S3Pei/S3Pei.inf diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc index 312870981e..f94bd2b431 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc @@ -91,7 +91,7 @@ # in the package build. # Add components here that should be included in the package build. - PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf + S3FeaturePkg/S3Pei/S3Pei.inf # # Feature DXE Components diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf index 46fbb62a46..e485eac952 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf @@ -23,7 +23,7 @@ [Packages] MdePkg/MdePkg.dec IntelSiliconPkg/IntelSiliconPkg.dec - PowerManagement/S3FeaturePkg/S3FeaturePkg.dec + S3FeaturePkg/S3FeaturePkg.dec [Sources] S3Pei.c -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 05/27] IpmiFeaturePkg: Fix build errors
Isaac Oram
Fix build issues with standalone build.
Switch to using MinPlatformPkg common core include for common modules. Cc: Nate DeSimone <nathaniel.l.desimone@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 54 -------------------- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 16 +++--- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 18 +++++++ 3 files changed, 26 insertions(+), 62 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc index c1ce340da2..237a4fc006 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -34,54 +34,15 @@ !include MdePkg/MdeLibs.dsc.inc [LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - ##################################### - # IPMI Feature Package - ##################################### IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf - - ##################################### - # IPMI Feature Package - ##################################### IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf [LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - - ##################################### - # IPMI Feature Package - ##################################### IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf ################################################################################ @@ -149,18 +110,3 @@ IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf IpmiFeaturePkg/OsWdt/OsWdt.inf IpmiFeaturePkg/SolStatus/SolStatus.inf - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf index 158b5455d8..e0f3bbe158 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf @@ -7,11 +7,11 @@ # ## - INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf - INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf - INF RuleOverride = DRIVER_ACPITABLE IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf - INF IpmiFeaturePkg/BmcElog/BmcElog.inf - INF IpmiFeaturePkg/Frb/FrbDxe.inf - INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf - INF IpmiFeaturePkg/OsWdt/OsWdt.inf - INF IpmiFeaturePkg/SolStatus/SolStatus.inf +INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf +INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf +INF RuleOverride = DRIVER_ACPITABLE IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf +INF IpmiFeaturePkg/BmcElog/BmcElog.inf +INF IpmiFeaturePkg/Frb/FrbDxe.inf +INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf +INF IpmiFeaturePkg/OsWdt/OsWdt.inf +INF IpmiFeaturePkg/SolStatus/SolStatus.inf diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 6a3eed0882..c35e1e174e 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -25,6 +25,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 04/27] IpmiFeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Liming Gao <gaoliming@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 36 ++++++++++---------- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 16 ++++----- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 6 ++-- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf | 2 +- 21 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf index a84813f55c..7cd60e417b 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf @@ -22,7 +22,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf index 665b3d9bda..388dd2740c 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf index 85836cd8ee..61222e0c00 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf index 7ad00ae574..797dbe6a07 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf @@ -20,7 +20,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] PeimEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf index 9881f9e3d0..8d80aeb6b5 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf @@ -36,7 +36,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] MemoryAllocationLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf index 883a9168e5..a646161ce1 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf @@ -33,7 +33,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] PeimEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf index a534f7dac8..f430195d1e 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf @@ -27,7 +27,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] MemoryAllocationLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc index a6eccb428b..c1ce340da2 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -47,8 +47,8 @@ ##################################### # IPMI Feature Package ##################################### - IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf - IpmiPlatformHookLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf + IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf + IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] ####################################### @@ -65,7 +65,7 @@ ##################################### # IPMI Feature Package ##################################### - IpmiBaseLib|OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf + IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf [LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER] ####################################### @@ -82,7 +82,7 @@ ##################################### # IPMI Feature Package ##################################### - IpmiBaseLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf + IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf ################################################################################ # @@ -112,14 +112,14 @@ # Add library instances here that are not included in package components and should be tested # in the package build. - OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf + IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf # # Add components here that should be included in the package build. # - OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf - OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf - OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf + IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf + IpmiFeaturePkg/Frb/FrbPei.inf + IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf # # Feature DXE Components @@ -135,20 +135,20 @@ # Add library instances here that are not included in package components and should be tested # in the package build. - OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf + IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf # # Add components here that should be included in the package build. # - OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf - OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf - OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf - OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf - OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf - OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf - OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf - OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf - OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf + IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf + IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf + IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + IpmiFeaturePkg/BmcElog/BmcElog.inf + IpmiFeaturePkg/Frb/FrbDxe.inf + IpmiFeaturePkg/IpmiFru/IpmiFru.inf + IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf + IpmiFeaturePkg/OsWdt/OsWdt.inf + IpmiFeaturePkg/SolStatus/SolStatus.inf ################################################################################################### # diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf index cbd9453cf0..158b5455d8 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf @@ -7,11 +7,11 @@ # ## - INF OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf - INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf - INF RuleOverride = DRIVER_ACPITABLE OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf - INF OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf - INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf - INF OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf - INF OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf - INF OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf + INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf + INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf + INF RuleOverride = DRIVER_ACPITABLE IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + INF IpmiFeaturePkg/BmcElog/BmcElog.inf + INF IpmiFeaturePkg/Frb/FrbDxe.inf + INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf + INF IpmiFeaturePkg/OsWdt/OsWdt.inf + INF IpmiFeaturePkg/SolStatus/SolStatus.inf diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf index 826490952b..d214988bd1 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf @@ -7,6 +7,6 @@ # ## -INF OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf -INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf -INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf +INF IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf +INF IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf +INF IpmiFeaturePkg/Frb/FrbPei.inf diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf index 0778b221c1..322f061a0f 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf index 831bfb0b5e..8236fe4842 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf index 607a185eb6..3fb31c729a 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] PeimEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf index 86df943560..72ca3495fb 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf @@ -18,7 +18,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf index 5478f9842b..52f8863032 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf @@ -24,7 +24,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] BaseLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf index f8e7ba5a8f..d5c14ff2a4 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf @@ -24,7 +24,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] BaseMemoryLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf index ab270079aa..8e472ebdad 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf @@ -20,7 +20,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] DebugLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf index 9a2c87873f..234492db65 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf @@ -18,7 +18,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] DebugLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf index bb1ccf1ca2..7ea688fc16 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf @@ -18,7 +18,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf index 7e7d2826cb..3fd1078271 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf @@ -20,7 +20,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf index 826144e537..9019b849ac 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec - OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec [Pcd] gIpmiFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: Use MinPlatform build include files
Isaac Oram
Extend the template to leverage common library build files.
Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc | 2 +- Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc index 6742eddcf9..dd6d033aca 100644 --- a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc +++ b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc @@ -73,7 +73,7 @@ # is completed. [Components.IA32] ##################################### - # <TEMPALTE> Feature Package + # <TEMPLATE> Feature Package ##################################### # Add library instances here that are not included in package components and should be tested diff --git a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc index 0ce8debee0..03657047dc 100644 --- a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc +++ b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 03/27] AcpiDebugFeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Cc: Eric Dong <eric.dong@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 4 ++-- Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf index b293d83cd9..04b5953bf6 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec + AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec [Pcd] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureActive ## CONSUMES diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf index dbb33e4ae2..a0058b51ab 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf @@ -33,7 +33,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec + AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec [Pcd] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureActive ## CONSUMES diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec index c3bd89fe2b..9159231007 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec @@ -29,7 +29,7 @@ [PcdsFeatureFlag] gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA0000001 -[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx] +[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## This PCD specifies the ACPI debug message buffer size. gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize|0x10000|UINT32|0xF0000001 diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc index 856222a53d..b142978be1 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc @@ -109,8 +109,8 @@ # in the package build. # Add components here that should be included in the package build. - Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf - Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf + AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf + AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf ################################################################################################### # diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf index bbd6eca87b..84560dae50 100644 --- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf @@ -7,5 +7,5 @@ # ## - INF RuleOverride = DRIVER_ACPITABLE Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf - INF RuleOverride = DRIVER_ACPITABLE Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf + INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf + INF RuleOverride = DRIVER_ACPITABLE AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 02/27] BeepDebugFeaturePkg: Fix all relative package paths
Isaac Oram
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Cc: Eric Dong <eric.dong@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc index 251de6932b..00ef022657 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc @@ -54,17 +54,17 @@ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep [LibraryClasses.Common] - BeepLib|Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf - BeepMapLib|Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf + BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf + BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf [LibraryClasses.PEIM, LibraryClasses.PEI_CORE] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf [LibraryClasses.DXE_RUNTIME_DRIVER] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf [LibraryClasses.DXE_SMM_DRIVER] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf [Components.IA32] @@ -77,7 +77,7 @@ # FILE_GUID = $(BEEP_PEIM_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf } [Components.X64] @@ -90,7 +90,7 @@ # FILE_GUID = $(BEEP_DXE_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf } MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { @@ -102,5 +102,5 @@ # FILE_GUID = $(BEEP_SMM_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf } -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 01/27] BeepDebugFeaturePkg: Use MinPlatformPkg build include files
Isaac Oram
The BeepDebugFeaturePkg was malformed and did not build anything
and thus wasn't testable in standalone build. Added gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable to properly control the advanced feature inclusion. Use the standard MinPlatform includes for core libraries. This increases the build time, but reduces complexity when integrating into a board build. Board build optimization is more valuable than standalone build optimization. Enable standalone build to test the library build and the component builds using edk2 StatusCodeHandler drivers. Add unique file names for the StatusCodeHandler components to avoid collisions with any existing board handlers when incorporated in board DSC and FDF files. Add PreMemory.fdf and PostMemory.fdf content for including in board FDF or AdvancedFeaturePkg in the future. Removed unused sections in DSC and FDF to reduce file clutter. Removed stale file header content from prior proprietary licensing. Moved feature customization and common include into the package DSC file to reduce board complexity when BeepDebugFeature.dsc is included. Removed the FixedAtBuild build control for beep feature as it would be redundant with the FeatureFlag control of the whole feature. Build control is via PcdBeepDebugFeatureEnable and dynamic control is via PcdStatusCodeUseBeep. Improved Readme content, format, and coding style use. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Cc: Eric Dong <eric.dong@...> Cc: Ming Tan <ming.tan@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> --- Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec | 7 +- Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc | 28 +++ Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc | 222 ++++++-------------- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h | 6 +- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf | 14 ++ Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf | 13 ++ Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf | 5 +- Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf | 3 - Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf | 3 - Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md | 91 +++++--- 10 files changed, 186 insertions(+), 206 deletions(-) diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec index 4f4b36b091..d90611da51 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec @@ -31,6 +31,9 @@ [Guids] gBeepDebugFeaturePkgTokenSpaceGuid = {0x54f56fb5, 0xea0e, 0x4518, {0xa0, 0x3e, 0x1b, 0xeb, 0x56, 0x94, 0xd2, 0x16}} -[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] +[PcdsFeatureFlag] + gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable|FALSE|BOOLEAN|0x00000000 + +[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] # Beep is a legacy feature, disabled it by default - gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|FALSE|BOOLEAN|0x00000001 + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE|BOOLEAN|0x00000001 diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc index 47254f9974..56cad020bf 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc @@ -24,6 +24,34 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +[PcdsDynamicExDefault] + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + +[LibraryClasses.Common] + # + # Required by common status code handler infrastructure + # + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf + # # This package always builds the feature. # diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc index b24b3e458f..251de6932b 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc @@ -18,97 +18,16 @@ # ################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif - -################################################################################ -# -# PCD Section - list of PCD Entries modified by the feature. -# -################################################################################ - -# Unmark the following and StatusCodeHandler.efi to build the .dsc file directly -#[PcdsDynamicDefault] -# gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE - -################################################################################ -# -# Library Class section - list of all Library Classes needed by this feature. -# -################################################################################ - -!include MdePkg/MdeLibs.dsc.inc - -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - -[LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf - -[LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA32.SEC] - ####################################### - # Edk2 Packages - ####################################### - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf - -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf - -[LibraryClasses.common.UEFI_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.X64.DXE_SMM_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf - SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf - SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif + + DEFINE BEEP_PEIM_FILENAME = b2356504-8ea3-42bd-912a-4b331990644a + DEFINE BEEP_DXE_FILENAME = f1211fa9-d83d-4c79-8726-3afaebba1070 + DEFINE BEEP_SMM_FILENAME = a82cd452-0f17-4417-b8be-bb8cfdf9fa26 ################################################################################ # @@ -128,77 +47,60 @@ # Feature PEI Components # -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. +# +# By default, make the functional control a patcheable in module PCD +# +[PcdsPatchableInModule] + gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep + +[LibraryClasses.Common] + BeepLib|Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf + BeepMapLib|Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf + +[LibraryClasses.PEIM, LibraryClasses.PEI_CORE] + StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + +[LibraryClasses.DXE_RUNTIME_DRIVER] + StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + +[LibraryClasses.DXE_SMM_DRIVER] + StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + [Components.IA32] - ##################################### - # Beep Debug Feature Package - ##################################### - # Add library instances here that are not included in package components and should be tested - # in the package build. - BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + <Defines> + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(BEEP_PEIM_FILENAME) + <LibraryClasses> + NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + } - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { -# <LibraryClasses> -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf -# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf -# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf -# } - - # Add components here that should be included in the package build. - -# -# Feature DXE Components -# - -# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. [Components.X64] - ##################################### - # Beep Debug Feature Package - ##################################### + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { + <Defines> + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(BEEP_DXE_FILENAME) + <LibraryClasses> + NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + } - # Add library instances here that are not included in package components and should be tested - # in the package build. - BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf - BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf - - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { -# <LibraryClasses> -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf -# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf -# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf -# } - -# MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { -# <LibraryClasses> -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf -# BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf -# NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf -# } - - # Add components here that should be included in the package build. - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] + MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { + <Defines> + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(BEEP_SMM_FILENAME) + <LibraryClasses> + NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + } diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h index f768acc557..0b8f71b097 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h @@ -15,12 +15,12 @@ Sends the 32-bit value specified by Value to Beep device, and returns Value. Some implementations of this library function may perform I/O operations directly to Beep device. Other implementations may send Value to - ReportStatusCode(), and the status code reporting mechanism will eventually + ReportStatusCode (), and the status code reporting mechanism will eventually display the 32-bit value on the status reporting device. - Beep() must actively prevent recursion. If Beep() is called while + Beep () must actively prevent recursion. If Beep () is called while processing another Post Code Library function, then - Beep() must return Value immediately. + Beep () must return Value immediately. @param Value Beep count. **/ diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 0000000000..447fb88235 --- /dev/null +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,14 @@ +## @file +# FDF file for post-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced features +# can be conditionally included in the flash image by enabling the respective +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID = $(BEEP_DXE_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf +INF FILE_GUID = $(BEEP_SMM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 0000000000..160f5e3ffd --- /dev/null +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,13 @@ +## @file +# FDF file for pre-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced features +# can be conditionally included in the flash image by enabling the respective +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID = $(BEEP_PEIM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf index 421b246663..5be78a72e8 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf @@ -4,9 +4,6 @@ # Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # -# vendor. This file may not be modified, except as allowed by -# additional terms of your license agreement. -# ## [Defines] @@ -15,7 +12,7 @@ FILE_GUID = C4210E71-0A38-4728-8D25-4876348AA380 MODULE_TYPE = PEIM CONSTRUCTOR = PeiBeepStatusCodeHandlerLibConstructor - LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_COR + LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_CORE # # The following information is for reference only and not required by the build tools. diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf index b9aae39128..2343e35a78 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf @@ -4,9 +4,6 @@ # Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # -# vendor. This file may not be modified, except as allowed by -# additional terms of your license agreement. -# ## [Defines] diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf index caa82264ae..4db1748fe3 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf @@ -4,9 +4,6 @@ # Copyright (c) 2010 - 2020, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # -# vendor. This file may not be modified, except as allowed by -# additional terms of your license agreement. -# ## [Defines] diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md index ee254d0f99..6626c9b764 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md @@ -6,25 +6,29 @@ More Information: ## Purpose -The BeepDebugFeaturePkg include some useful beep debug libraries, such as get beep value from status code and beep. -This is an important capability in firmware development to get and analyze the early error when there is not serial port. +Very often it is necessary to debug very close to the reset vector or in production systems that lack serial ports, seven segment displays, or useful LED that are typically used to output useful debug messages. +The BeepDebugFeaturePkg includes some useful beep focused debug libraries. + +This isn't intended for production use. + +There is not currently seamless integration into the SecCore component that handles the reset vector. In order to debug that early, it will be necessary to use the BeepLib directly in SEC code. # High-Level Theory of Operation -It provide a library BeepStatusCodeHandlerLib used by edk2 StatusCodeHandler.efi, used to do beep if needed. -It also provide a library of BeepMap lib, it map the status code to beep value. +It provides a library, BeepStatusCodeHandlerLib, used by edk2 StatusCodeHandler.efi, used to do beep if needed. +It also provide a library of BeepMap lib which maps the status code to a beep value. A library of Beep lib is needed by platform, and this pkg has a Null implementation. -In the library contstructor function, BeepStatusCodeHandlerLib register the call back function for ReportStatusCode. -When called, it call GetBeepFromStatusCode() in BeepMapLib to get beep value from status code, and call Beep() in BeepLib to beep. +In the library contstructor function, BeepStatusCodeHandlerLib registers the call back function for ReportStatusCode. When called, it calls GetBeepFromStatusCode (); in BeepMapLib to get beep value from status code, and calls Beep () in BeepLib to beep a speaker. -BeepStatusCodeHandlerLib include 3 libraries for PEI, RuntimeDxe, SMM: +BeepStatusCodeHandlerLib includes three libraries for PEI, RuntimeDxe, and SMM: * PeiBeepStatusCodeHandlerLib * RuntimeDxeBeepStatusCodeHandlerLib * SmmBeepStatusCodeHandlerLib ## Firmware Volumes -Linked with StatusCodeHandler.efi, and make sure put the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi. +These libraries need to be linked into StatusCodeHandler components. +Make sure one puts the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi. ## Modules * BeepStatusCodeHandlerLib @@ -32,13 +36,17 @@ Linked with StatusCodeHandler.efi, and make sure put the StatusCodeHandler.efi a * BeepLibNull ## BeepStatusCodeHandlerLib -This library register the call back function for ReportStatusCode, and get beep valude from status code, and do beep. +This library registers the callback function for ReportStatusCode, gets beep value from status code, and does the beep. ## BeepMapLib -This library provide a function to get beep value from status code. +This library provides a function to get a beep value for a status code. + +## BeepLibNull +This library provide a function to perform the beep. ## Key Functions * In PeiBeepStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI BeepStatusCodeReportWorker ( @@ -49,8 +57,10 @@ This library provide a function to get beep value from status code. IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In RuntimeDxeBeepStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI BeepStatusCodeReportWorker ( @@ -60,8 +70,10 @@ This library provide a function to get beep value from status code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In SmmBeepStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI BeepStatusCodeReportWorker ( @@ -71,55 +83,72 @@ This library provide a function to get beep value from status code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In BeepMapLib: +``` UINT32 EFIAPI GetBeepValueFromStatusCode ( IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value - ) + ) +``` * In BeepLib: +``` VOID EFIAPI Beep ( IN UINT32 Value - ) + ) +``` ## Configuration -* Link the library to StatusCodeHandler.efi. - Example: - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { - <LibraryClasses> - NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf - } - Refer to BeepDebugFeature.dsc for other example. -* Config PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep. - In platform .dsc file, need to config the type of gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep. - Use PcdsFixedAtBuild to save binary size, and use PcdsDynamic if want to enable/disable in runtime. -* Implemented platform's special BeepMapLib if needed. -* Provide the platform's special BeepLib. -* Make sure put the StatusCodeHandler.efi after the ReportStatusCodeRouter.efi. +* Configure PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep. + In board DSC file, the board developer needs to configure the type of gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep control desired. + [PcdsFixedAtBuild] is the feature default value as this has lowest size. + [PcdsDynamicExDefault] is the most common configuration as it provides dynamic control during debugging. +* Implemented board specific BeepMapLib if custom status code to beep code mapping as needed. +* Provide the board specific BeepLib to perform beeps on the board specific hardware. +```The default library does not cause any hardware to beep``` ## Data Flows Status Code (ReportStatusCode) -> Beep Value (GetBeepValueFromStatusCode). ## Control Flows -ReportStatusCode() -> BeepStatusCodeReportWorker() -> GetBeepValueFromStatusCode() -> Beep() +ReportStatusCode () -> BeepStatusCodeReportWorker () -> GetBeepValueFromStatusCode () -> Beep () ## Build Flows -There is not special build flows. +Standalone build +* build -a IA32 -a X64 -p Debugging\BeepDebugFeaturePkg\BeepDebugFeaturePkg.dsc +AdvanceFeaturePkg build +* build -a IA32 -a X64 -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc ## Test Point Results -Verify the post code shown is correct. +None ## Functional Exit Criteria N/A ## Feature Enabling Checklist -* Set the PCD gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep to TRUE. -* Plug out all the memory, check can here the beep. +* Verify in board DSC file that gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable set to TRUE +* Verify board specific BeepLib implemented and included in board DSC file. +* Verify that the board has a PlatformHookLib instance. There is a null library implementation if needed +``` + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf +``` +* Verify that your board has the StatusCodeHandler components (PEIM or driver) desired. +``` + Example: + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { + <LibraryClasses> + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + } + There are default StatusCodeHandlers for PEI, RT, and SMM in BeepDebugFeaturePkg/Include in PreMemory.fdf and PostMemory.fdf for use. But most boards will already have these components and you will just want to add the appropriate *StatusCodeHandlerLib.inf to each component. +``` +* Build +* Remove all the memory from the system and verify audible beep is heard when attempting to boot. ## Common Optimizations -* Implemented platform's special BeepMapLib if needed. +N/A -- 2.27.0.windows.1
|
|
[edk2-platforms][PATCH V1 00/27] Improve feature build consistency
Isaac Oram
This series addresses inconsistencies in feature implementation and use. Some inconsistencies are just
conventions of the feature design/template/convention. Some are inconsistency with feature design intent that negatively affect the usability of the features and the amount of work required from board porting engineers. Some features were missing feature enable flags. Some features had non-functional standalone builds. Many features were implemented to include common core build content in their feature include files. Updated some of the Readme content. Added AdvancedFeaturePkg.fdf to build all feature content to support verifying no build time issues between features. Removed duplicate and unused content from build files. Modified the TemplateFeaturePkg to use the common MinPlatform include content. Removed all instances where features were relative to Features/Intel and made them relative to the package roots. This does mean PACKAGES_PATH may need to be extended for all the feature domains. Debugging, PowerManagement, etc. However, it should enable packaging tools to function properly as the relative paths violate spec. Use of the common MinPlatformPkg build includes does increase the build time for each individual feature in standalone build modes. It does not negatively impact board or AdvancedFeaturePkg builds as the common content is only built once. Part of MinPlatform arch intent is to reduce cognitive complexity, so the simpler build is more valuable than fast build time. Cc: Sai Chaganty <rangasai.v.chaganty@...> Cc: Liming Gao <gaoliming@...> Cc: Eric Dong <eric.dong@...> Cc: Ming Tan <ming.tan@...> Cc: Nate DeSimone <nathaniel.l.desimone@...> Cc: Chasel Chiu <chasel.chiu@...> Cc: Dandan Bi <dandan.bi@...> Cc: Miki Shindo <miki.shindo@...> Cc: Mohamed Abbas <mohamed.abbas@...> Cc: Manickavasakam Karpagavinayagam <manickavasakamk@...> Signed-off-by: Isaac Oram <isaac.w.oram@...> Isaac Oram (27): BeepDebugFeaturePkg: Use MinPlatformPkg build include files BeepDebugFeaturePkg: Fix all relative package paths AcpiDebugFeaturePkg: Fix all relative package paths IpmiFeaturePkg: Fix all relative package paths IpmiFeaturePkg: Fix build errors S3FeaturePkg: Fix all relative package paths S3FeaturePkg: Use MinPlatformPkg build include files SmbiosFeaturePkg: Fix all relative package paths SmbiosFeaturePkg: Use MinPlatformPkg build include files UserAuthFeaturePkg: Fix all relative package paths UserAuthFeaturePkg: Use MinPlatformPkg build include files VirtualKeyboardFeaturePkg: Fix all relative package paths VirtualKeyboardFeaturePkg: Use MinPlatformPkg build include files VirtualKeyboardFeaturePkg: Add feature enable PCD NetworkFeaturePkg: Use MinPlatformPkg build include files LogoFeaturePkg: Use MinPlatformPkg build include files PostCodeDebugFeaturePkg: Complete as an advanced feature AcpiDebugFeaturePkg: Use MinPlatformPkg build include files Usb3DebugFeaturePkg: Align with feature design guidelines SpcrFeaturePkg: Use MinPlatform build include files TemplateFeaturePkg: Use MinPlatform build include files AdvancedFeaturePkg: Fix all relative package paths AdvancedFeaturePkg: Add missing features MinPlatformPkg/Build: Add an include file for the common SPI FV info WhitleyOpenBoardPkg/Build: Use common SPI FV Header include AdvancedFeaturePkg/Build: Add FDF to create FV for all features WhitleyOpenBoardPkg/Build: Enable Features/Intel features Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 67 +++++- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf | 49 +++++ Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc | 49 +++-- Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 64 +++++- Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf | 49 +++-- Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf | 49 +++-- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 2 +- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc | 21 ++ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 74 +------ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 4 +- Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec | 7 +- Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc | 28 +++ Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc | 222 ++++++------------- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h | 6 +- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf | 14 ++ Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf | 13 ++ Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf | 5 +- Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf | 3 - Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf | 3 - Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md | 91 +++++--- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc | 231 +++++--------------- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf | 14 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf | 13 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf | 2 +- Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec | 11 + Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc | 30 +++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md | 31 ++- Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc | 131 ++--------- Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md | 50 +++-- Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec | 14 +- Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc | 18 ++ Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc | 89 +------- Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc | 18 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 90 ++------ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 16 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 6 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 18 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf | 2 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf | 2 +- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h | 2 +- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf | 13 ++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf | 11 + Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc | 62 ------ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md | 12 +- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec | 6 + Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc | 18 ++ Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 74 +------ Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 18 ++ Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf | 2 +- Features/Intel/Readme.md | 49 +++-- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 54 +---- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 10 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc | 18 ++ Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc | 2 +- Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc | 18 ++ Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc | 69 +----- Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec | 2 - Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc | 38 +++- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf | 6 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 92 +------- Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc | 18 ++ Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf | 2 +- Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf | 2 +- Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf | 2 +- Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc | 64 +----- Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec | 7 +- Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc | 18 ++ Platform/Intel/{WhitleyOpenBoardPkg => MinPlatformPkg}/Include/Fdf/CommonSpiFvHeaderInfo.fdf | 2 +- Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf | 48 ++-- Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 44 ++++ Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf | 54 ++--- 96 files changed, 1159 insertions(+), 1334 deletions(-) create mode 100644 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf create mode 100644 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf create mode 100644 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf create mode 100644 Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf create mode 100644 Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf create mode 100644 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf create mode 100644 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf rename Platform/Intel/{WhitleyOpenBoardPkg => MinPlatformPkg}/Include/Fdf/CommonSpiFvHeaderInfo.fdf (88%) -- 2.27.0.windows.1
|
|
Re: [PATCH 06/10] OvmfPkg: Add TdxStartupLib
Min Xu
Hi
After I implemented a PoC of PageTable library, I realized that there has already been a same feature requirement. https://bugzilla.tianocore.org/show_bug.cgi?id=847I will figure out a Page walker lib so that these duplicated code can be+VOIDYet another copy of this. Please don't. I discussed with the feature owner (Ni, Ray). He said this feature is in his plan of 2022. He suggest I can wait for the library. Thanks Min
|
|
回复: [edk2-devel] [PATCH] MdeModulePkg/Variable: Make only EFI_VARIABLE_NON_VOLATILE invalid
gaoliming
Reviewed-by: Liming Gao <gaoliming@...>
toggle quoted messageShow quoted text
-----邮件原件-----
|
|
Re: [PATCH] BaseTools/Brotli: update to latest brotli submodule
Pedro Falcato
Hi Bob, My patch includes the other brotli submodule as well, per Liming's request. I saw the PR's CI failed before Christmas but I completely forgot about it, sorry about that! I can take a look again and submit a v2 patch set tomorrow. It's all trivial stuff and I believe it's best that both brotli submodules are kept in sync (despite it being weird that we have two submodules of the same project in the tree, it sounds like something that should be de-duplicated, honestly). Thanks, Pedro
On Tue, 11 Jan 2022, 14:38 Bob Feng, <bob.c.feng@...> wrote: Actually https://github.com/google/brotli/pull/893 this PR just fixed the GCC 11 build issue. It was merged at https://github.com/google/brotli/commit/0a3944c8c99b8d10cc4325f721b7c273d2b41f7b. Both of Pedro's patch and Ross's patch include that fix.
|
|
Re: [edk2-platform PATCH v1] Silicon/Marvell/Armada7k8k: Fix wrong SMBIOS version issue
Marcin Wojtas
wt., 11 sty 2022 o 22:46 Sunny Wang <Sunny.Wang@...> napisał(a):
Reviewed-by: Marcin Wojtas <mw@...> Thanks! Marcin
|
|
Re: Issues with CLANGDWARF tool specification and X64 -- am I nuts or what?
Bill Paul <wpaul@...>
BTW, regarding 3) below, it looks like this is expected behavior from Clang/
toggle quoted messageShow quoted text
LLVM. Dereferencing a NULL pointer is technically undefined in C, and by default the Clang optimizer will cause a trap to occur if you try to do it (because it assumes it's not safe for programs to do that). The flag -fno-delete-null-pointer-checks can be used to avoid this behavior. This flag seems to be valid for Clang 9 and later. This is slightly more efficient than using the volatile keyword to defeat the optimizer. This flag is also for GCC. -Bill
Hello all: --
============================================================================= -Bill Paul (510) 749-2329 | VxWorks Software Architect, wpaul@... | Master of Unix-Fu - Wind River Systems ============================================================================= "I put a dollar in a change machine. Nothing changed." - George Carlin =============================================================================
|
|
[edk2-test][PATCH v1] uefi-sct/SctPkg: Allow some SNP functions to return EFI_UNSUPPORTED
Sunny Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3145
The SimpleNetwork protocol related test cases don't allow some functions to return EFI_UNSUPPORTED, which doesn't comply with UEFI spec. UEFI spec allows EFI_SIMPLE_TEXT_OUT_PROTOCOL functions below to return EFI_UNSUPPORTED. - ReceiveFilters() - Statistics() - NvData() - StationAddress() - Reset() Therefore, update the test cases that consume the functions above to fix this issue. Cc: G Edhaya Chandran <edhaya.chandran@...> Cc: Barton Gao <gaojie@...> Cc: Carolyn Gjertsen <Carolyn.Gjertsen@...> Cc: Heinrich Schuchardt <heinrich.schuchardt@...> Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@...> Signed-off-by: Sunny Wang <sunny.wang@...> --- .../BlackBoxTest/PxeBaseCodeBBTestFunction.c | 88 +- .../SimpleNetworkBBTestConformance.c | 598 +- .../SimpleNetworkBBTestFunction.c | 5041 ++++++++--------- .../BlackBoxTest/PxeBaseCodeBBTestFunction.c | 93 +- .../SimpleNetworkBBTestConformance.c | 599 +- .../SimpleNetworkBBTestFunction.c | 341 +- 6 files changed, 3316 insertions(+), 3444 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/Black= BoxTest/PxeBaseCodeBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/P= rotocol/PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestFunction.c index e353c522..b1f05f8c 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest= /PxeBaseCodeBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/PxeBaseCode/BlackBoxTest= /PxeBaseCodeBBTestFunction.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -24,7 +25,7 @@ Abstract: =20 --*/ =20 -#include "SctLib.h" +#include "SctLib.h" #include "PxeBaseCodeBBTestMain.h" #include "PxeBaseCodeBBTestSupport.h" =20 @@ -203,7 +204,7 @@ BBTestUdpReadFuncSrcPortFilter ( =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Start() Function Test. - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -380,7 +381,7 @@ BBTestNewStartFunctionTest ( L"Mode->PxeBisReplyReceived - %s\r\n", BcInterface->Mode->PxeBisReplyReceived ? L"TRUE" : = L"FALSE" ); - } =20 + } if (BcInterface->Mode->IcmpErrorReceived !=3D FALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -605,7 +606,7 @@ BBTestNewStartFunctionTest ( return Status; } } - =20 + // // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in IPv6 // @@ -627,8 +628,8 @@ BBTestNewStartFunctionTest ( (UINTN)__LINE__, Status ); - =20 - =20 + + if (AssertionType =3D=3D EFI_TEST_ASSERTION_PASSED) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; if (BcInterface->Mode->Started !=3D TRUE) { @@ -720,7 +721,7 @@ BBTestNewStartFunctionTest ( L"Mode->PxeBisReplyReceived - %s\r\n", BcInterface->Mode->PxeBisReplyReceived ? L"TRUE" = : L"FALSE" ); - } =20 + } if (BcInterface->Mode->IcmpErrorReceived !=3D FALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -797,7 +798,7 @@ BBTestNewStartFunctionTest ( L"IS_PXE_PACKET_ZEROED(Mode->ProxyOffer) - Fail\r= \n" ); } - =20 + if (IS_PXE_PACKET_ZEROED(&BcInterface->Mode->PxeDiscover) =3D=3D F= ALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -944,13 +945,13 @@ BBTestNewStartFunctionTest ( ); } } - =20 + return Status; } =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Statistics() Function Test= . - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -974,7 +975,7 @@ BBTestNewSetIpFilterFunctionTest ( UINT8 Index; =20 Index =3D 0; - =20 + // // Get the Standard Library Interface // @@ -1091,7 +1092,7 @@ BBTestNewSetIpFilterFunctionTest ( return Status; } } - =20 + // // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in IPv6 // @@ -1109,16 +1110,16 @@ BBTestNewSetIpFilterFunctionTest ( ); return Status; } - =20 + SctSetMem (&BcIpFilter, sizeof (BcIpFilter), 0); BcIpFilter.Filters =3D EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP; BcIpFilter.IpCnt =3D 2; - =20 + for (Index =3D 0; Index < 16; Index++) { BcIpFilter.IpList[0].v6.Addr[Index] =3D Index; BcIpFilter.IpList[1].v6.Addr[Index] =3D 16 - Index; } - =20 + Status =3D BcInterface->SetIpFilter (BcInterface, &BcIpFilter); if (Status =3D=3D EFI_SUCCESS) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; @@ -1135,7 +1136,7 @@ BBTestNewSetIpFilterFunctionTest ( (UINTN)__LINE__, Status ); - =20 + if (TRUE =3D=3D IsIpFilterEqual (&BcIpFilter, &(BcInterface->Mode->I= pFilter))){ AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { @@ -1158,7 +1159,7 @@ BBTestNewSetIpFilterFunctionTest ( =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Stop() Function Test. - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -1252,7 +1253,7 @@ BBTestNewStopFunctionTest ( __FILE__, (UINTN)__LINE__, Status - ); + ); } =20 // @@ -1290,7 +1291,7 @@ BBTestNewStopFunctionTest ( __FILE__, (UINTN)__LINE__, Status - ); =20 + ); =20 return Status; } @@ -1607,8 +1608,8 @@ BBTestStartFunctionTest ( ); } if ((0 !=3D BcInterface->Mode->IpFilter.Filters) || (0 !=3D BcInterfa= ce->Mode->IpFilter.IpCnt)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - StandardLib->RecordMessage ( + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + StandardLib->RecordMessage ( StandardLib, EFI_VERBOSE_LEVEL_DEFAULT, L"The Mode->IpFilter.Filters or Mode->IpFilter.IpCnt = field is not 0\r\n"); @@ -2032,6 +2033,7 @@ BBTestMtftpFunctionTest ( EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; UINTN FileSize; + EFI_TEST_ASSERTION AssertionType; =20 // // Get support library (Standard Lib, Profile Lib, Logging Lib) @@ -2098,11 +2100,15 @@ BBTestMtftpFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, - EFI_TEST_ASSERTION_FAILED, + AssertionType, gTestGenericFailureGuid, L"EFI_PXE_BASE_CODE_PROTOCOL.ARP - Reset Current MAC"= , L"%a:%d:Status - %r", @@ -2208,6 +2214,7 @@ BBTestUdpWriteFunctionTest ( EFI_STATUS Status; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_TEST_ASSERTION AssertionType; =20 // // Get the Standard Library Interface @@ -2296,11 +2303,15 @@ BBTestUdpWriteFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, - EFI_TEST_ASSERTION_FAILED, + AssertionType, gTestGenericFailureGuid, L"EFI_PXE_BASE_CODE_PROTOCOL.ARP - Reset Current MAC"= , L"%a:%d:Status - %r", @@ -2378,6 +2389,7 @@ BBTestUdpReadFunctionTest ( EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_PXE_BASE_CODE_IP_FILTER BcIpFilter; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_TEST_ASSERTION AssertionType; =20 // // Get the Support Library Interface @@ -2473,8 +2485,12 @@ BBTestUdpReadFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, @@ -2755,8 +2771,12 @@ BBTestArpFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Bla= ckBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.= c index 9597af5a..5290dbb7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestConformance.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -24,7 +25,7 @@ Abstract: =20 --*/ =20 -#include "SctLib.h" +#include "SctLib.h" #include "SimpleNetworkBBTestMain.h" =20 /** @@ -100,7 +101,7 @@ BBTestStartConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // restore SNP status // @@ -108,7 +109,7 @@ BBTestStartConformanceTest ( Status1 =3D SnpInterface->Initialize(SnpInterface, 0, 0); if (EFI_ERROR(Status1)) { return Status1; - } =20 + } } =20 StandardLib->RecordAssertion ( @@ -206,7 +207,7 @@ BBTestStopConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -311,10 +312,10 @@ BBTestInitializeConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status - //=20 + // if (State1 !=3D EfiSimpleNetworkStopped) { Status1 =3D SnpInterface->Start (SnpInterface); if (EFI_ERROR(Status1)) { @@ -332,7 +333,7 @@ BBTestInitializeConformanceTest ( } } =20 - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -416,16 +417,19 @@ BBTestResetConformanceTest ( // Call Reset() function when network interface not start. // Status =3D SnpInterface->Reset (SnpInterface, FALSE); - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - =20 + // // Restore SNP status - //=20 + // if (State1 !=3D EfiSimpleNetworkStopped) { Status1 =3D SnpInterface->Start (SnpInterface); if (EFI_ERROR(Status1)) { @@ -450,7 +454,7 @@ BBTestResetConformanceTest ( (UINTN)__LINE__, Status ); -=20 + =20 return EFI_SUCCESS; } @@ -528,7 +532,7 @@ BBTestShutdownConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -626,31 +630,26 @@ BBTestReceiveFilterConformanceTest ( // Call ReceiveFilters() function if network interface not start. // Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0,= NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D= =3D EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid006, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid006, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + =20 // // Assertion Point 5.6.2.2 @@ -662,31 +661,25 @@ BBTestReceiveFilterConformanceTest ( } =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0,= NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_DEVICE_ERROR) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid007, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() when network interface not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid007, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() when network interface not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Assertion Point 5.6.2.3 @@ -701,31 +694,25 @@ BBTestReceiveFilterConformanceTest ( // Call ReceiveFilters with invalide Enable // Status =3D SnpInterface->ReceiveFilters (SnpInterface, ~(SnpInterface-= Mode->ReceiveFilterMask), 0, FALSE, 0, NULL);- if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid008, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() with invalid Enable.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid008, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() with invalid Enable.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Call ReceiveFilters with invalide MCastFilterCnt @@ -740,85 +727,67 @@ BBTestReceiveFilterConformanceTest ( MAC.Addr[5] =3D 0x02; =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCoun= t + 1, &MAC); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid009, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invo= ke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode= ->MaxMCastFilterCount.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid009, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invok= e ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode-= MaxMCastFilterCount.",+ L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid043, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invo= ke ReceiveFilters() with invalid MCastFilterCnt is 0.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid043, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invok= e ReceiveFilters() with invalid MCastFilterCnt is 0.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid010, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - In= voke ReceiveFilters() with MCastFilterCnt not match MCastFilter.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid010, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Inv= oke ReceiveFilters() with MCastFilterCnt not match MCastFilter.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); } =20 // @@ -912,7 +881,7 @@ BBTestStationAddressConformanceTest ( // save current snp state // State2 =3D SnpInterface->Mode->State; - =20 + // // Assertion Point 5.7.2.2 // Call StationAddress() function if network interface not initialized= . @@ -923,71 +892,60 @@ BBTestStationAddressConformanceTest ( } =20 StatusBuf[1] =3D SnpInterface->StationAddress (SnpInterface, TRUE, NUL= L); - =20 + // // Restore SNP Status // if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status =3D SnpInterface->Initialize(SnpInterface, 0, 0);=20 + Status =3D SnpInterface->Initialize(SnpInterface, 0, 0); if (EFI_ERROR(Status)){ return Status; } } - =20 - if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[0] - ); + + if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (State2 =3D=3D EfiSimpleN= etworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (State2 =3D=3D EfiSimpl= eNetworkStopped)) { + if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid011, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= StationAddress() when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); } - =20 - if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[1] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid011, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = StationAddress() when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); + + + if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) { + if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid012, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= StationAddress() when network interface not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); } - =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid012, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = StationAddress() when network interface not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); + if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Stop (SnpInterface);=20 + Status =3D SnpInterface->Stop (SnpInterface); if (EFI_ERROR(Status)){ return Status; } @@ -1067,30 +1025,25 @@ BBTestStatisticsConformanceTest ( // Call Statistics() function while network interface is not started. // Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D= =3D EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid014, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() while network interface not started.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid014, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() while network interface not started.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Assertion Point 5.8.2.2 @@ -1102,30 +1055,25 @@ BBTestStatisticsConformanceTest ( } =20 Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_DEVICE_ERROR) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid015, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() while network interface is not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid015, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() while network interface is not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Assertion Point 5.8.2.3 @@ -1143,30 +1091,25 @@ BBTestStatisticsConformanceTest ( StatisticsSize =3D 0; =20 Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid017, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() with small buffer.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid017, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() with small buffer.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Restore SNP State @@ -1182,7 +1125,7 @@ BBTestStatisticsConformanceTest ( return Status; } } - =20 + return EFI_SUCCESS; } =20 @@ -1267,7 +1210,7 @@ BBTestMCastIpToMacConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -1405,7 +1348,7 @@ BBTestNVDataConformanceTest ( =20 StatusBuf[0] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamAccessSize, Buffer); CheckPoint1State =3D SnpInterface->Mode->State; - =20 + =20 // // Assertion Point 5.10.2.2 @@ -1425,119 +1368,102 @@ BBTestNVDataConformanceTest ( // Check Point A: "Offset" not be a multiple of NvRamAccessSize // StatusBuf[1] =3D SnpInterface->NvData (SnpInterface, TRUE, (SnpInterfa= ce->Mode->NvRamAccessSize/2), SnpInterface->Mode->NvRamAccessSize, Buffer= ); -=20 + =20 // // Check Point B: "BufferSize" not be a multiple of NvRamAccessSize // StatusBuf[2] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, (SnpInte= rface->Mode->NvRamAccessSize/2), Buffer); -=20 + =20 // // Check Point C: "BufferSize" + "Offset" exceeds "NvRamSize" // - StatusBuf[3] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamSize+100, Buffer);=20 + StatusBuf[3] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamSize+100, Buffer); =20 =20 - if (StatusBuf[0] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[0] - ); + + if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (CheckPoint1State =3D=3D = EfiSimpleNetworkStopped)) { + AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (CheckPoint1State =3D=3D= EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[0]) { AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[0], - gSimpleNetworkBBTestConformanceAssertionGuid020, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); } - - if (StatusBuf[1] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[1] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[0], + gSimpleNetworkBBTestConformanceAssertionGuid020, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); + + + if (StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[1]) { AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[1], - gSimpleNetworkBBTestConformanceAssertionGuid021, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with Offset not be a multiple of NvRamAccessSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[1], + gSimpleNetworkBBTestConformanceAssertionGuid021, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= with Offset not be a multiple of NvRamAccessSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); =20 - if (StatusBuf[2] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[2] - ); + + if (StatusBuf[2] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[2] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[2]) { AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[2], - gSimpleNetworkBBTestConformanceAssertionGuid022, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with BufferSize not be a multiple of NvRamAccessSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[2] - ); } - - if (StatusBuf[3] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[3] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[2], + gSimpleNetworkBBTestConformanceAssertionGuid022, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= with BufferSize not be a multiple of NvRamAccessSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[2] + ); + + if (StatusBuf[3] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[3] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[3] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[3]) { AssertionType[3] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[3] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[3], - gSimpleNetworkBBTestConformanceAssertionGuid023, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with BufferSize + Offset exceeds NvRamSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[3] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[3], + gSimpleNetworkBBTestConformanceAssertionGuid023, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData() w= ith BufferSize + Offset exceeds NvRamSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[3] + ); =20 // // Restore SNP Status @@ -1552,8 +1478,8 @@ BBTestNVDataConformanceTest ( if (EFI_ERROR(Status)) { return Status; } - }=20 - =20 + } + Status =3D gtBS->FreePool (Buffer); if (EFI_ERROR(Status)) { return Status; @@ -1641,7 +1567,7 @@ BBTestGetStatusConformanceTest ( } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Assertion Point 5.11.2.2 // Call GetStatus () function if network interface not initialized. @@ -1667,7 +1593,7 @@ BBTestGetStatusConformanceTest ( } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } -=20 + /* // // Assertion Point 5.11.2.3 @@ -1696,7 +1622,7 @@ BBTestGetStatusConformanceTest ( AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED; } */ - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[0], @@ -1707,7 +1633,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -1718,7 +1644,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[1] ); -/* =20 +/* StandardLib->RecordAssertion ( StandardLib, AssertionType[2], @@ -1729,7 +1655,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[2] ); -*/ =20 +*/ // // Restore SNP State // @@ -1902,7 +1828,7 @@ BBTestTransmitConformanceTest ( } else { AssertionType[4] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + =20 // // Check Point D: HeaderSize is nonzero and DestAddr is NULL. @@ -1913,7 +1839,7 @@ BBTestTransmitConformanceTest ( } else { AssertionType[5] =3D EFI_TEST_ASSERTION_FAILED; } -=20 + =20 // // Check Point E: HeaderSize is nonzero and Protocol is NULL. @@ -1935,7 +1861,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -1945,7 +1871,7 @@ BBTestTransmitConformanceTest ( __FILE__, (UINTN)__LINE__, StatusBuf[1] - ); + ); =20 StandardLib->RecordAssertion ( StandardLib, @@ -1957,7 +1883,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[2] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[3], @@ -1978,7 +1904,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[4] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[5], @@ -1989,7 +1915,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[5] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[6], @@ -2119,7 +2045,7 @@ BBTestReceiveConformanceTest ( } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + =20 // // Assertion Point 5.13.2.2 @@ -2136,7 +2062,7 @@ BBTestReceiveConformanceTest ( } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Assertion Point 5.13.2.3 // Call Receive() function with invalid parameters. @@ -2171,7 +2097,7 @@ BBTestReceiveConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -2208,22 +2134,22 @@ BBTestReceiveConformanceTest ( return Status; } } - =20 + #if 0 // // Assertion Point 5.13.2.4 // No Packet Received in the Network Interface when Receive(). // // We should disable the muticast and broadcast receive filters first.= because - // some muticast or broadcast packets maybe on the LAN=20 + // some muticast or broadcast packets maybe on the LAN // Status =3D SnpInterface->ReceiveFilters ( - SnpInterface,=20 - 0,=20 - EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST | EFI_SIM= PLE_NETWORK_RECEIVE_BROADCAST,=20 - TRUE,=20 - 0,=20 - NULL); + SnpInterface, + 0, + EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST | EFI_SI= MPLE_NETWORK_RECEIVE_BROADCAST, + TRUE, + 0, + NULL); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( StandardLib, @@ -2235,7 +2161,7 @@ BBTestReceiveConformanceTest ( (UINTN)__LINE__, Status ); - return Status; + return Status; } =20 Status =3D EFI_SUCCESS; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/Bla= ckBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/E= FI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c index 16f541ee..697a7a03 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestFunction.c @@ -1,894 +1,914 @@ -/** @file - - Copyright 2006 - 2016 Unified EFI, Inc.<BR> - Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR> - - This program and the accompanying materials - are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 - http://opensource.org/licenses/bsd-license.php -=20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 -**/ -/*++ - -Module Name: - - SimpleNetworkBBTestFunction.c - -Abstract: - - Basic Test Cases of SimpleNetwork Protocol - ---*/ - +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.<BR> + Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the = BSD License + which accompanies this distribution. The full text of the license may= be found at + 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 I= MPLIED. + +**/ +/*++ + +Module Name: + + SimpleNetworkBBTestFunction.c + +Abstract: + + Basic Test Cases of SimpleNetwork Protocol + +--*/ + #include "SctLib.h" -#include "SimpleNetworkBBTestMain.h" - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Start() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.1 -// -EFI_STATUS -BBTestStartFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status, Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkSto= pped. - // If not, change the state to EfiSimpleNetworkStopped. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.1.2.1 - // Call Start() function to change the state from "Stopped" to "Starte= d". - // - Status =3D SnpInterface->Start (SnpInterface); - if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkStarted)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - // - // Restore SNP state - // - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status1 =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status1)) { - return Status1; - } - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid001, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Start - Invoke Start() an= d verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Stop() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.2 -// -EFI_STATUS -BBTestStopFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status, Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkSta= rted. - // If not, change the state to EfiSimpleNetworkStarted. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.2.2.1 - // Call Stop() function to change the state from "Started" to "Stopped= ". - // - Status =3D SnpInterface->Stop (SnpInterface); - if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkStopped)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - // - // Restore SNP State - // - if (State1 !=3D EfiSimpleNetworkStopped) { - Status1 =3D SnpInterface->Start(SnpInterface); - if (EFI_ERROR(Status1)) { - return Status1; - } - } - - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status1 =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status1)) { - return Status1; - } - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid002, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Stop - Invoke Stop() and = verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Initialize() Function Tes= t. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.3 -// -EFI_STATUS -BBTestInitializeFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkSta= rted. - // If not, change the state to EfiSimpleNetworkStarted. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.3.2.1 - // Call Initialize() function to change the state from "Started" to "I= nitialized". - // - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkInitialized)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid003, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Initialize - Invoke Initi= alize() and verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Assertion Point 4.3.2.2 - // Call Initialize() function with extra Tx/Rx specified to change the= state from "Started" to "Initialized". - // - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Initialize (SnpInterface, 32, 32); - if ((Status =3D=3D EFI_UNSUPPORTED) || ((Status =3D=3D EFI_SUCCESS) &&= (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized))) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid004, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Initialize - Invoke Initi= alize() with extra Tx/Rx specified and verify interface correctness withi= n test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Restore SNP State - // - if (Status =3D=3D EFI_SUCCESS) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - SnpInterface->Initialize (SnpInterface, 0, 0); - } - } - - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Reset() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.4 -// -EFI_STATUS -BBTestResetFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_STATUS Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_SIMPLE_NETWORK_MODE Mode; - UINT32 InterruptStatus; - VOID *TxBuf; - EFI_NETWORK_STATISTICS StatisticsTable1; - UINTN StatisticsSize1; - EFI_NETWORK_STATISTICS StatisticsTable2; - UINTN StatisticsSize2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.4.2.1 - // Call Reset() function with ExtendedVerification is FALSE. - // - SctSetMem (&Mode, sizeof (EFI_SIMPLE_NETWORK_MODE), 0x0); - SctCopyMem (&Mode, SnpInterface->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE= )); - - SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); - StatisticsSize1 =3D sizeof (EFI_NETWORK_STATISTICS); - Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize1, &StatisticsTable1); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Reset (SnpInterface, FALSE); - - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - if ((Mode.State !=3D SnpInterface->Mode->State) || - (Mode.ReceiveFilterMask !=3D SnpInterface->Mode->ReceiveFilterMask= ) || - (Mode.ReceiveFilterSetting !=3D SnpInterface->Mode->ReceiveFilterS= etting) || - SctCompareMem (&(Mode.CurrentAddress), &(SnpInterface->Mode->Curre= ntAddress), sizeof (EFI_MAC_ADDRESS)) || - SctCompareMem (&(Mode.PermanentAddress), &(SnpInterface->Mode->Per= manentAddress), sizeof (EFI_MAC_ADDRESS))) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - TxBuf =3D NULL; - Status1 =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &= TxBuf); - if (EFI_ERROR(Status1)) { - return Status1; - } - - if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { - if (InterruptStatus !=3D 0 || TxBuf !=3D NULL) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - } else { - if ((InterruptStatus & - ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | - EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | - EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | - EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) || TxBuf !=3D NU= LL) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - } - - SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); - StatisticsSize2 =3D sizeof (EFI_NETWORK_STATISTICS); - Status1 =3D SnpInterface->Statistics (SnpInterface, FALSE, &Statistics= Size2, &StatisticsTable2); - if (EFI_ERROR(Status1)) { - return Status1; - } - - if ((StatisticsSize1 !=3D StatisticsSize2) || - SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI_N= ETWORK_STATISTICS))) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid005, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Reset - Invoke Reset() wi= th ExtendedVerification is FALSE and verify interface correctness within = test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Assertion Point 4.4.2.2 - // Call Reset() function with ExtendedVerification is TRUE. - // - Status =3D SnpInterface->Reset (SnpInterface, TRUE); - if (Status =3D=3D EFI_SUCCESS) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid006, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Reset - Invoke Reset() wi= th ExtendedVerification is TRUE and verify interface correctness within t= est case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Shutdown() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.5 -// -EFI_STATUS -BBTestShutdownFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status, Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.5.2.1 - // Call Shutdown() function. - // - Status =3D SnpInterface->Shutdown (SnpInterface); - - if ((Status =3D=3D EFI_SUCCESS) && - (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkStarted)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status1 =3D SnpInterface->Initialize(SnpInterface, 0, 0); - if (EFI_ERROR(Status1)) { - return Status1; - } - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid007, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Shutdown - Invoke Shutdow= n() and verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status1 =3D SnpInterface->Stop(SnpInterface); - if (EFI_ERROR(Status1)) { - return Status1; - } - } - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilter() Function = Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.6 -// -EFI_STATUS -BBTestReceiveFilterFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_SIMPLE_NETWORK_MODE Mode; - EFI_MAC_ADDRESS MAC; - UINT32 ReceiveFilterMask; - UINT32 SupportedFilter; - UINT32 Index; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // retrieve the supported bit in SnpInterface->Mode->ReceiveFilterMask - // - SupportedFilter =3D 0; - ReceiveFilterMask =3D SnpInterface->Mode->ReceiveFilterMask; - for (Index =3D 0; Index < 5; Index++) { - if ((ReceiveFilterMask & 0x00000001) =3D=3D 0x00000001) { - SupportedFilter =3D 0x00000001 << Index; - break; - } - ReceiveFilterMask =3D ReceiveFilterMask >> 1; - } - - SctSetMem (&Mode, sizeof (EFI_SIMPLE_NETWORK_MODE), 0x0); - SctCopyMem (&Mode, SnpInterface->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE= )); - - if (SupportedFilter !=3D 0) { - // - // Assertion Point 4.6.2.1 - // Modify multicast receive filters masks. - // - - // Check point B. Disable Specified bit. - Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, SupportedF= ilter, FALSE, 0, NULL); - - if ((Status =3D=3D EFI_SUCCESS) && - ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid008, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters masks(Disable Speci= fied bit) and verify interface correctness within test case", - L"%a:%d:Status - %r, Filter - %x", - __FILE__, - (UINTN)__LINE__, - Status, +#include "SimpleNetworkBBTestMain.h" + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Start() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.1 +// +EFI_STATUS +BBTestStartFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status, Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkSto= pped. + // If not, change the state to EfiSimpleNetworkStopped. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.1.2.1 + // Call Start() function to change the state from "Stopped" to "Starte= d". + // + Status =3D SnpInterface->Start (SnpInterface); + if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkStarted)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + // + // Restore SNP state + // + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status1 =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status1)) { + return Status1; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid001, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Start - Invoke Start() an= d verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Stop() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.2 +// +EFI_STATUS +BBTestStopFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status, Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkSta= rted. + // If not, change the state to EfiSimpleNetworkStarted. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.2.2.1 + // Call Stop() function to change the state from "Started" to "Stopped= ". + // + Status =3D SnpInterface->Stop (SnpInterface); + if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + // + // Restore SNP State + // + if (State1 !=3D EfiSimpleNetworkStopped) { + Status1 =3D SnpInterface->Start(SnpInterface); + if (EFI_ERROR(Status1)) { + return Status1; + } + } + + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status1 =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status1)) { + return Status1; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid002, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Stop - Invoke Stop() and = verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Initialize() Function Tes= t. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.3 +// +EFI_STATUS +BBTestInitializeFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkSta= rted. + // If not, change the state to EfiSimpleNetworkStarted. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.3.2.1 + // Call Initialize() function to change the state from "Started" to "I= nitialized". + // + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D E= fiSimpleNetworkInitialized)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid003, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Initialize - Invoke Initi= alize() and verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 4.3.2.2 + // Call Initialize() function with extra Tx/Rx specified to change the= state from "Started" to "Initialized". + // + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Initialize (SnpInterface, 32, 32); + if ((Status =3D=3D EFI_UNSUPPORTED) || ((Status =3D=3D EFI_SUCCESS) &&= (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid004, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Initialize - Invoke Initi= alize() with extra Tx/Rx specified and verify interface correctness withi= n test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + + // + // Restore SNP State + // + if (Status =3D=3D EFI_SUCCESS) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + SnpInterface->Initialize (SnpInterface, 0, 0); + } + } + + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Reset() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.4 +// +EFI_STATUS +BBTestResetFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_STATUS Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_SIMPLE_NETWORK_MODE Mode; + UINT32 InterruptStatus; + VOID *TxBuf; + EFI_NETWORK_STATISTICS StatisticsTable1; + UINTN StatisticsSize1; + EFI_NETWORK_STATISTICS StatisticsTable2; + UINTN StatisticsSize2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.4.2.1 + // Call Reset() function with ExtendedVerification is FALSE. + // + SctSetMem (&Mode, sizeof (EFI_SIMPLE_NETWORK_MODE), 0x0); + SctCopyMem (&Mode, SnpInterface->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE= )); + + SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); + StatisticsSize1 =3D sizeof (EFI_NETWORK_STATISTICS); + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize1, &StatisticsTable1); + if (EFI_ERROR(Status)) { + return Status; + } + + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + Status =3D SnpInterface->Reset (SnpInterface, FALSE); + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + + if ((Mode.State !=3D SnpInterface->Mode->State) || + (Mode.ReceiveFilterMask !=3D SnpInterface->Mode->ReceiveFilterMask= ) || + (Mode.ReceiveFilterSetting !=3D SnpInterface->Mode->ReceiveFilterS= etting) || + SctCompareMem (&(Mode.CurrentAddress), &(SnpInterface->Mode->Curre= ntAddress), sizeof (EFI_MAC_ADDRESS)) || + SctCompareMem (&(Mode.PermanentAddress), &(SnpInterface->Mode->Per= manentAddress), sizeof (EFI_MAC_ADDRESS))) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + TxBuf =3D NULL; + Status1 =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &= TxBuf); + if (EFI_ERROR(Status1)) { + return Status1; + } + + if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { + if (InterruptStatus !=3D 0 || TxBuf !=3D NULL) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } else { + if ((InterruptStatus & + ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | + EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | + EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | + EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) || TxBuf !=3D NU= LL) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + + SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); + StatisticsSize2 =3D sizeof (EFI_NETWORK_STATISTICS); + Status1 =3D SnpInterface->Statistics (SnpInterface, FALSE, &Statistics= Size2, &StatisticsTable2); + if (EFI_ERROR(Status1)) { + return Status1; + } + + if ((StatisticsSize1 !=3D StatisticsSize2) || + SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI_N= ETWORK_STATISTICS))) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid005, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Reset - Invoke Reset() wi= th ExtendedVerification is FALSE and verify interface correctness within = test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 4.4.2.2 + // Call Reset() function with ExtendedVerification is TRUE. + // + Status =3D SnpInterface->Reset (SnpInterface, TRUE); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid006, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Reset - Invoke Reset() wi= th ExtendedVerification is TRUE and verify interface correctness within t= est case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Shutdown() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.5 +// +EFI_STATUS +BBTestShutdownFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status, Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.5.2.1 + // Call Shutdown() function. + // + Status =3D SnpInterface->Shutdown (SnpInterface); + + if ((Status =3D=3D EFI_SUCCESS) && + (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkStarted)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkInitialized) { + Status1 =3D SnpInterface->Initialize(SnpInterface, 0, 0); + if (EFI_ERROR(Status1)) { + return Status1; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid007, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Shutdown - Invoke Shutdow= n() and verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status1 =3D SnpInterface->Stop(SnpInterface); + if (EFI_ERROR(Status1)) { + return Status1; + } + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilter() Function = Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.6 +// +EFI_STATUS +BBTestReceiveFilterFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_SIMPLE_NETWORK_MODE Mode; + EFI_MAC_ADDRESS MAC; + UINT32 ReceiveFilterMask; + UINT32 SupportedFilter; + UINT32 Index; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // retrieve the supported bit in SnpInterface->Mode->ReceiveFilterMask + // + SupportedFilter =3D 0; + ReceiveFilterMask =3D SnpInterface->Mode->ReceiveFilterMask; + for (Index =3D 0; Index < 5; Index++) { + if ((ReceiveFilterMask & 0x00000001) =3D=3D 0x00000001) { + SupportedFilter =3D 0x00000001 << Index; + break; + } + ReceiveFilterMask =3D ReceiveFilterMask >> 1; + } + + SctSetMem (&Mode, sizeof (EFI_SIMPLE_NETWORK_MODE), 0x0); + SctCopyMem (&Mode, SnpInterface->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE= )); + + if (SupportedFilter !=3D 0) { + // + // Assertion Point 4.6.2.1 + // Modify multicast receive filters masks. + // + + // Check point B. Disable Specified bit. + Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, SupportedF= ilter, FALSE, 0, NULL); + if ((Status =3D=3D EFI_SUCCESS) && + ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid008, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters masks(Disable Speci= fied bit) and verify interface correctness within test case", + L"%a:%d:Status - %r, Filter - %x", + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)SnpInterface->Mode->ReceiveFilterSetting - ); - - // Check point A. Enable Specified bit. - Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, 0, FALSE, 0, NULL); - - if ((Status =3D=3D EFI_SUCCESS) && - ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) !=3D= 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid009, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters () to modify multicast receive filters masks (Enable Spec= ified bit) and verify interface correctness within test case", - L"%a:%d:Status - %r, Filter - %x", - __FILE__, - (UINTN)__LINE__, - Status, + ); + + // Check point A. Enable Specified bit. + Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, 0, FALSE, 0, NULL); + if ((Status =3D=3D EFI_SUCCESS) && + ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) !=3D= 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid009, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters () to modify multicast receive filters masks (Enable Spec= ified bit) and verify interface correctness within test case", + L"%a:%d:Status - %r, Filter - %x", + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)SnpInterface->Mode->ReceiveFilterSetting - ); - - // Check point C. Enable and Disable Specified bit together. - Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, SupportedFilter, FALSE, 0, NULL); - - if ((Status =3D=3D EFI_SUCCESS) && - ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid010, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters masks(Enable and Di= sable Specified bit together) and verify interface correctness within tes= t case", - L"%a:%d:Status - %r, Filter - %x", - __FILE__, - (UINTN)__LINE__, - Status, + ); + + // Check point C. Enable and Disable Specified bit together. + Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, SupportedFilter, FALSE, 0, NULL); + if ((Status =3D=3D EFI_SUCCESS) && + ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid010, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters masks(Enable and Di= sable Specified bit together) and verify interface correctness within tes= t case", + L"%a:%d:Status - %r, Filter - %x", + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)SnpInterface->Mode->ReceiveFilterSetting - ); - } - - // - // Assertion Point 4.6.2.2 - // Modify multicast receive filters list. - // - if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIV= E_MULTICAST) !=3D 0) { - SctSetMem (&MAC, sizeof (MAC), 0x00); - MAC.Addr[0] =3D 0x01; - MAC.Addr[1] =3D 0x00; - MAC.Addr[2] =3D 0x5e; - MAC.Addr[3] =3D 0x00; - MAC.Addr[4] =3D 0x00; - MAC.Addr[5] =3D 0x02; - Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 1, &MAC); - if ((Status =3D=3D EFI_SUCCESS) && - (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized) && - (SnpInterface->Mode->MCastFilterCount =3D=3D 1) && - (!SctCompareMem (SnpInterface->Mode->MCastFilter, &MAC, sizeof (EF= I_MAC_ADDRESS)))) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else if ((Status =3D=3D EFI_INVALID_PARAMETER) && (SnpInterface->M= ode->MaxMCastFilterCount =3D=3D 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid011, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters list and verify int= erface correctness within test case", - L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count - = %d, Address - %x,%x,%x", - __FILE__, - (UINTN)__LINE__, - Status, + ); + } + + // + // Assertion Point 4.6.2.2 + // Modify multicast receive filters list. + // + if ((SnpInterface->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIV= E_MULTICAST) !=3D 0) { + SctSetMem (&MAC, sizeof (MAC), 0x00); + MAC.Addr[0] =3D 0x01; + MAC.Addr[1] =3D 0x00; + MAC.Addr[2] =3D 0x5e; + MAC.Addr[3] =3D 0x00; + MAC.Addr[4] =3D 0x00; + MAC.Addr[5] =3D 0x02; + Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 1, &MAC); + if ((Status =3D=3D EFI_SUCCESS) && + (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized) && + (SnpInterface->Mode->MCastFilterCount =3D=3D 1) && + (!SctCompareMem (SnpInterface->Mode->MCastFilter, &MAC, sizeof (EF= I_MAC_ADDRESS)))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else if ((Status =3D=3D EFI_INVALID_PARAMETER) && (SnpInterface->M= ode->MaxMCastFilterCount =3D=3D 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid011, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() to modify multicast receive filters list and verify int= erface correctness within test case", + L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count - = %d, Address - %x,%x,%x", + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)SnpInterface->Mode->ReceiveFilterSetting, (UINTN)SnpInterface->Mode->ReceiveFilterMask, (UINTN)SnpInterface->Mode->MCastFilterCount, (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] - ); - } - - // - // Assertion Point 4.6.2.3 - // Reset multicast receive filters list. - // - - Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, TRUE, 0, = NULL); - - if ((Status =3D=3D EFI_SUCCESS) && - (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized) && - (SnpInterface->Mode->MCastFilterCount =3D=3D 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid012, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke R= eceiveFilters() to reset multicast receive filters list and verify interf= ace correctness within test case", + ); + } + + // + // Assertion Point 4.6.2.3 + // Reset multicast receive filters list. + // + + Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, TRUE, 0, = NULL); + if ((Status =3D=3D EFI_SUCCESS) && + (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized) && + (SnpInterface->Mode->MCastFilterCount =3D=3D 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid012, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke R= eceiveFilters() to reset multicast receive filters list and verify interf= ace correctness within test case", L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count - %d= (%d), Address - %x, %x, %x", - __FILE__, - (UINTN)__LINE__, - Status, + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)SnpInterface->Mode->ReceiveFilterSetting, (UINTN)SnpInterface->Mode->ReceiveFilterMask, (UINTN)SnpInterface->Mode->MCastFilterCount, @@ -896,1654 +916,1627 @@ BBTestReceiveFilterFunctionTest ( (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] - ); - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress() Function= Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.7 -// -EFI_STATUS -BBTestStationAddressFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_STATUS StatusBuf[2]; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_MAC_ADDRESS MacAddress; - INTN CheckPoint1, CheckPoint2; - EFI_MAC_ADDRESS BackMacAddress; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.7.2.1 - // Call StationAddress to reset its MAC Address. - // - StatusBuf[0] =3D SnpInterface->StationAddress (SnpInterface, TRUE, NUL= L); - CheckPoint1 =3D SctCompareMem ( - &SnpInterface->Mode->CurrentAddress, - &SnpInterface->Mode->PermanentAddress, - sizeof (EFI_MAC_ADDRESS) - ); - - // - // Assertion Point 4.7.2.2 - // Call StationAddress to modify its MAC Address. - // - SctCopyMem (&BackMacAddress, &SnpInterface->Mode->CurrentAddress, size= of (EFI_MAC_ADDRESS)); - - SctSetMem (&MacAddress, sizeof (EFI_MAC_ADDRESS), 0x0); - StatusBuf[1] =3D SnpInterface->StationAddress (SnpInterface, FALSE, &M= acAddress); - CheckPoint2 =3D SctCompareMem ( - &SnpInterface->Mode->CurrentAddress, - &MacAddress, - sizeof (EFI_MAC_ADDRESS) - ); - - // - // restore temperate MAC address - // - SnpInterface->StationAddress (SnpInterface, FALSE, &BackMacAddress); - - if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[0] - ); - } else { - if ((StatusBuf[0] =3D=3D EFI_SUCCESS) && - (!CheckPoint1)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid013, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= ReceiveFilters() to reset its MAC Address and verify interface correctne= ss within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); - } - - if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[1] - ); - } else { - if ((StatusBuf[1] =3D=3D EFI_SUCCESS) && - (!CheckPoint2)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid014, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= ReceiveFilters() to modify its MAC Address and verify interface correctn= ess within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); - } - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Statistics() Function Tes= t. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.8 -// -EFI_STATUS -BBTestStatisticsFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_NETWORK_STATISTICS StatisticsTable1; - EFI_NETWORK_STATISTICS StatisticsTable2; - UINTN StatisticsSize; - EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the Logginh Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiTestLoggingLibraryGuid, - (VOID **) &LoggingLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.8.2.2 - // Collect statistics information without reset the statistics. - // - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); - Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable1); - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); - Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable2); - - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable1), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable2), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); - - if ((Status =3D=3D EFI_SUCCESS) && - (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - if (Status =3D=3D EFI_UNSUPPORTED) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid015, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() without reset the statistics and verify interface correctness wit= hin test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Assertion Point 4.8.2.1 - // Collect statistics information and reset the statistics. - // - SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); - SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); - - // As per the UEFI specification a previous call to SnpInterface->Stat= istics - // may set the StatisticsSize greater than size of EFI_NETWORK_STATIST= ICS. - // Since StatisticsSize is an IN/OUT parameter, reset StatisticsSize t= o - // size of EFI_NETWORK_STATISTICS to avoid memory corruption. - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - Status =3D SnpInterface->Statistics (SnpInterface, TRUE, &StatisticsSi= ze, &StatisticsTable1); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable1), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); - - if ((Status =3D=3D EFI_SUCCESS) && - (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - if (Status =3D=3D EFI_UNSUPPORTED) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid016, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() and reset the statistics and verify interface correctness within = test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.MCastIpToMac() Function T= est. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.9 -// -EFI_STATUS -BBTestMCastIpToMacFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_IP_ADDRESS IP; - EFI_MAC_ADDRESS MAC1; - EFI_MAC_ADDRESS MAC2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Assertion Point 4.9.2.1 - // Change IPV4 to Multicast MAC - // - IP.v4.Addr[0] =3D 234; - IP.v4.Addr[1] =3D 0; - IP.v4.Addr[2] =3D 0; - IP.v4.Addr[3] =3D 1; - SctSetMem (&MAC1, sizeof (EFI_MAC_ADDRESS), 0x0); - SctSetMem (&MAC2, sizeof (EFI_MAC_ADDRESS), 0x0); - MAC2.Addr[0] =3D 0x01; - MAC2.Addr[1] =3D 0x00; - MAC2.Addr[2] =3D 0x5E; - MAC2.Addr[3] =3D 0x00; - MAC2.Addr[4] =3D 0x00; - MAC2.Addr[5] =3D 0x01; - - Status =3D SnpInterface->MCastIpToMac(SnpInterface, FALSE, &IP, &MAC1)= ; - - // - // Do not check the MAC address, because this is based on ethernet. - // - - // if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (&MAC1, &MAC2, s= izeof(EFI_MAC_ADDRESS)))) { - if (Status =3D=3D EFI_SUCCESS) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid017, - L"EFI_SIMPLE_NETWORK_PROTOCOL.MCastIpToMac - Invoke MCa= stIpToMac() and verify interface correctness within test case", - L"%a:%d:Status - %r, MAC address - %02x%02x%02x%02x%02x= %02x", - __FILE__, - (UINTN)__LINE__, - Status, + ); + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress() Function= Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.7 +// +EFI_STATUS +BBTestStationAddressFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_STATUS StatusBuf[2]; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_MAC_ADDRESS MacAddress; + INTN CheckPoint1, CheckPoint2; + EFI_MAC_ADDRESS BackMacAddress; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.7.2.1 + // Call StationAddress to reset its MAC Address. + // + StatusBuf[0] =3D SnpInterface->StationAddress (SnpInterface, TRUE, NUL= L); + CheckPoint1 =3D SctCompareMem ( + &SnpInterface->Mode->CurrentAddress, + &SnpInterface->Mode->PermanentAddress, + sizeof (EFI_MAC_ADDRESS) + ); + + // + // Assertion Point 4.7.2.2 + // Call StationAddress to modify its MAC Address. + // + SctCopyMem (&BackMacAddress, &SnpInterface->Mode->CurrentAddress, size= of (EFI_MAC_ADDRESS)); + + SctSetMem (&MacAddress, sizeof (EFI_MAC_ADDRESS), 0x0); + StatusBuf[1] =3D SnpInterface->StationAddress (SnpInterface, FALSE, &M= acAddress); + CheckPoint2 =3D SctCompareMem ( + &SnpInterface->Mode->CurrentAddress, + &MacAddress, + sizeof (EFI_MAC_ADDRESS) + ); + + // + // restore temperate MAC address + // + SnpInterface->StationAddress (SnpInterface, FALSE, &BackMacAddress); + + if ((StatusBuf[0] =3D=3D EFI_SUCCESS) && + (!CheckPoint1)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D= =3D EFI_UNSUPPORTED)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid013, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = ReceiveFilters() to reset its MAC Address and verify interface correctnes= s within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); + + + if ((StatusBuf[1] =3D=3D EFI_SUCCESS) && + (!CheckPoint2)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D= =3D EFI_UNSUPPORTED)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid014, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = ReceiveFilters() to modify its MAC Address and verify interface correctne= ss within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); + + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Statistics() Function Tes= t. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.8 +// +EFI_STATUS +BBTestStatisticsFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_NETWORK_STATISTICS StatisticsTable1; + EFI_NETWORK_STATISTICS StatisticsTable2; + UINTN StatisticsSize; + EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Logginh Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiTestLoggingLibraryGuid, + (VOID **) &LoggingLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.8.2.2 + // Collect statistics information without reset the statistics. + // + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable1); + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); + Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable2); + + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable1), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable2), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); + + if ((Status =3D=3D EFI_SUCCESS) && + (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid015, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() without reset the statistics and verify interface correctness wit= hin test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 4.8.2.1 + // Collect statistics information and reset the statistics. + // + SctSetMem (&StatisticsTable1, sizeof (EFI_NETWORK_STATISTICS), 0x0); + SctSetMem (&StatisticsTable2, sizeof (EFI_NETWORK_STATISTICS), 0x0); + + // As per the UEFI specification a previous call to SnpInterface->Stat= istics + // may set the StatisticsSize greater than size of EFI_NETWORK_STATIST= ICS. + // Since StatisticsSize is an IN/OUT parameter, reset StatisticsSize t= o + // size of EFI_NETWORK_STATISTICS to avoid memory corruption. + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + Status =3D SnpInterface->Statistics (SnpInterface, TRUE, &StatisticsSi= ze, &StatisticsTable1); + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= (StatisticsTable1), sizeof (EFI_NETWORK_STATISTICS)/2, EFI_DUMP_HEX); + + if ((Status =3D=3D EFI_SUCCESS) && + (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid016, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stati= stics() and reset the statistics and verify interface correctness within = test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.MCastIpToMac() Function T= est. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.9 +// +EFI_STATUS +BBTestMCastIpToMacFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_IP_ADDRESS IP; + EFI_MAC_ADDRESS MAC1; + EFI_MAC_ADDRESS MAC2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Assertion Point 4.9.2.1 + // Change IPV4 to Multicast MAC + // + IP.v4.Addr[0] =3D 234; + IP.v4.Addr[1] =3D 0; + IP.v4.Addr[2] =3D 0; + IP.v4.Addr[3] =3D 1; + SctSetMem (&MAC1, sizeof (EFI_MAC_ADDRESS), 0x0); + SctSetMem (&MAC2, sizeof (EFI_MAC_ADDRESS), 0x0); + MAC2.Addr[0] =3D 0x01; + MAC2.Addr[1] =3D 0x00; + MAC2.Addr[2] =3D 0x5E; + MAC2.Addr[3] =3D 0x00; + MAC2.Addr[4] =3D 0x00; + MAC2.Addr[5] =3D 0x01; + + Status =3D SnpInterface->MCastIpToMac(SnpInterface, FALSE, &IP, &MAC1)= ; + + // + // Do not check the MAC address, because this is based on ethernet. + // + + // if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (&MAC1, &MAC2, s= izeof(EFI_MAC_ADDRESS)))) { + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid017, + L"EFI_SIMPLE_NETWORK_PROTOCOL.MCastIpToMac - Invoke MCa= stIpToMac() and verify interface correctness within test case", + L"%a:%d:Status - %r, MAC address - %02x%02x%02x%02x%02x= %02x", + __FILE__, + (UINTN)__LINE__, + Status, (UINTN)MAC1.Addr[0], (UINTN)MAC1.Addr[1], (UINTN)MAC1.Addr[2], (UINTN)MAC1.Addr[3], (UINTN)MAC1.Addr[4], (UINTN)MAC1.Addr[5] - ); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - // - // Assertion Point 4.9.2.2 - // Change IPV6 to Multicast MAC - // - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.NVData() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.10 -// -EFI_STATUS -BBTestNVDataFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_STATUS Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - VOID *Buffer; - VOID *Buffer1; - VOID *Buffer2; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - if ((SnpInterface->Mode->NvRamAccessSize =3D=3D 0) || (SnpInterface->M= ode->NvRamSize =3D=3D 0)) { - StandardLib->RecordMessage ( - StandardLib, - EFI_VERBOSE_LEVEL_DEFAULT, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - NvRAM device i= s not attached\n" - ); - return EFI_SUCCESS; - } - - Buffer =3D NULL; - Buffer1 =3D NULL; - Buffer2 =3D NULL; - Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer); - if (EFI_ERROR(Status)) { - goto End; - } - Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer1); - if (EFI_ERROR(Status)) { - goto End; - } - Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer2); - if (EFI_ERROR(Status)) { - goto End; - } - - // - // Assertion Point 4.10.2.1 - // Read NVRam - // - - //Check Point A(0, n*NvRamAccessSize) - SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); - Status =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface->= Mode->NvRamSize, Buffer); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); - } else { - if (Status =3D=3D EFI_SUCCESS) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid018, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read(0, n*NvRamAccessSize) and verify interface correctness within t= est case", - L"%a:%d:Status - %r, NvRamSize - %d, NvRamAccessSize = - %d", - __FILE__, - (UINTN)__LINE__, - Status, - (UINTN)SnpInterface->Mode->NvRamSize, - (UINTN)SnpInterface->Mode->NvRamAccessSize - ); - } - - //Check Point B(NvRamAccessSize, (n-1)*NvRamAccessSize) - SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); - Status =3D SnpInterface->NvData (SnpInterface, TRUE, SnpInterface->Mod= e->NvRamAccessSize, (SnpInterface->Mode->NvRamSize - SnpInterface->Mode->= NvRamAccessSize), Buffer); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); - } else { - if (Status =3D=3D EFI_SUCCESS) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid019, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read(NvRamAccessSize, (n-1)*NvRamAccessSize) and verify interface co= rrectness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - } - - //Check Point C((n-1)*NvRamAccessSize, NvRamAccessSize) - SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); - Status =3D SnpInterface->NvData (SnpInterface, TRUE, (SnpInterface->Mo= de->NvRamSize - SnpInterface->Mode->NvRamAccessSize), SnpInterface->Mode-= NvRamAccessSize, Buffer);- if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); - } else { - if (Status =3D=3D EFI_SUCCESS) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid020, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read((n-1)*NvRamAccessSize, NvRamAccessSize) and verify interface co= rrectness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - } - - // - // Assertion Point 4.10.2.2 - // Write NVRam - // - - SctSetMem (Buffer1, SnpInterface->Mode->NvRamSize, 0x0); - SctSetMem (Buffer2, SnpInterface->Mode->NvRamSize, 0x0); - // Save the NvData - Status1 =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface-= Mode->NvRamSize, Buffer2);- if (EFI_ERROR(Status1)) { - goto End; - } - Status =3D SnpInterface->NvData (SnpInterface, FALSE, 0, SnpInterface-= Mode->NvRamSize, Buffer);- - // Read the buffer content which was written just now. - Status1 =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface-= Mode->NvRamSize, Buffer1);- if (EFI_ERROR(Status1)) { - goto End; - } - - // recover the NvData - Status1 =3D SnpInterface->NvData (SnpInterface, FALSE, 0, SnpInterface= ->Mode->NvRamSize, Buffer2); - if (EFI_ERROR(Status1)) { - goto End; - } - - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); - } else { - if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (Buffer, Buffer1,= SnpInterface->Mode->NvRamSize))) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid021, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to write and verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - } - -End: - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - gtBS->FreePool (Buffer); - gtBS->FreePool (Buffer1); - gtBS->FreePool (Buffer2); - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus() Function Test= . - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.11 -// -EFI_STATUS -BBTestGetStatusFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_STATUS Status1; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - VOID *TxBuf; - UINT32 InterruptStatus; - EFI_STATUS StatCode; - VOID *Buffer; - UINTN HeaderSize; - UINTN BufferSize; - EFI_MAC_ADDRESS SrcAddr; - EFI_MAC_ADDRESS DestAddr; - UINT16 Protocol; - EFI_NETWORK_STATISTICS StatisticsTable; - EFI_NETWORK_STATISTICS StatisticsTable1; - UINTN StatisticsSize; - EFI_EVENT TimeoutEvent; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Initialize the variables. - // - - Buffer =3D NULL; - HeaderSize =3D 0; - BufferSize =3D 0; - SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); - SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); - Protocol =3D 0; - Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; - if (EFI_ERROR(Status)) { - return Status; - } - - //Need to put correct conten of a packet into the Buffer. - SctSetMem (Buffer, 1024, 0x0); - HeaderSize =3D SnpInterface->Mode->MediaHeaderSize; - BufferSize =3D 128; - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - - Protocol =3D 0x0806; - - // - // Get the Statistics before invoke the Transmit(); - // - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); - - Status =3D SnpInterface->Transmit (SnpInterface, HeaderSize, BufferSiz= e, Buffer, &SnpInterface->Mode->CurrentAddress, &DestAddr, &Protocol); - - // - // Wait the package to be sent - // - if (!EFI_ERROR(Status)) { - StatCode =3DgtBS->CreateEvent ( - EVT_TIMER, - TPL_CALLBACK, - (EFI_EVENT_NOTIFY) NULL, - NULL, - &TimeoutEvent - ); - if (EFI_ERROR(StatCode)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_WARNING, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - CreateEve= nt", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - return StatCode; - } - - StatCode =3D gtBS->SetTimer ( - TimeoutEvent, - TimerRelative, - 50000); /* 5 milliseconds */ - if (EFI_ERROR(StatCode)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_WARNING, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - SetTimer"= , - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - return StatCode; - } - - for (;;) { - StatCode =3D SnpInterface->GetStatus (SnpInterface, &InterruptStat= us, &TxBuf); - - if (EFI_ERROR(StatCode)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - break; - } - - if (TxBuf =3D=3D Buffer) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - break; - } - - if (!EFI_ERROR(tBS->CheckEvent (TimeoutEvent))) { - StatCode =3D EFI_TIMEOUT; - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - break; - } - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid027, - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - The transmi= tted buffer should be shown up in the recycled transmit buffer", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - - tBS->CloseEvent (TimeoutEvent); - gtBS->FreePool (Buffer); - - } - - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - TxBuf =3D NULL; - InterruptStatus =3D 0; - - // - // Wait for the user disconnect the machine from the LAN. - // - SctPrint (L"\nPlease disconnect the machine from the LAN, press any ke= y within 10 seconds\n"); - SctStallForKey (10, NULL); - - // - // Assertion Point 4.11.2.1 - // Call GetStatus() - // - Status =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &T= xBuf); - Status1 =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &= TxBuf); - - if (SnpInterface->Mode-> MediaPresentSupported =3D=3D TRUE) { - if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { - if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS) &= & (InterruptStatus =3D=3D 0)) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - } else { - if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS)) = { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - if (InterruptStatus & - ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | - EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | - EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | - EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid022, - L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke Get= Status() and verify interface correctness within test case", - L"%a:%d:Status - %r, Status1 - %r, InterruptStatus -= %d", - __FILE__, - (UINTN)__LINE__, - Status, - Status1, + ); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + // + // Assertion Point 4.9.2.2 + // Change IPV6 to Multicast MAC + // + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.NVData() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.10 +// +EFI_STATUS +BBTestNVDataFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_STATUS Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + VOID *Buffer; + VOID *Buffer1; + VOID *Buffer2; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + if ((SnpInterface->Mode->NvRamAccessSize =3D=3D 0) || (SnpInterface->M= ode->NvRamSize =3D=3D 0)) { + StandardLib->RecordMessage ( + StandardLib, + EFI_VERBOSE_LEVEL_DEFAULT, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - NvRAM device i= s not attached\n" + ); + return EFI_SUCCESS; + } + + Buffer =3D NULL; + Buffer1 =3D NULL; + Buffer2 =3D NULL; + Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer); + if (EFI_ERROR(Status)) { + goto End; + } + Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer1); + if (EFI_ERROR(Status)) { + goto End; + } + Status =3D gtBS->AllocatePool (EfiLoaderData, SnpInterface->Mode->NvRa= mSize, (VOID **) &Buffer2); + if (EFI_ERROR(Status)) { + goto End; + } + + // + // Assertion Point 4.10.2.1 + // Read NVRam + // + + //Check Point A(0, n*NvRamAccessSize) + SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); + Status =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface->= Mode->NvRamSize, Buffer); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid018, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read(0, n*NvRamAccessSize) and verify interface correctness within te= st case", + L"%a:%d:Status - %r, NvRamSize - %d, NvRamAccessSize -= %d", + __FILE__, + (UINTN)__LINE__, + Status, + (UINTN)SnpInterface->Mode->NvRamSize, + (UINTN)SnpInterface->Mode->NvRamAccessSize + ); + + //Check Point B(NvRamAccessSize, (n-1)*NvRamAccessSize) + SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); + Status =3D SnpInterface->NvData (SnpInterface, TRUE, SnpInterface->Mod= e->NvRamAccessSize, (SnpInterface->Mode->NvRamSize - SnpInterface->Mode->= NvRamAccessSize), Buffer); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid019, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read(NvRamAccessSize, (n-1)*NvRamAccessSize) and verify interface cor= rectness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + + //Check Point C((n-1)*NvRamAccessSize, NvRamAccessSize) + SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); + Status =3D SnpInterface->NvData (SnpInterface, TRUE, (SnpInterface->Mo= de->NvRamSize - SnpInterface->Mode->NvRamAccessSize), SnpInterface->Mode-= NvRamAccessSize, Buffer);+ if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid020, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read((n-1)*NvRamAccessSize, NvRamAccessSize) and verify interface cor= rectness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 4.10.2.2 + // Write NVRam + // + + SctSetMem (Buffer1, SnpInterface->Mode->NvRamSize, 0x0); + SctSetMem (Buffer2, SnpInterface->Mode->NvRamSize, 0x0); + // Save the NvData + Status1 =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface-= Mode->NvRamSize, Buffer2);+ if (EFI_ERROR(Status1)) { + goto End; + } + Status =3D SnpInterface->NvData (SnpInterface, FALSE, 0, SnpInterface-= Mode->NvRamSize, Buffer);+ + // Read the buffer content which was written just now. + Status1 =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface-= Mode->NvRamSize, Buffer1);+ if (EFI_ERROR(Status1)) { + goto End; + } + + // recover the NvData + Status1 =3D SnpInterface->NvData (SnpInterface, FALSE, 0, SnpInterface= ->Mode->NvRamSize, Buffer2); + if (EFI_ERROR(Status1)) { + goto End; + } + + if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (Buffer, Buffer1, S= npInterface->Mode->NvRamSize))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid021, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to write and verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + +End: + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + gtBS->FreePool (Buffer); + gtBS->FreePool (Buffer1); + gtBS->FreePool (Buffer2); + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus() Function Test= . + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.11 +// +EFI_STATUS +BBTestGetStatusFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_STATUS Status1; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + VOID *TxBuf; + UINT32 InterruptStatus; + EFI_STATUS StatCode; + VOID *Buffer; + UINTN HeaderSize; + UINTN BufferSize; + EFI_MAC_ADDRESS SrcAddr; + EFI_MAC_ADDRESS DestAddr; + UINT16 Protocol; + EFI_NETWORK_STATISTICS StatisticsTable; + EFI_NETWORK_STATISTICS StatisticsTable1; + UINTN StatisticsSize; + EFI_EVENT TimeoutEvent; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Initialize the variables. + // + + Buffer =3D NULL; + HeaderSize =3D 0; + BufferSize =3D 0; + SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); + SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); + Protocol =3D 0; + Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; + if (EFI_ERROR(Status)) { + return Status; + } + + //Need to put correct conten of a packet into the Buffer. + SctSetMem (Buffer, 1024, 0x0); + HeaderSize =3D SnpInterface->Mode->MediaHeaderSize; + BufferSize =3D 128; + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + + Protocol =3D 0x0806; + + // + // Get the Statistics before invoke the Transmit(); + // + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); + + Status =3D SnpInterface->Transmit (SnpInterface, HeaderSize, BufferSiz= e, Buffer, &SnpInterface->Mode->CurrentAddress, &DestAddr, &Protocol); + + // + // Wait the package to be sent + // + if (!EFI_ERROR(Status)) { + StatCode =3DgtBS->CreateEvent ( + EVT_TIMER, + TPL_CALLBACK, + (EFI_EVENT_NOTIFY) NULL, + NULL, + &TimeoutEvent + ); + if (EFI_ERROR(StatCode)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_WARNING, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - CreateEve= nt", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + return StatCode; + } + + StatCode =3D gtBS->SetTimer ( + TimeoutEvent, + TimerRelative, + 50000); /* 5 milliseconds */ + if (EFI_ERROR(StatCode)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_WARNING, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - SetTimer"= , + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + return StatCode; + } + + for (;;) { + StatCode =3D SnpInterface->GetStatus (SnpInterface, &InterruptStat= us, &TxBuf); + + if (EFI_ERROR(StatCode)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + break; + } + + if (TxBuf =3D=3D Buffer) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + break; + } + + if (!EFI_ERROR(tBS->CheckEvent (TimeoutEvent))) { + StatCode =3D EFI_TIMEOUT; + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + break; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid027, + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - The transmi= tted buffer should be shown up in the recycled transmit buffer", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + + tBS->CloseEvent (TimeoutEvent); + gtBS->FreePool (Buffer); + + } + + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + TxBuf =3D NULL; + InterruptStatus =3D 0; + + // + // Wait for the user disconnect the machine from the LAN. + // + SctPrint (L"\nPlease disconnect the machine from the LAN, press any ke= y within 10 seconds\n"); + SctStallForKey (10, NULL); + + // + // Assertion Point 4.11.2.1 + // Call GetStatus() + // + Status =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &T= xBuf); + Status1 =3D SnpInterface->GetStatus (SnpInterface, &InterruptStatus, &= TxBuf); + + if (SnpInterface->Mode-> MediaPresentSupported =3D=3D TRUE) { + if (SnpInterface->Mode->MediaPresent =3D=3D FALSE) { + if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS) &= & (InterruptStatus =3D=3D 0)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } else { + if ((Status1 =3D=3D EFI_SUCCESS) && (Status =3D=3D EFI_SUCCESS)) = { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (InterruptStatus & + ~( EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT | + EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT | + EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT | + EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid022, + L"EFI_SIMPLE_NETWORK_PROTOCOL.GetStatus - Invoke Get= Status() and verify interface correctness within test case", + L"%a:%d:Status - %r, Status1 - %r, InterruptStatus -= %d", + __FILE__, + (UINTN)__LINE__, + Status, + Status1, (UINTN)InterruptStatus - ); - } - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - SctPrint (L"\nNow the machine can be reconnected to the LAN, press any= key within 10 seconds\n"); - SctStallForKey (10, NULL); - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Transmit() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.12 -// -EFI_STATUS -BBTestTransmitFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_STATUS StatCode; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; - VOID *Buffer; - UINTN HeaderSize; - UINTN BufferSize; - EFI_MAC_ADDRESS SrcAddr; - EFI_MAC_ADDRESS DestAddr; - UINT16 Protocol; - EFI_NETWORK_STATISTICS StatisticsTable; - EFI_NETWORK_STATISTICS StatisticsTable1; - UINTN StatisticsSize; - UINTN WaitIndex; - EFI_INPUT_KEY Key; - EFI_EVENT TimeoutEvent; - UINT32 IntStatus; - VOID *TxBuf; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the Logginh Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiTestLoggingLibraryGuid, - (VOID **) &LoggingLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Initialize the variables. - // - - Buffer =3D NULL; - HeaderSize =3D 0; - BufferSize =3D 0; - SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); - SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); - Protocol =3D 0; - Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Assertion Point 4.12.2.2 - // Call Transmit() with HeaderSize !=3D 0 - // - - //Need to put correct conten of a packet into the Buffer. - SctSetMem (Buffer, 1024, 0x0); - HeaderSize =3D SnpInterface->Mode->MediaHeaderSize; - BufferSize =3D 128; - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - - Protocol =3D 0x0806; - - // - // Get the Statistics before invoke the Transmit(); - // - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); - - Status =3D SnpInterface->Transmit (SnpInterface, HeaderSize, BufferSiz= e, Buffer, &SnpInterface->Mode->CurrentAddress, &DestAddr, &Protocol); - - // - // Wait the package to be sent - // - if (!EFI_ERROR(Status)) { - StatCode =3DgtBS->CreateEvent ( - EVT_TIMER, - TPL_CALLBACK, - (EFI_EVENT_NOTIFY) NULL, - NULL, - &TimeoutEvent - ); - if (EFI_ERROR(StatCode)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_WARNING, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - CreateEven= t", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - return StatCode; - } - - StatCode =3D gtBS->SetTimer ( - TimeoutEvent, - TimerRelative, - 50000); /* 5 milliseconds */ - if (EFI_ERROR(StatCode)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_WARNING, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - SetTimer", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - return StatCode; - } - - for (;;) { - StatCode =3D SnpInterface->GetStatus (SnpInterface, &IntStatus, &T= xBuf); - - if (EFI_ERROR(StatCode)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_FAILED, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - GetStatu= s", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - gtBS->CloseEvent (TimeoutEvent); - return StatCode; - } - - if (TxBuf =3D=3D Buffer) { - break; - } - - if (!EFI_ERROR(gtBS->CheckEvent (TimeoutEvent))) { - StatCode =3D EFI_TIMEOUT; - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_FAILED, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - Time out= ", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatCode - ); - gtBS->FreePool (Buffer); - gtBS->CloseEvent (TimeoutEvent); - return StatCode; - } - } - - gtBS->CloseEvent (TimeoutEvent); - } - - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); - - // - // Verify the functionality manually. - // - SctPrint (L"Please verify whether the packet is captured by the sniffe= rt, right press \"Y\", wrong press \"N\""); - - // - // Get the input key. - // - while (1) - { - gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); - gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - break; - } - else { - SctPrint (L"Please press \"Y\" or \"N\"\n"); - } - } - if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid024, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - Invoke Transmi= t() with HeaderSize !=3D 0 and verify interface correctness within test c= ase", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - gtBS->FreePool (Buffer); - - return EFI_SUCCESS; -} - -/** - * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Receive() Function Test. - * @param This a pointer of EFI_BB_TEST_PROTOCOL. - * @param ClientInterface a pointer to the interface to be tested. - * @param TestLevel test "thoroughness" control. - * @param SupportHandle a handle containing protocols required. - * @return EFI_SUCCESS Finish the test successfully. - */ -// -// TDS 4.13 -// -EFI_STATUS -BBTestReceiveFunctionTest ( - IN EFI_BB_TEST_PROTOCOL *This, - IN VOID *ClientInterface, - IN EFI_TEST_LEVEL TestLevel, - IN EFI_HANDLE SupportHandle - ) -{ - EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_STATUS Status; - EFI_TEST_ASSERTION AssertionType; - EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; - EFI_SIMPLE_NETWORK_STATE State1, State2; - EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; - VOID *Buffer; - UINTN HeaderSize; - UINTN BufferSize; - EFI_MAC_ADDRESS SrcAddr; - EFI_MAC_ADDRESS DestAddr; - UINT16 Protocol; - EFI_NETWORK_STATISTICS StatisticsTable; - EFI_NETWORK_STATISTICS StatisticsTable1; - UINTN StatisticsSize; - UINTN WaitIndex; - EFI_INPUT_KEY Key; - - // - // Get the Standard Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiStandardTestLibraryGuid, - (VOID **) &StandardLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the Logginh Library Interface - // - Status =3D gtBS->HandleProtocol ( - SupportHandle, - &gEfiTestLoggingLibraryGuid, - (VOID **) &LoggingLib - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - // - // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested - // - SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; - - // - // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. - // If not, change the state to EfiSimpleNetworkInitialized. - // - State1 =3D SnpInterface->Mode->State; - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Start (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - State2 =3D SnpInterface->Mode->State; - if (State2 =3D=3D EfiSimpleNetworkStarted) { - Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); - if (EFI_ERROR(Status)) { - return Status; - } - } - - // - // Enable receive filters - // - Status =3D SnpInterface->ReceiveFilters ( - SnpInterface, - EFI_SIMPLE_NETWORK_RECEIVE_UNICAST|EFI_SIMPLE= _NETWORK_RECEIVE_BROADCAST, - 0, - FALSE, - 0, - NULL - ); - if (EFI_ERROR(Status)) { - StandardLib->RecordAssertion ( - StandardLib, - EFI_TEST_ASSERTION_FAILED, - gTestGenericFailureGuid, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Enable Receiv= eFilters", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - return Status; - } - - // - // Initialize the variables. - // - - Buffer =3D NULL; - HeaderSize =3D 0; - BufferSize =3D 0; - SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0x0); - SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0x0); - Protocol =3D 0; - Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; - if (EFI_ERROR(Status)) { - return Status; - } - - SctSetMem (Buffer, 1024, 0x0); - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - - // - // Get the Statistics before invoke the Receive(); - // - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); - - // - // Wait for the host send the packet. - // - SctPrint (L"\nWait for the host send, yes press \"Y\", no press \"N\"\= n"); - - // - // Get the input key. - // - while (1) - { - gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); - gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - break; - } - else { - SctPrint (L"Please press \"Y\" or \"N\""); - } - } - - // - // BufferSize is smaller than the received Packets. - // - BufferSize =3D 0; - Status =3D SnpInterface->Receive (SnpInterface, 0, &BufferSize, Buffer= , NULL, NULL, 0); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid041, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with BufferSize is smaller than the received Packets.", - L"%a:%d:Status - %r, BufferSize Needed - %d", - __FILE__, - (UINTN)__LINE__, - Status, - BufferSize - ); - - // - // Assertion Point 4.13.2.1 - // Call Receive() with all optional NULL - // - BufferSize =3D 1024; - Status =3D SnpInterface->Receive (SnpInterface, 0, &BufferSize, Buffer= , NULL, NULL, 0); - - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); - - // - // Verify the functionality manually. - // - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)B= uffer, (UINT32)BufferSize/2, EFI_DUMP_HEX); - SctPrint (L"Please verify whether the received packet is right?\nRight= press \"Y\", wrong press \"N\"\n"); - - // - // Get the input key. - // - while (1) - { - gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); - gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - break; - } - else { - SctPrint (L"Please press \"Y\" or \"N\""); - } - } - if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid025, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with all optional NULL and verify interface correctness within test cas= e", - L"%a:%d:Status - %r, Received Buffer Size - %d", - __FILE__, - (UINTN)__LINE__, - Status, - BufferSize - ); - - // - // Assertion Point 4.13.2.2 - // Call Receive() with all optional parameters - // - - SctSetMem (Buffer, 1024, 0x0); - BufferSize =3D 1024; - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - - // - // Get the Statistics before invoke the Receive(); - // - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); - - // - // Wait for the host send the packet. - // - SctPrint (L"Wait for the host send, yes press \"Y\", no press \"N\""); - - // - // Get the input key. - // - while (1) { - gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); - gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - break; - } - else { - SctPrint (L"Please press \"Y\" or \"N\""); - } - } - Status =3D SnpInterface->Receive (SnpInterface, &HeaderSize, &BufferSi= ze, Buffer, &SrcAddr, &DestAddr, &Protocol); - - AssertionType =3D EFI_TEST_ASSERTION_PASSED; - if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); - SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); - - // - // Verify the functionality manually. - // - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)B= uffer, (UINT32)BufferSize/2, EFI_DUMP_HEX); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= SrcAddr, sizeof (EFI_MAC_ADDRESS)/2, EFI_DUMP_HEX); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= DestAddr, sizeof (EFI_MAC_ADDRESS)/2, EFI_DUMP_HEX); - LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= Protocol, sizeof (UINT16)/2, EFI_DUMP_HEX); - SctPrint (L"Please verify whether the received packet is right?\nRight= press \"Y\", wrong press \"N\"\n"); - - // - // Get the input key. - // - while (1) { - gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); - gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); - if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - break; - } - else { - SctPrint (L"Please press \"Y\" or \"N\""); - } - } - if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid026, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with all optional parameters and verify interface correctness within te= st case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); - // - // Restore SNP State - // - if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Shutdown (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - - Status =3D SnpInterface->Stop (SnpInterface); - if (EFI_ERROR(Status)) { - return Status; - } - } - - return EFI_SUCCESS; -} - + ); + } + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + SctPrint (L"\nNow the machine can be reconnected to the LAN, press any= key within 10 seconds\n"); + SctStallForKey (10, NULL); + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Transmit() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.12 +// +EFI_STATUS +BBTestTransmitFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_STATUS StatCode; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; + VOID *Buffer; + UINTN HeaderSize; + UINTN BufferSize; + EFI_MAC_ADDRESS SrcAddr; + EFI_MAC_ADDRESS DestAddr; + UINT16 Protocol; + EFI_NETWORK_STATISTICS StatisticsTable; + EFI_NETWORK_STATISTICS StatisticsTable1; + UINTN StatisticsSize; + UINTN WaitIndex; + EFI_INPUT_KEY Key; + EFI_EVENT TimeoutEvent; + UINT32 IntStatus; + VOID *TxBuf; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Logginh Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiTestLoggingLibraryGuid, + (VOID **) &LoggingLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Initialize the variables. + // + + Buffer =3D NULL; + HeaderSize =3D 0; + BufferSize =3D 0; + SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); + SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0xFF); + Protocol =3D 0; + Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Assertion Point 4.12.2.2 + // Call Transmit() with HeaderSize !=3D 0 + // + + //Need to put correct conten of a packet into the Buffer. + SctSetMem (Buffer, 1024, 0x0); + HeaderSize =3D SnpInterface->Mode->MediaHeaderSize; + BufferSize =3D 128; + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + + Protocol =3D 0x0806; + + // + // Get the Statistics before invoke the Transmit(); + // + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); + + Status =3D SnpInterface->Transmit (SnpInterface, HeaderSize, BufferSiz= e, Buffer, &SnpInterface->Mode->CurrentAddress, &DestAddr, &Protocol); + + // + // Wait the package to be sent + // + if (!EFI_ERROR(Status)) { + StatCode =3DgtBS->CreateEvent ( + EVT_TIMER, + TPL_CALLBACK, + (EFI_EVENT_NOTIFY) NULL, + NULL, + &TimeoutEvent + ); + if (EFI_ERROR(StatCode)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_WARNING, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - CreateEven= t", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + return StatCode; + } + + StatCode =3D gtBS->SetTimer ( + TimeoutEvent, + TimerRelative, + 50000); /* 5 milliseconds */ + if (EFI_ERROR(StatCode)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_WARNING, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - SetTimer", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + return StatCode; + } + + for (;;) { + StatCode =3D SnpInterface->GetStatus (SnpInterface, &IntStatus, &T= xBuf); + + if (EFI_ERROR(StatCode)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - GetStatu= s", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + gtBS->CloseEvent (TimeoutEvent); + return StatCode; + } + + if (TxBuf =3D=3D Buffer) { + break; + } + + if (!EFI_ERROR(gtBS->CheckEvent (TimeoutEvent))) { + StatCode =3D EFI_TIMEOUT; + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - Time out= ", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatCode + ); + gtBS->FreePool (Buffer); + gtBS->CloseEvent (TimeoutEvent); + return StatCode; + } + } + + gtBS->CloseEvent (TimeoutEvent); + } + + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); + + // + // Verify the functionality manually. + // + SctPrint (L"Please verify whether the packet is captured by the sniffe= rt, right press \"Y\", wrong press \"N\""); + + // + // Get the input key. + // + while (1) + { + gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); + gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); + if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + break; + } + else { + SctPrint (L"Please press \"Y\" or \"N\"\n"); + } + } + if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid024, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Transmit - Invoke Transmi= t() with HeaderSize !=3D 0 and verify interface correctness within test c= ase", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + gtBS->FreePool (Buffer); + + return EFI_SUCCESS; +} + +/** + * Entrypoint for EFI_SIMPLE_NETWORK_PROTOCOL.Receive() Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 4.13 +// +EFI_STATUS +BBTestReceiveFunctionTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_TEST_ASSERTION AssertionType; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_SIMPLE_NETWORK_STATE State1, State2; + EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; + VOID *Buffer; + UINTN HeaderSize; + UINTN BufferSize; + EFI_MAC_ADDRESS SrcAddr; + EFI_MAC_ADDRESS DestAddr; + UINT16 Protocol; + EFI_NETWORK_STATISTICS StatisticsTable; + EFI_NETWORK_STATISTICS StatisticsTable1; + UINTN StatisticsSize; + UINTN WaitIndex; + EFI_INPUT_KEY Key; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the Logginh Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiTestLoggingLibraryGuid, + (VOID **) &LoggingLib + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Get the EFI_SIMPLE_NETWORK_PROTOCOL Protocol interface to be tested + // + SnpInterface =3D (EFI_SIMPLE_NETWORK_PROTOCOL *)ClientInterface; + + // + // Check whether the state of network interface is EfiSimpleNetworkIni= tialized. + // If not, change the state to EfiSimpleNetworkInitialized. + // + State1 =3D SnpInterface->Mode->State; + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Start (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + State2 =3D SnpInterface->Mode->State; + if (State2 =3D=3D EfiSimpleNetworkStarted) { + Status =3D SnpInterface->Initialize (SnpInterface, 0, 0); + if (EFI_ERROR(Status)) { + return Status; + } + } + + // + // Enable receive filters + // + Status =3D SnpInterface->ReceiveFilters ( + SnpInterface, + EFI_SIMPLE_NETWORK_RECEIVE_UNICAST|EFI_SIMPLE= _NETWORK_RECEIVE_BROADCAST, + 0, + FALSE, + 0, + NULL + ); + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gTestGenericFailureGuid, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Enable Receiv= eFilters", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // + // Initialize the variables. + // + + Buffer =3D NULL; + HeaderSize =3D 0; + BufferSize =3D 0; + SctSetMem (&SrcAddr, sizeof (EFI_MAC_ADDRESS), 0x0); + SctSetMem (&DestAddr, sizeof (EFI_MAC_ADDRESS), 0x0); + Protocol =3D 0; + Status =3D gtBS->AllocatePool (EfiLoaderData, 1024, (VOID **) &Buffer)= ; + if (EFI_ERROR(Status)) { + return Status; + } + + SctSetMem (Buffer, 1024, 0x0); + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + + // + // Get the Statistics before invoke the Receive(); + // + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); + + // + // Wait for the host send the packet. + // + SctPrint (L"\nWait for the host send, yes press \"Y\", no press \"N\"\= n"); + + // + // Get the input key. + // + while (1) + { + gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); + gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); + if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + break; + } + else { + SctPrint (L"Please press \"Y\" or \"N\""); + } + } + + // + // BufferSize is smaller than the received Packets. + // + BufferSize =3D 0; + Status =3D SnpInterface->Receive (SnpInterface, 0, &BufferSize, Buffer= , NULL, NULL, 0); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid041, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with BufferSize is smaller than the received Packets.", + L"%a:%d:Status - %r, BufferSize Needed - %d", + __FILE__, + (UINTN)__LINE__, + Status, + BufferSize + ); + + // + // Assertion Point 4.13.2.1 + // Call Receive() with all optional NULL + // + BufferSize =3D 1024; + Status =3D SnpInterface->Receive (SnpInterface, 0, &BufferSize, Buffer= , NULL, NULL, 0); + + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); + + // + // Verify the functionality manually. + // + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)B= uffer, (UINT32)BufferSize/2, EFI_DUMP_HEX); + SctPrint (L"Please verify whether the received packet is right?\nRight= press \"Y\", wrong press \"N\"\n"); + + // + // Get the input key. + // + while (1) + { + gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); + gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); + if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + break; + } + else { + SctPrint (L"Please press \"Y\" or \"N\""); + } + } + if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid025, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with all optional NULL and verify interface correctness within test cas= e", + L"%a:%d:Status - %r, Received Buffer Size - %d", + __FILE__, + (UINTN)__LINE__, + Status, + BufferSize + ); + + // + // Assertion Point 4.13.2.2 + // Call Receive() with all optional parameters + // + + SctSetMem (Buffer, 1024, 0x0); + BufferSize =3D 1024; + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + + // + // Get the Statistics before invoke the Receive(); + // + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable); + + // + // Wait for the host send the packet. + // + SctPrint (L"Wait for the host send, yes press \"Y\", no press \"N\""); + + // + // Get the input key. + // + while (1) { + gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); + gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); + if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + break; + } + else { + SctPrint (L"Please press \"Y\" or \"N\""); + } + } + Status =3D SnpInterface->Receive (SnpInterface, &HeaderSize, &BufferSi= ze, Buffer, &SrcAddr, &DestAddr, &Protocol); + + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (EFI_ERROR(Status) || SnpInterface->Mode->State !=3D EfiSimpleNetwo= rkInitialized) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StatisticsSize =3D sizeof (EFI_NETWORK_STATISTICS); + SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsSize, &Stati= sticsTable1); + + // + // Verify the functionality manually. + // + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)B= uffer, (UINT32)BufferSize/2, EFI_DUMP_HEX); + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= SrcAddr, sizeof (EFI_MAC_ADDRESS)/2, EFI_DUMP_HEX); + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= DestAddr, sizeof (EFI_MAC_ADDRESS)/2, EFI_DUMP_HEX); + LoggingLib->DumpBuf (LoggingLib, EFI_VERBOSE_LEVEL_DEFAULT, (CHAR16*)&= Protocol, sizeof (UINT16)/2, EFI_DUMP_HEX); + SctPrint (L"Please verify whether the received packet is right?\nRight= press \"Y\", wrong press \"N\"\n"); + + // + // Get the input key. + // + while (1) { + gtBS->WaitForEvent (1, &(gtST->ConIn->WaitForKey), &WaitIndex); + gtST->ConIn->ReadKeyStroke (gtST->ConIn, &Key); + if ((Key.UnicodeChar =3D=3D L'Y') || (Key.UnicodeChar =3D=3D L'y') |= | (Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + break; + } + else { + SctPrint (L"Please press \"Y\" or \"N\""); + } + } + if ((Key.UnicodeChar =3D=3D L'N') || (Key.UnicodeChar =3D=3D L'n')) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid026, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Invoke Receive(= ) with all optional parameters and verify interface correctness within te= st case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + // + // Restore SNP State + // + if (State1 =3D=3D EfiSimpleNetworkStopped) { + Status =3D SnpInterface->Shutdown (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + + Status =3D SnpInterface->Stop (SnpInterface); + if (EFI_ERROR(Status)) { + return Status; + } + } + + return EFI_SUCCESS; +} + diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/PxeBaseCode/Black= BoxTest/PxeBaseCodeBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/P= rotocol/PxeBaseCode/BlackBoxTest/PxeBaseCodeBBTestFunction.c index b9692461..ce945f19 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/PxeBaseCode/BlackBoxTest= /PxeBaseCodeBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/PxeBaseCode/BlackBoxTest= /PxeBaseCodeBBTestFunction.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -24,7 +25,7 @@ Abstract: =20 --*/ =20 -#include "SctLib.h" +#include "SctLib.h" #include "PxeBaseCodeBBTestMain.h" #include "PxeBaseCodeBBTestSupport.h" =20 @@ -203,7 +204,7 @@ BBTestUdpReadFuncSrcPortFilter ( =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Start() Function Test. - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -380,7 +381,7 @@ BBTestNewStartFunctionTest ( L"Mode->PxeBisReplyReceived - %s\r\n", BcInterface->Mode->PxeBisReplyReceived ? L"TRUE" : = L"FALSE" ); - } =20 + } if (BcInterface->Mode->IcmpErrorReceived !=3D FALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -605,7 +606,7 @@ BBTestNewStartFunctionTest ( return Status; } } - =20 + // // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in IPv6 // @@ -627,8 +628,8 @@ BBTestNewStartFunctionTest ( (UINTN)__LINE__, Status ); - =20 - =20 + + if (AssertionType =3D=3D EFI_TEST_ASSERTION_PASSED) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; if (BcInterface->Mode->Started !=3D TRUE) { @@ -720,7 +721,7 @@ BBTestNewStartFunctionTest ( L"Mode->PxeBisReplyReceived - %s\r\n", BcInterface->Mode->PxeBisReplyReceived ? L"TRUE" = : L"FALSE" ); - } =20 + } if (BcInterface->Mode->IcmpErrorReceived !=3D FALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -797,7 +798,7 @@ BBTestNewStartFunctionTest ( L"IS_PXE_PACKET_ZEROED(Mode->ProxyOffer) - Fail\r= \n" ); } - =20 + if (IS_PXE_PACKET_ZEROED(&BcInterface->Mode->PxeDiscover) =3D=3D F= ALSE) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordMessage ( @@ -944,13 +945,13 @@ BBTestNewStartFunctionTest ( ); } } - =20 + return Status; } =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Statistics() Function Test= . - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -974,7 +975,7 @@ BBTestNewSetIpFilterFunctionTest ( UINT8 Index; =20 Index =3D 0; - =20 + // // Get the Standard Library Interface // @@ -1091,7 +1092,7 @@ BBTestNewSetIpFilterFunctionTest ( return Status; } } - =20 + // // Enable EFI_PXE_BASE_CODE_PROTOCOL Protocol interface in IPv6 // @@ -1109,16 +1110,16 @@ BBTestNewSetIpFilterFunctionTest ( ); return Status; } - =20 + SctSetMem (&BcIpFilter, sizeof (BcIpFilter), 0); BcIpFilter.Filters =3D EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP; BcIpFilter.IpCnt =3D 2; - =20 + for (Index =3D 0; Index < 16; Index++) { BcIpFilter.IpList[0].v6.Addr[Index] =3D Index; BcIpFilter.IpList[1].v6.Addr[Index] =3D 16 - Index; } - =20 + Status =3D BcInterface->SetIpFilter (BcInterface, &BcIpFilter); if (Status =3D=3D EFI_SUCCESS) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; @@ -1135,7 +1136,7 @@ BBTestNewSetIpFilterFunctionTest ( (UINTN)__LINE__, Status ); - =20 + if (TRUE =3D=3D IsIpFilterEqual (&BcIpFilter, &(BcInterface->Mode->I= pFilter))){ AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { @@ -1158,7 +1159,7 @@ BBTestNewSetIpFilterFunctionTest ( =20 /** * Entrypoint for EFI_PXE_BASE_CODE_PROTOCOL.Stop() Function Test. - * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off.=20 + * It is the new case to add IPv6 into the test scope. The original tes= t case is switched off. * @param This a pointer of EFI_BB_TEST_PROTOCOL. * @param ClientInterface a pointer to the interface to be tested. * @param TestLevel test "thoroughness" control. @@ -1252,7 +1253,7 @@ BBTestNewStopFunctionTest ( __FILE__, (UINTN)__LINE__, Status - ); + ); } =20 // @@ -1290,7 +1291,7 @@ BBTestNewStopFunctionTest ( __FILE__, (UINTN)__LINE__, Status - ); =20 + ); =20 return Status; } @@ -1607,8 +1608,8 @@ BBTestStartFunctionTest ( ); } if ((0 !=3D BcInterface->Mode->IpFilter.Filters) || (0 !=3D BcInterfa= ce->Mode->IpFilter.IpCnt)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - StandardLib->RecordMessage ( + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + StandardLib->RecordMessage ( StandardLib, EFI_VERBOSE_LEVEL_DEFAULT, L"The Mode->IpFilter.Filters or Mode->IpFilter.IpCnt = field is not 0\r\n"); @@ -2025,14 +2026,14 @@ BBTestMtftpFunctionTest ( ) { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; + EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; EFI_INI_FILE_HANDLE FileHandle; EFI_STATUS Status; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; UINTN FileSize; - + EFI_TEST_ASSERTION AssertionType; // // Get support library (Standard Lib, Profile Lib, Logging Lib) // @@ -2098,8 +2099,12 @@ BBTestMtftpFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, @@ -2202,12 +2207,13 @@ BBTestUdpWriteFunctionTest ( ) { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; + EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; EFI_INI_FILE_HANDLE FileHandle; EFI_STATUS Status; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_TEST_ASSERTION AssertionType; =20 // // Get the Standard Library Interface @@ -2296,8 +2302,12 @@ BBTestUdpWriteFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, @@ -2371,13 +2381,14 @@ BBTestUdpReadFunctionTest ( ) { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; + EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; EFI_INI_FILE_HANDLE FileHandle; EFI_STATUS Status; EFI_PXE_BASE_CODE_PROTOCOL *BcInterface; EFI_PXE_BASE_CODE_IP_FILTER BcIpFilter; EFI_SIMPLE_NETWORK_PROTOCOL *SnpInterface; + EFI_TEST_ASSERTION AssertionType; =20 // // Get the Support Library Interface @@ -2473,8 +2484,12 @@ BBTestUdpReadFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, @@ -2644,7 +2659,7 @@ BBTestArpFunctionTest ( ) { EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; - EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; + EFI_TEST_PROFILE_LIBRARY_PROTOCOL *ProfileLib; EFI_TEST_LOGGING_LIBRARY_PROTOCOL *LoggingLib; EFI_INI_FILE_HANDLE FileHandle; EFI_STATUS Status; @@ -2755,8 +2770,12 @@ BBTestArpFunctionTest ( } =20 Status =3D SnpInterface->StationAddress (SnpInterface, TRUE, NULL); - if (EFI_ERROR(Status)) - { + if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, EFI_TEST_ASSERTION_FAILED, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/Bla= ckBoxTest/SimpleNetworkBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEF= I/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.= c index 4158bbeb..3fc291e1 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestConformance.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -24,7 +25,7 @@ Abstract: =20 --*/ =20 -#include "SctLib.h" +#include "SctLib.h" #include "SimpleNetworkBBTestMain.h" =20 /** @@ -100,7 +101,7 @@ BBTestStartConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // restore SNP status // @@ -108,7 +109,7 @@ BBTestStartConformanceTest ( Status1 =3D SnpInterface->Initialize(SnpInterface, 0, 0); if (EFI_ERROR(Status1)) { return Status1; - } =20 + } } =20 StandardLib->RecordAssertion ( @@ -206,7 +207,7 @@ BBTestStopConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -311,10 +312,10 @@ BBTestInitializeConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status - //=20 + // if (State1 !=3D EfiSimpleNetworkStopped) { Status1 =3D SnpInterface->Start (SnpInterface); if (EFI_ERROR(Status1)) { @@ -332,7 +333,7 @@ BBTestInitializeConformanceTest ( } } =20 - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -416,16 +417,19 @@ BBTestResetConformanceTest ( // Call Reset() function when network interface not start. // Status =3D SnpInterface->Reset (SnpInterface, FALSE); - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - =20 + // // Restore SNP status - //=20 + // if (State1 !=3D EfiSimpleNetworkStopped) { Status1 =3D SnpInterface->Start (SnpInterface); if (EFI_ERROR(Status1)) { @@ -450,7 +454,7 @@ BBTestResetConformanceTest ( (UINTN)__LINE__, Status ); -=20 + =20 return EFI_SUCCESS; } @@ -528,7 +532,7 @@ BBTestShutdownConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -626,32 +630,27 @@ BBTestReceiveFilterConformanceTest ( // Call ReceiveFilters() function if network interface not start. // Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0,= NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D= =3D EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid006, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid006, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + // // Assertion Point 5.6.2.2 // Call ReceiveFilters() function if network interface not initialized= . @@ -662,32 +661,27 @@ BBTestReceiveFilterConformanceTest ( } =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0,= NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_DEVICE_ERROR) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid007, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() when network interface not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid007, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() when network interface not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + // // Assertion Point 5.6.2.3 // Call ReceiveFilters() function with invalid parameters. @@ -701,32 +695,27 @@ BBTestReceiveFilterConformanceTest ( // Call ReceiveFilters with invalide Enable // Status =3D SnpInterface->ReceiveFilters (SnpInterface, ~(SnpInterface-= Mode->ReceiveFilterMask), 0, FALSE, 0, NULL);- if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid008, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke= ReceiveFilters() with invalid Enable.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid008, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke = ReceiveFilters() with invalid Enable.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + // // Call ReceiveFilters with invalide MCastFilterCnt // @@ -740,85 +729,70 @@ BBTestReceiveFilterConformanceTest ( MAC.Addr[5] =3D 0x02; =20 Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, SnpInterface->Mode->MaxMCastFilterCoun= t + 1, &MAC); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid009, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invo= ke ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode= ->MaxMCastFilterCount.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid009, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invok= e ReceiveFilters() with invalid MCastFilterCnt is greater than Snp->Mode-= MaxMCastFilterCount.",+ L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 0, &MAC); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid043, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invo= ke ReceiveFilters() with invalid MCastFilterCnt is 0.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid043, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invok= e ReceiveFilters() with invalid MCastFilterCnt is 0.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + Status =3D SnpInterface->ReceiveFilters (SnpInterface, EFI_SIMPLE_NE= TWORK_RECEIVE_MULTICAST, 0, FALSE, 1, NULL); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"ReceiveFilters isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_INVALID_PARAMETER) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid010, - L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - In= voke ReceiveFilters() with MCastFilterCnt not match MCastFilter.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid010, + L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Inv= oke ReceiveFilters() with MCastFilterCnt not match MCastFilter.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); } =20 // @@ -912,7 +886,7 @@ BBTestStationAddressConformanceTest ( // save current snp state // State2 =3D SnpInterface->Mode->State; - =20 + // // Assertion Point 5.7.2.2 // Call StationAddress() function if network interface not initialized= . @@ -923,71 +897,59 @@ BBTestStationAddressConformanceTest ( } =20 StatusBuf[1] =3D SnpInterface->StationAddress (SnpInterface, TRUE, NUL= L); - =20 + // // Restore SNP Status // if (State1 =3D=3D EfiSimpleNetworkInitialized) { - Status =3D SnpInterface->Initialize(SnpInterface, 0, 0);=20 + Status =3D SnpInterface->Initialize(SnpInterface, 0, 0); if (EFI_ERROR(Status)){ return Status; } } - =20 - if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[0] - ); + + if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (State2 =3D=3D EfiSimpleN= etworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (State2 =3D=3D EfiSimpl= eNetworkStopped)) { + if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid011, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= StationAddress() when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); } - =20 - if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[1] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid011, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = StationAddress() when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); + + if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[1] =3D=3D EFI_DEVICE_ERROR) { + if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid012, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= StationAddress() when network interface not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); } - =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid012, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = StationAddress() when network interface not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); + if (State1 =3D=3D EfiSimpleNetworkStopped) { - Status =3D SnpInterface->Stop (SnpInterface);=20 + Status =3D SnpInterface->Stop (SnpInterface); if (EFI_ERROR(Status)){ return Status; } @@ -1067,30 +1029,25 @@ BBTestStatisticsConformanceTest ( // Call Statistics() function while network interface is not started. // Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D=3D= EfiSimpleNetworkStopped)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((Status =3D=3D EFI_NOT_STARTED) && (SnpInterface->Mode->State =3D= =3D EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid014, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() while network interface not started.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid014, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() while network interface not started.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Assertion Point 5.8.2.2 @@ -1102,30 +1059,25 @@ BBTestStatisticsConformanceTest ( } =20 Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_DEVICE_ERROR) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_DEVICE_ERROR) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid015, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() while network interface is not initialized.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid015, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() while network interface is not initialized.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Assertion Point 5.8.2.3 @@ -1143,30 +1095,25 @@ BBTestStatisticsConformanceTest ( StatisticsSize =3D 0; =20 Status =3D SnpInterface->Statistics (SnpInterface, FALSE, &StatisticsS= ize, &StatisticsTable); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"Statistics isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestConformanceAssertionGuid017, - L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Sta= tistics() with small buffer.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestConformanceAssertionGuid017, + L"EFI_SIMPLE_NETWORK_PROTOCOL.Statistics - Invoke Stat= istics() with small buffer.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 // // Restore SNP State @@ -1182,7 +1129,7 @@ BBTestStatisticsConformanceTest ( return Status; } } - =20 + return EFI_SUCCESS; } =20 @@ -1267,7 +1214,7 @@ BBTestMCastIpToMacConformanceTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Restore SNP status // @@ -1405,7 +1352,7 @@ BBTestNVDataConformanceTest ( =20 StatusBuf[0] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamAccessSize, Buffer); CheckPoint1State =3D SnpInterface->Mode->State; - =20 + =20 // // Assertion Point 5.10.2.2 @@ -1425,119 +1372,99 @@ BBTestNVDataConformanceTest ( // Check Point A: "Offset" not be a multiple of NvRamAccessSize // StatusBuf[1] =3D SnpInterface->NvData (SnpInterface, TRUE, (SnpInterfa= ce->Mode->NvRamAccessSize/2), SnpInterface->Mode->NvRamAccessSize, Buffer= ); -=20 + =20 // // Check Point B: "BufferSize" not be a multiple of NvRamAccessSize // StatusBuf[2] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, (SnpInte= rface->Mode->NvRamAccessSize/2), Buffer); -=20 + =20 // // Check Point C: "BufferSize" + "Offset" exceeds "NvRamSize" // - StatusBuf[3] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamSize+100, Buffer);=20 + StatusBuf[3] =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInter= face->Mode->NvRamSize+100, Buffer); =20 =20 - if (StatusBuf[0] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[0] - ); + if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (CheckPoint1State =3D=3D = EfiSimpleNetworkStopped)) { + AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[0] =3D=3D EFI_NOT_STARTED) && (CheckPoint1State =3D=3D= EfiSimpleNetworkStopped)) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[0]) { AssertionType[0] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[0], - gSimpleNetworkBBTestConformanceAssertionGuid020, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) when network interface not start.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); } - - if (StatusBuf[1] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[1] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[0], + gSimpleNetworkBBTestConformanceAssertionGuid020, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= when network interface not start.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); + + if (StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[1]) { AssertionType[1] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[1], - gSimpleNetworkBBTestConformanceAssertionGuid021, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with Offset not be a multiple of NvRamAccessSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[1], + gSimpleNetworkBBTestConformanceAssertionGuid021, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= with Offset not be a multiple of NvRamAccessSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); =20 - if (StatusBuf[2] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[2] - ); + if (StatusBuf[2] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[2] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[2]) { AssertionType[2] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[2], - gSimpleNetworkBBTestConformanceAssertionGuid022, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with BufferSize not be a multiple of NvRamAccessSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[2] - ); } - - if (StatusBuf[3] =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - StatusBuf[3] - ); + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[2], + gSimpleNetworkBBTestConformanceAssertionGuid022, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= with BufferSize not be a multiple of NvRamAccessSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[2] + ); + + if (StatusBuf[3] =3D=3D EFI_INVALID_PARAMETER) { + AssertionType[3] =3D EFI_TEST_ASSERTION_PASSED; } else { - if (StatusBuf[3] =3D=3D EFI_INVALID_PARAMETER) { + if (EFI_UNSUPPORTED =3D=3D StatusBuf[3]) { AssertionType[3] =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType[3] =3D EFI_TEST_ASSERTION_FAILED; } - StandardLib->RecordAssertion ( - StandardLib, - AssertionType[3], - gSimpleNetworkBBTestConformanceAssertionGuid023, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) with BufferSize + Offset exceeds NvRamSize.", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[3] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType[3], + gSimpleNetworkBBTestConformanceAssertionGuid023, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= with BufferSize + Offset exceeds NvRamSize.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[3] + ); =20 // // Restore SNP Status @@ -1552,8 +1479,8 @@ BBTestNVDataConformanceTest ( if (EFI_ERROR(Status)) { return Status; } - }=20 - =20 + } + Status =3D gtBS->FreePool (Buffer); if (EFI_ERROR(Status)) { return Status; @@ -1641,7 +1568,7 @@ BBTestGetStatusConformanceTest ( } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Assertion Point 5.11.2.2 // Call GetStatus () function if network interface not initialized. @@ -1667,7 +1594,7 @@ BBTestGetStatusConformanceTest ( } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } -=20 + /* // // Assertion Point 5.11.2.3 @@ -1696,7 +1623,7 @@ BBTestGetStatusConformanceTest ( AssertionType[2] =3D EFI_TEST_ASSERTION_FAILED; } */ - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[0], @@ -1707,7 +1634,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -1718,7 +1645,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[1] ); -/* =20 +/* StandardLib->RecordAssertion ( StandardLib, AssertionType[2], @@ -1729,7 +1656,7 @@ BBTestGetStatusConformanceTest ( (UINTN)__LINE__, StatusBuf[2] ); -*/ =20 +*/ // // Restore SNP State // @@ -1902,7 +1829,7 @@ BBTestTransmitConformanceTest ( } else { AssertionType[4] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + =20 // // Check Point D: HeaderSize is nonzero and DestAddr is NULL. @@ -1913,7 +1840,7 @@ BBTestTransmitConformanceTest ( } else { AssertionType[5] =3D EFI_TEST_ASSERTION_FAILED; } -=20 + =20 // // Check Point E: HeaderSize is nonzero and Protocol is NULL. @@ -1935,7 +1862,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -1945,7 +1872,7 @@ BBTestTransmitConformanceTest ( __FILE__, (UINTN)__LINE__, StatusBuf[1] - ); + ); =20 StandardLib->RecordAssertion ( StandardLib, @@ -1957,7 +1884,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[2] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[3], @@ -1978,7 +1905,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[4] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[5], @@ -1989,7 +1916,7 @@ BBTestTransmitConformanceTest ( (UINTN)__LINE__, StatusBuf[5] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[6], @@ -2119,7 +2046,7 @@ BBTestReceiveConformanceTest ( } else { AssertionType[0] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + =20 // // Assertion Point 5.13.2.2 @@ -2136,7 +2063,7 @@ BBTestReceiveConformanceTest ( } else { AssertionType[1] =3D EFI_TEST_ASSERTION_FAILED; } - =20 + // // Assertion Point 5.13.2.3 // Call Receive() function with invalid parameters. @@ -2171,7 +2098,7 @@ BBTestReceiveConformanceTest ( (UINTN)__LINE__, StatusBuf[0] ); - =20 + StandardLib->RecordAssertion ( StandardLib, AssertionType[1], @@ -2208,22 +2135,22 @@ BBTestReceiveConformanceTest ( return Status; } } - =20 + #if 0 // // Assertion Point 5.13.2.4 // No Packet Received in the Network Interface when Receive(). // // We should disable the muticast and broadcast receive filters first.= because - // some muticast or broadcast packets maybe on the LAN=20 + // some muticast or broadcast packets maybe on the LAN // Status =3D SnpInterface->ReceiveFilters ( - SnpInterface,=20 - 0,=20 - EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST | EFI_SIM= PLE_NETWORK_RECEIVE_BROADCAST,=20 - TRUE,=20 - 0,=20 - NULL); + SnpInterface, + 0, + EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST | EFI_SI= MPLE_NETWORK_RECEIVE_BROADCAST, + TRUE, + 0, + NULL); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( StandardLib, @@ -2235,7 +2162,7 @@ BBTestReceiveConformanceTest ( (UINTN)__LINE__, Status ); - return Status; + return Status; } =20 Status =3D EFI_SUCCESS; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/Bla= ckBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/I= HV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c index 98a7cbd8..bbfa9bb6 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTe= st/SimpleNetworkBBTestFunction.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -24,7 +25,7 @@ Abstract: =20 --*/ =20 -#include "SctLib.h" +#include "SctLib.h" #include "SimpleNetworkBBTestMain.h" =20 /** @@ -463,11 +464,14 @@ BBTestResetFunctionTest ( return Status; } =20 - Status =3D SnpInterface->Reset (SnpInterface, FALSE); - AssertionType =3D EFI_TEST_ASSERTION_PASSED; + Status =3D SnpInterface->Reset (SnpInterface, FALSE); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } =20 if ((Mode.State !=3D SnpInterface->Mode->State) || @@ -529,7 +533,11 @@ BBTestResetFunctionTest ( if (Status =3D=3D EFI_SUCCESS) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } StandardLib->RecordAssertion ( StandardLib, @@ -758,14 +766,16 @@ BBTestReceiveFilterFunctionTest ( =20 // Check point B. Disable Specified bit. Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, SupportedF= ilter, FALSE, 0, NULL); - if ((Status =3D=3D EFI_SUCCESS) && ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -775,19 +785,21 @@ BBTestReceiveFilterFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)SnpInterface->Mode->ReceiveFilterSetting + (UINTN)SnpInterface->Mode->ReceiveFilterSetting ); =20 // Check point A. Enable Specified bit. Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, 0, FALSE, 0, NULL); - if ((Status =3D=3D EFI_SUCCESS) && ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) !=3D= 0)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -797,19 +809,21 @@ BBTestReceiveFilterFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)SnpInterface->Mode->ReceiveFilterSetting + (UINTN)SnpInterface->Mode->ReceiveFilterSetting ); =20 // Check point C. Enable and Disable Specified bit together. Status =3D SnpInterface->ReceiveFilters (SnpInterface, SupportedFilt= er, SupportedFilter, FALSE, 0, NULL); - if ((Status =3D=3D EFI_SUCCESS) && ((SnpInterface->Mode->ReceiveFilterSetting & SupportedFilter) =3D=3D= 0)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -819,7 +833,7 @@ BBTestReceiveFilterFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)SnpInterface->Mode->ReceiveFilterSetting + (UINTN)SnpInterface->Mode->ReceiveFilterSetting ); } =20 @@ -844,9 +858,12 @@ BBTestReceiveFilterFunctionTest ( } else if ((Status =3D=3D EFI_INVALID_PARAMETER) && (SnpInterface->M= ode->MaxMCastFilterCount =3D=3D 0)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -856,12 +873,12 @@ BBTestReceiveFilterFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)SnpInterface->Mode->ReceiveFilterSetting, - (UINTN)SnpInterface->Mode->ReceiveFilterMask, - (UINTN)SnpInterface->Mode->MCastFilterCount, - (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], - (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], - (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] + (UINTN)SnpInterface->Mode->ReceiveFilterSetting, + (UINTN)SnpInterface->Mode->ReceiveFilterMask, + (UINTN)SnpInterface->Mode->MCastFilterCount, + (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], + (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], + (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] ); } =20 @@ -869,17 +886,18 @@ BBTestReceiveFilterFunctionTest ( // Assertion Point 4.6.2.3 // Reset multicast receive filters list. // - Status =3D SnpInterface->ReceiveFilters (SnpInterface, 0, 0, TRUE, 0, = NULL); - if ((Status =3D=3D EFI_SUCCESS) && (SnpInterface->Mode->State =3D=3D EfiSimpleNetworkInitialized) && (SnpInterface->Mode->MCastFilterCount =3D=3D 0)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -889,13 +907,13 @@ BBTestReceiveFilterFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)SnpInterface->Mode->ReceiveFilterSetting, - (UINTN)SnpInterface->Mode->ReceiveFilterMask, - (UINTN)SnpInterface->Mode->MCastFilterCount, - (UINTN)Mode.MCastFilterCount, - (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], - (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], - (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] + (UINTN)SnpInterface->Mode->ReceiveFilterSetting, + (UINTN)SnpInterface->Mode->ReceiveFilterMask, + (UINTN)SnpInterface->Mode->MCastFilterCount, + (UINTN)Mode.MCastFilterCount, + (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0], + (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5], + (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0] ); // // Restore SNP State @@ -1012,59 +1030,47 @@ BBTestStationAddressFunctionTest ( // SnpInterface->StationAddress (SnpInterface, FALSE, &BackMacAddress); =20 - if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[0] - ); + if ((StatusBuf[0] =3D=3D EFI_SUCCESS) && + (!CheckPoint1)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[0] =3D=3D EFI_SUCCESS) && - (!CheckPoint1)) { + if ((StatusBuf[0] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[0] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid013, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= ReceiveFilters() to reset its MAC Address and verify interface correctne= ss within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[0] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid013, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = ReceiveFilters() to reset its MAC Address and verify interface correctnes= s within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[0] + ); =20 - if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D=3D= EFI_UNSUPPORTED)) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"StationAddress isn't supported, Status - %r\n", - StatusBuf[1] - ); + if ((StatusBuf[1] =3D=3D EFI_SUCCESS) && + (!CheckPoint2)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((StatusBuf[1] =3D=3D EFI_SUCCESS) && - (!CheckPoint2)) { + if ((StatusBuf[1] =3D=3D EFI_INVALID_PARAMETER) || (StatusBuf[1] =3D= =3D EFI_UNSUPPORTED)) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid014, - L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke= ReceiveFilters() to modify its MAC Address and verify interface correctn= ess within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - StatusBuf[1] - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid014, + L"EFI_SIMPLE_NETWORK_PROTOCOL.StationAddress - Invoke = ReceiveFilters() to modify its MAC Address and verify interface correctne= ss within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + StatusBuf[1] + ); =20 // // Restore SNP State @@ -1181,13 +1187,12 @@ BBTestStatisticsFunctionTest ( (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - if (Status =3D=3D EFI_UNSUPPORTED) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -1218,13 +1223,12 @@ BBTestStatisticsFunctionTest ( (!SctCompareMem (&StatisticsTable1, &StatisticsTable2, sizeof (EFI= _NETWORK_STATISTICS)))) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; - } - - if (Status =3D=3D EFI_UNSUPPORTED) { - AssertionType =3D EFI_TEST_ASSERTION_PASSED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -1358,12 +1362,12 @@ BBTestMCastIpToMacFunctionTest ( __FILE__, (UINTN)__LINE__, Status, - (UINTN)MAC1.Addr[0], - (UINTN)MAC1.Addr[1], - (UINTN)MAC1.Addr[2], - (UINTN)MAC1.Addr[3], - (UINTN)MAC1.Addr[4], - (UINTN)MAC1.Addr[5] + (UINTN)MAC1.Addr[0], + (UINTN)MAC1.Addr[1], + (UINTN)MAC1.Addr[2], + (UINTN)MAC1.Addr[3], + (UINTN)MAC1.Addr[4], + (UINTN)MAC1.Addr[5] ); =20 // @@ -1487,92 +1491,76 @@ BBTestNVDataFunctionTest ( //Check Point A(0, n*NvRamAccessSize) SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); Status =3D SnpInterface->NvData (SnpInterface, TRUE, 0, SnpInterface->= Mode->NvRamSize, Buffer); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_SUCCESS) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid018, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read(0, n*NvRamAccessSize) and verify interface correctness within t= est case", - L"%a:%d:Status - %r, NvRamSize - %d, NvRamAccessSize = - %d", - __FILE__, - (UINTN)__LINE__, - Status, - (UINTN)SnpInterface->Mode->NvRamSize, - (UINTN)SnpInterface->Mode->NvRamAccessSize - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid018, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read(0, n*NvRamAccessSize) and verify interface correctness within te= st case", + L"%a:%d:Status - %r, NvRamSize - %d, NvRamAccessSize -= %d", + __FILE__, + (UINTN)__LINE__, + Status, + (UINTN)SnpInterface->Mode->NvRamSize, + (UINTN)SnpInterface->Mode->NvRamAccessSize + ); =20 //Check Point B(NvRamAccessSize, (n-1)*NvRamAccessSize) SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); Status =3D SnpInterface->NvData (SnpInterface, TRUE, SnpInterface->Mod= e->NvRamAccessSize, (SnpInterface->Mode->NvRamSize - SnpInterface->Mode->= NvRamAccessSize), Buffer); - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_SUCCESS) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid019, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read(NvRamAccessSize, (n-1)*NvRamAccessSize) and verify interface co= rrectness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid019, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read(NvRamAccessSize, (n-1)*NvRamAccessSize) and verify interface cor= rectness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + //Check Point C((n-1)*NvRamAccessSize, NvRamAccessSize) SctSetMem (Buffer, SnpInterface->Mode->NvRamSize, 0x0); Status =3D SnpInterface->NvData (SnpInterface, TRUE, (SnpInterface->Mo= de->NvRamSize - SnpInterface->Mode->NvRamAccessSize), SnpInterface->Mode-= NvRamAccessSize, Buffer);- if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); + if (Status =3D=3D EFI_SUCCESS) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if (Status =3D=3D EFI_SUCCESS) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid020, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to read((n-1)*NvRamAccessSize, NvRamAccessSize) and verify interface co= rrectness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } =20 + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid020, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to read((n-1)*NvRamAccessSize, NvRamAccessSize) and verify interface cor= rectness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + // // Assertion Point 4.10.2.2 // Write NVRam @@ -1599,31 +1587,25 @@ BBTestNVDataFunctionTest ( goto End; } =20 - if (Status =3D=3D EFI_UNSUPPORTED) { - StandardLib->RecordMessage( - StandardLib, - EFI_VERBOSE_LEVEL_QUIET, - L"NvData isn't supported, Status - %r\n", - Status - ); + if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (Buffer, Buffer1, S= npInterface->Mode->NvRamSize))) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { - if ((Status =3D=3D EFI_SUCCESS) && (!SctCompareMem (Buffer, Buffer1,= SnpInterface->Mode->NvRamSize))) { + if (EFI_UNSUPPORTED =3D=3D Status) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } else { AssertionType =3D EFI_TEST_ASSERTION_FAILED; } - - StandardLib->RecordAssertion ( - StandardLib, - AssertionType, - gSimpleNetworkBBTestFunctionAssertionGuid021, - L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData(= ) to write and verify interface correctness within test case", - L"%a:%d:Status - %r", - __FILE__, - (UINTN)__LINE__, - Status - ); } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gSimpleNetworkBBTestFunctionAssertionGuid021, + L"EFI_SIMPLE_NETWORK_PROTOCOL.NvData - Invoke NvData()= to write and verify interface correctness within test case", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); =20 End: // @@ -1919,7 +1901,7 @@ BBTestGetStatusFunctionTest ( (UINTN)__LINE__, Status, Status1, - (UINTN)InterruptStatus + (UINTN)InterruptStatus ); } =20 @@ -2322,9 +2304,14 @@ BBTestReceiveFunctionTest ( NULL ); if (EFI_ERROR(Status)) { + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, - EFI_TEST_ASSERTION_FAILED, + AssertionType, gTestGenericFailureGuid, L"EFI_SIMPLE_NETWORK_PROTOCOL.Receive - Enable Receiv= eFilters", L"%a:%d:Status - %r", --=20 2.32.0.windows.1
|
|
[edk2-test][PATCH v1] uefi-sct/SctPkg: Allow SimpleTextOut SetMode to return EFI_UNSUPPORTED
Sunny Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3738
The SimpleTestOut test cases don't allow SetMode to return EFI_UNSUPPORTED, which doesn't comply with UEFI spec. UEFI spec allows EFI_SIMPLE_TEXT_OUT_PROTOCOL.SetMode function to return EFI_UNSUPPORTED for the condition below: if the output devices support 80x50, that is defined to be mode 1. All other text dimensions supported by the device will follow as modes 2 and above. If an output device supports modes 2 and above, but does not support 80x50, then querying for mode 1 will return EFI_UNSUPPORTED. Therefore, update the test cases to fix this issue. Cc: G Edhaya Chandran <edhaya.chandran@...> Cc: Barton Gao <gaojie@...> Cc: Carolyn Gjertsen <Carolyn.Gjertsen@...> Cc: Heinrich Schuchardt <heinrich.schuchardt@...> Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@...> Signed-off-by: Sunny Wang <sunny.wang@...> --- .../SimpleTextOutBBTestConformance_efi.c | 13 +- .../SimpleTextOutBBTestConformance_uefi.c | 15 +- .../SimpleTextOutBBTestFunction_efi.c | 46 +- .../SimpleTextOutBBTestFunction_uefi.c | 349 +++++---- .../SimpleTextOutBBTestConformance_uefi.c | 15 +- .../SimpleTextOutBBTestFunction_uefi.c | 715 +++++++++--------- 6 files changed, 623 insertions(+), 530 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestConformance_efi.c b/uefi-sct/SctPkg/TestCase= /UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestConforma= nce_efi.c index 8b8c3f86..d3861e3c 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_efi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_efi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -761,7 +762,11 @@ BBTestSetCursorPositionConformanceAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestConformance_uefi.c b/uefi-sct/SctPkg/TestCas= e/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestConform= ance_uefi.c index 99e14d7b..555f78e7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_uefi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -82,7 +83,7 @@ BBTestQueryModeConformanceAutoTest ( ); return Status; } - =20 + SimpleOut =3D (EFI_SIMPLE_TEXT_OUT_PROTOCOL *)ClientInterface; =20 // @@ -759,7 +760,11 @@ BBTestSetCursorPositionConformanceAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestFunction_efi.c b/uefi-sct/SctPkg/TestCase/UE= FI/EFI/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_ef= i.c index c370ea91..375e73df 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_efi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_efi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -647,7 +648,11 @@ BBTestResetFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3150,7 +3155,11 @@ BBTestSetModeFunctionManualTest ( // Return status check // if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } else { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } @@ -3177,7 +3186,6 @@ BBTestSetModeFunctionManualTest ( } else { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } - StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3989,7 +3997,11 @@ BBTestSetAttributeFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -4547,7 +4559,11 @@ BBTestClearScreenFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -5062,7 +5078,11 @@ BBTestSetCursorPositionFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -5155,7 +5175,7 @@ BBTestSetCursorPositionFunctionAutoTest ( BackupMode (SimpleOut, &ModeExpected); =20 // - // Set cursor position to (IndexRow * IndexColumn) + // Set cursor position to (IndexRow * IndexColumn) // Status =3D SimpleOut->SetCursorPosition (SimpleOut, IndexColumn,= IndexRow); =20 @@ -5818,7 +5838,11 @@ BBTestEnableCursorFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestFunction_uefi.c b/uefi-sct/SctPkg/TestCase/U= EFI/EFI/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_u= efi.c index a833498c..aeee04c2 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_uefi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -50,7 +51,7 @@ BBTestResetFunctionManualTest ( EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; EFI_SIMPLE_TEXT_OUT_PROTOCOL *SimpleOut; - =20 + EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_TEXT_OUTPUT_MODE ModeOrg, ModeExpected; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; @@ -146,7 +147,7 @@ BBTestResetFunctionManualTest ( // SctPrint (L"\n\rVGA Reset without extended verification start...\n\r")= ; WaitTimeOrKey (5); - =20 + // // Prepare expected Mode after call Reset. // @@ -272,12 +273,12 @@ BBTestResetFunctionManualTest ( L" Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -455,7 +456,11 @@ BBTestResetFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -582,12 +587,12 @@ BBTestResetFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -987,18 +992,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1217,18 +1222,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1626,18 +1631,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1897,18 +1902,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -2433,18 +2438,18 @@ BBTestQueryModeFunctionAutoTest ( __FILE__, (UINTN)__LINE__, Index, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 if ( EFI_UNSUPPORTED =3D=3D Status && 1 =3D=3D Index ) { @@ -2738,7 +2743,11 @@ BBTestSetModeFunctionManualTest ( // Return status check // if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } else { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } @@ -2968,18 +2977,18 @@ BBTestSetModeFunctionAutoTest ( __FILE__, (UINTN)__LINE__, Index, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -3003,7 +3012,7 @@ BBTestSetModeFunctionAutoTest ( ); =20 } - =20 + Status =3D RestoreMode (SimpleOut, &ModeOrg, StandardLib); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( @@ -3152,17 +3161,17 @@ BBTestSetAttributeFunctionManualTest ( for (IndexFore =3D 0; IndexFore < 16; IndexFore++) { =20 Attribute =3D EFI_TEXT_ATTR(IndexFore, IndexBack); - =20 + BackupMode (SimpleOut, &ModeExpected); ModeExpected.Attribute =3D (INT32)Attribute; - =20 + Status =3D SimpleOut->SetAttribute (SimpleOut, Attribute); - =20 + // // Wait for some time to change next background color // gtBS->Stall (100000); - =20 + if (EFI_ERROR(Status)) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordAssertion ( @@ -3206,7 +3215,7 @@ BBTestSetAttributeFunctionManualTest ( (UINTN)ModeExpected.Attribute, (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; =09 + Result =3D FALSE; } } } @@ -3388,7 +3397,11 @@ BBTestSetAttributeFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3434,7 +3447,7 @@ BBTestSetAttributeFunctionAutoTest ( Status, Attribute ); - Result =3D FALSE; + Result =3D FALSE; } if (EFI_ERROR(Status)) { continue; @@ -3464,12 +3477,12 @@ BBTestSetAttributeFunctionAutoTest ( (UINTN)ModeExpected.Attribute, (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; + Result =3D FALSE; } } } =20 - if ( Result =3D=3D TRUE ) { + if ( Result =3D=3D TRUE ) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; StandardLib->RecordAssertion ( StandardLib, @@ -3629,7 +3642,7 @@ BBTestClearScreenFunctionManualTest ( // BackupMode (SimpleOut, &ModeExpected); ModeExpected.CursorRow =3D 0; - ModeExpected.CursorColumn =3D 0; =20 + ModeExpected.CursorColumn =3D 0; =20 // // Clear screen with current background color @@ -3846,7 +3859,11 @@ BBTestClearScreenFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3896,18 +3913,18 @@ BBTestClearScreenFunctionAutoTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -3929,7 +3946,7 @@ BBTestClearScreenFunctionAutoTest ( Status ); } - =20 + Status =3D RestoreMode (SimpleOut, &ModeOrg, StandardLib); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( @@ -4158,7 +4175,7 @@ BBTestSetCursorPositionFunctionManualTest ( ); Result =3D FALSE; } - =20 + // // Returned status check // @@ -4177,7 +4194,7 @@ BBTestSetCursorPositionFunctionManualTest ( IndexRow ); Result =3D FALSE; - }=20 + } // // Wait for a little time // @@ -4362,7 +4379,11 @@ BBTestSetCursorPositionFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -4414,7 +4435,7 @@ BBTestSetCursorPositionFunctionAutoTest ( BackupMode (SimpleOut, &ModeExpected); =20 // - // Set cursor position to (IndexRow * IndexColumn) + // Set cursor position to (IndexRow * IndexColumn) // Status =3D SimpleOut->SetCursorPosition (SimpleOut, IndexColumn,= IndexRow); =20 @@ -4447,7 +4468,7 @@ BBTestSetCursorPositionFunctionAutoTest ( (UINTN)ModeExpected.Attribute, (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; + Result =3D FALSE; } =20 // @@ -4467,7 +4488,7 @@ BBTestSetCursorPositionFunctionAutoTest ( IndexColumn, IndexRow ); - Result =3D FALSE; + Result =3D FALSE; } } } @@ -4501,7 +4522,7 @@ BBTestSetCursorPositionFunctionAutoTest ( Status ); } - =20 + return Status; } =20 @@ -4739,18 +4760,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); } else { // @@ -4888,18 +4909,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); } else { // @@ -4931,7 +4952,7 @@ BBTestEnableCursorFunctionManualTest ( Status ); } - =20 + return Status; } =20 @@ -5058,7 +5079,11 @@ BBTestEnableCursorFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -5212,18 +5237,18 @@ BBTestEnableCursorFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxM= ode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 =20 @@ -5254,6 +5279,6 @@ BBTestEnableCursorFunctionAutoTest ( Status ); } - =20 + return Status; } diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestConformance_uefi.c b/uefi-sct/SctPkg/TestCas= e/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestConform= ance_uefi.c index 99e14d7b..555f78e7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestConformance_uefi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -82,7 +83,7 @@ BBTestQueryModeConformanceAutoTest ( ); return Status; } - =20 + SimpleOut =3D (EFI_SIMPLE_TEXT_OUT_PROTOCOL *)ClientInterface; =20 // @@ -759,7 +760,11 @@ BBTestSetCursorPositionConformanceAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/Bla= ckBoxTest/SimpleTextOutBBTestFunction_uefi.c b/uefi-sct/SctPkg/TestCase/U= EFI/IHV/Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_u= efi.c index 93fd5d75..b27722c4 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextOut/BlackBoxTe= st/SimpleTextOutBBTestFunction_uefi.c @@ -2,15 +2,16 @@ =20 Copyright 2006 - 2016 Unified EFI, Inc.<BR> Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2022, ARM Limited. All rights reserved.<BR> =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the = BSD License - which accompanies this distribution. The full text of the license may= be found at=20 + which accompanies this distribution. The full text of the license may= be found at http://opensource.org/licenses/bsd-license.php -=20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. -=20 + **/ /*++ =20 @@ -50,7 +51,7 @@ BBTestResetFunctionManualTest ( EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; EFI_STATUS Status; EFI_SIMPLE_TEXT_OUT_PROTOCOL *SimpleOut; - =20 + EFI_TEST_ASSERTION AssertionType; EFI_SIMPLE_TEXT_OUTPUT_MODE ModeOrg, ModeExpected; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; @@ -146,7 +147,7 @@ BBTestResetFunctionManualTest ( // SctPrint (L"\n\rVGA Reset without extended verification start...\n\r")= ; WaitTimeOrKey (5); - =20 + // // Prepare expected Mode after call Reset. // @@ -176,12 +177,12 @@ BBTestResetFunctionManualTest ( L" Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -272,12 +273,12 @@ BBTestResetFunctionManualTest ( L" Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -455,7 +456,11 @@ BBTestResetFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -505,12 +510,12 @@ BBTestResetFunctionAutoTest ( L"Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -582,12 +587,12 @@ BBTestResetFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), MaxMode=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.MaxMode + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.MaxMode ); =20 // @@ -850,18 +855,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -987,18 +992,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1094,18 +1099,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1217,18 +1222,18 @@ BBTestOutputStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1469,18 +1474,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1626,18 +1631,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1754,18 +1759,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -1897,18 +1902,18 @@ BBTestOutputStringFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -2240,18 +2245,18 @@ BBTestTestStringFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMod= e=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -2433,18 +2438,18 @@ BBTestQueryModeFunctionAutoTest ( __FILE__, (UINTN)__LINE__, Index, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 if ( EFI_UNSUPPORTED =3D=3D Status && 1 =3D=3D Index ) { @@ -2720,25 +2725,29 @@ BBTestSetModeFunctionManualTest ( __FILE__, (UINTN)__LINE__, Index, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // // Return status check // if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } else { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } @@ -2968,25 +2977,29 @@ BBTestSetModeFunctionAutoTest ( __FILE__, (UINTN)__LINE__, Index, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // // Return status check // if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } } else { AssertionType =3D EFI_TEST_ASSERTION_PASSED; } @@ -3003,7 +3016,7 @@ BBTestSetModeFunctionAutoTest ( ); =20 } - =20 + Status =3D RestoreMode (SimpleOut, &ModeOrg, StandardLib); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( @@ -3152,17 +3165,17 @@ BBTestSetAttributeFunctionManualTest ( for (IndexFore =3D 0; IndexFore < 16; IndexFore++) { =20 Attribute =3D EFI_TEXT_ATTR(IndexFore, IndexBack); - =20 + BackupMode (SimpleOut, &ModeExpected); ModeExpected.Attribute =3D (INT32)Attribute; - =20 + Status =3D SimpleOut->SetAttribute (SimpleOut, Attribute); - =20 + // // Wait for some time to change next background color // gtBS->Stall (100000); - =20 + if (EFI_ERROR(Status)) { AssertionType =3D EFI_TEST_ASSERTION_FAILED; StandardLib->RecordAssertion ( @@ -3193,20 +3206,20 @@ BBTestSetAttributeFunctionManualTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, = MaxMode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; =09 + Result =3D FALSE; } } } @@ -3388,7 +3401,11 @@ BBTestSetAttributeFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3434,7 +3451,7 @@ BBTestSetAttributeFunctionAutoTest ( Status, Attribute ); - Result =3D FALSE; + Result =3D FALSE; } if (EFI_ERROR(Status)) { continue; @@ -3451,25 +3468,25 @@ BBTestSetAttributeFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d= , MaxMode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; + Result =3D FALSE; } } } =20 - if ( Result =3D=3D TRUE ) { + if ( Result =3D=3D TRUE ) { AssertionType =3D EFI_TEST_ASSERTION_PASSED; StandardLib->RecordAssertion ( StandardLib, @@ -3629,7 +3646,7 @@ BBTestClearScreenFunctionManualTest ( // BackupMode (SimpleOut, &ModeExpected); ModeExpected.CursorRow =3D 0; - ModeExpected.CursorColumn =3D 0; =20 + ModeExpected.CursorColumn =3D 0; =20 // // Clear screen with current background color @@ -3653,18 +3670,18 @@ BBTestClearScreenFunctionManualTest ( L" Expected: Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -3846,7 +3863,11 @@ BBTestClearScreenFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -3896,18 +3917,18 @@ BBTestClearScreenFunctionAutoTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -3929,7 +3950,7 @@ BBTestClearScreenFunctionAutoTest ( Status ); } - =20 + Status =3D RestoreMode (SimpleOut, &ModeOrg, StandardLib); if (EFI_ERROR(Status)) { StandardLib->RecordAssertion ( @@ -4143,22 +4164,22 @@ BBTestSetCursorPositionFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, M= axMode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); Result =3D FALSE; } - =20 + // // Returned status check // @@ -4177,7 +4198,7 @@ BBTestSetCursorPositionFunctionManualTest ( IndexRow ); Result =3D FALSE; - }=20 + } // // Wait for a little time // @@ -4362,7 +4383,11 @@ BBTestSetCursorPositionFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -4414,7 +4439,7 @@ BBTestSetCursorPositionFunctionAutoTest ( BackupMode (SimpleOut, &ModeExpected); =20 // - // Set cursor position to (IndexRow * IndexColumn) + // Set cursor position to (IndexRow * IndexColumn) // Status =3D SimpleOut->SetCursorPosition (SimpleOut, IndexColumn,= IndexRow); =20 @@ -4434,20 +4459,20 @@ BBTestSetCursorPositionFunctionAutoTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d,= MaxMode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); - Result =3D FALSE; + Result =3D FALSE; } =20 // @@ -4467,7 +4492,7 @@ BBTestSetCursorPositionFunctionAutoTest ( IndexColumn, IndexRow ); - Result =3D FALSE; + Result =3D FALSE; } } } @@ -4501,7 +4526,7 @@ BBTestSetCursorPositionFunctionAutoTest ( Status ); } - =20 + return Status; } =20 @@ -4669,18 +4694,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -4739,18 +4764,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); } else { // @@ -4803,18 +4828,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 // @@ -4888,18 +4913,18 @@ BBTestEnableCursorFunctionManualTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); } else { // @@ -4931,7 +4956,7 @@ BBTestEnableCursorFunctionManualTest ( Status ); } - =20 + return Status; } =20 @@ -5058,7 +5083,11 @@ BBTestEnableCursorFunctionAutoTest ( // Status =3D SimpleOut->SetMode (SimpleOut, Mode); if (EFI_ERROR(Status)) { - AssertionType =3D EFI_TEST_ASSERTION_FAILED; + if (EFI_UNSUPPORTED =3D=3D Status) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } StandardLib->RecordAssertion ( StandardLib, AssertionType, @@ -5128,18 +5157,18 @@ BBTestEnableCursorFunctionAutoTest ( L"Expected:Cursor Position(%d x %d), Mode=3D%d, MaxMo= de=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 AssertionType =3D EFI_TEST_ASSERTION_PASSED; @@ -5212,18 +5241,18 @@ BBTestEnableCursorFunctionAutoTest ( L" Expected:Cursor Position(%d x %d), Mode=3D%d, MaxM= ode=3D%d, Attribute=3D%d, CursorVisible=3D%d.", __FILE__, (UINTN)__LINE__, - (UINTN)SimpleOut->Mode->CursorColumn, - (UINTN)SimpleOut->Mode->CursorRow, - (UINTN)SimpleOut->Mode->Mode, - (UINTN)SimpleOut->Mode->MaxMode, - (UINTN)SimpleOut->Mode->Attribute, - (UINTN)SimpleOut->Mode->CursorVisible, - (UINTN)ModeExpected.CursorColumn, - (UINTN)ModeExpected.CursorRow, - (UINTN)ModeExpected.Mode, - (UINTN)ModeExpected.MaxMode, - (UINTN)ModeExpected.Attribute, - (UINTN)ModeExpected.CursorVisible + (UINTN)SimpleOut->Mode->CursorColumn, + (UINTN)SimpleOut->Mode->CursorRow, + (UINTN)SimpleOut->Mode->Mode, + (UINTN)SimpleOut->Mode->MaxMode, + (UINTN)SimpleOut->Mode->Attribute, + (UINTN)SimpleOut->Mode->CursorVisible, + (UINTN)ModeExpected.CursorColumn, + (UINTN)ModeExpected.CursorRow, + (UINTN)ModeExpected.Mode, + (UINTN)ModeExpected.MaxMode, + (UINTN)ModeExpected.Attribute, + (UINTN)ModeExpected.CursorVisible ); =20 =20 @@ -5254,6 +5283,6 @@ BBTestEnableCursorFunctionAutoTest ( Status ); } - =20 + return Status; } --=20 2.32.0.windows.1
|
|