:p
atchew
Login
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4522 "if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) {" will not be executed in current code, put it within "case SysInterfaceKcs:" to avoid this issue. M: Isaac Oram <isaac.w.oram@intel.com> M: Nate DeSimone <nathaniel.l.desimone@intel.com> R: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yanbo Huang <yanbo.huang@intel.com> --- .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 36 ++++++++---------- .../GenericIpmi/Pei/PeiGenericIpmi.c | 36 ++++++++---------- .../GenericIpmi/Smm/SmmGenericIpmi.c | 38 +++++++++---------- 3 files changed, 49 insertions(+), 61 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( &mIpmiInstance->IpmiTransport2.Interface.Ssif.SsifInterfaceApiGuid ); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( &mIpmiInstance->IpmiTransport2.Interface.Ipmb.IpmbInterfaceApiGuid ); } - - break; - } + } + break; default: break; diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c @@ -XXX,XX +XXX,XX @@ PeiInitializeIpmiKcsPhysicalLayer ( // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2Ppi.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ PeiInitializeIpmiKcsPhysicalLayer ( mIpmiInstance->IpmiTransport2Ppi.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = RegisterPpiCallback (PeiServices, &mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.SsifInterfaceApiGuid); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = RegisterPpiCallback (PeiServices, &mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.IpmbInterfaceApiGuid); } - - break; - } + } + break; default: break; diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c @@ -XXX,XX +XXX,XX @@ SmmNotifyCallback ( &mIpmiInstance->IpmiTransport2 ); } - + ASSERT_EFI_ERROR (Status); return EFI_SUCCESS; } @@ -XXX,XX +XXX,XX @@ Returns: // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ Returns: mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = SmmRegisterProtocolCallback (&mIpmiInstance->IpmiTransport2.Interface.Ssif.SsifInterfaceApiGuid); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = SmmRegisterProtocolCallback (&mIpmiInstance->IpmiTransport2.Interface.Ipmb.IpmbInterfaceApiGuid); } - - break; - } + } + break; default: break; -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108295): https://edk2.groups.io/g/devel/message/108295 Mute This Topic: https://groups.io/mt/101185469/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4522 "if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) {" will not be executed in current code, put it within "case SysInterfaceKcs:" to avoid this issue. Cc: Isaac Oram <isaac.w.oram@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yanbo Huang <yanbo.huang@intel.com> --- .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 36 ++++++++---------- .../GenericIpmi/Pei/PeiGenericIpmi.c | 36 ++++++++---------- .../GenericIpmi/Smm/SmmGenericIpmi.c | 38 +++++++++---------- 3 files changed, 49 insertions(+), 61 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( &mIpmiInstance->IpmiTransport2.Interface.Ssif.SsifInterfaceApiGuid ); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { @@ -XXX,XX +XXX,XX @@ InitializeIpmiKcsPhysicalLayer ( &mIpmiInstance->IpmiTransport2.Interface.Ipmb.IpmbInterfaceApiGuid ); } - - break; - } + } + break; default: break; diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c @@ -XXX,XX +XXX,XX @@ PeiInitializeIpmiKcsPhysicalLayer ( // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2Ppi.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ PeiInitializeIpmiKcsPhysicalLayer ( mIpmiInstance->IpmiTransport2Ppi.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = RegisterPpiCallback (PeiServices, &mIpmiInstance->IpmiTransport2Ppi.Interface.Ssif.SsifInterfaceApiGuid); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = RegisterPpiCallback (PeiServices, &mIpmiInstance->IpmiTransport2Ppi.Interface.Ipmb.IpmbInterfaceApiGuid); } - - break; - } + } + break; default: break; diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c index XXXXXXX..XXXXXXX 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.c @@ -XXX,XX +XXX,XX @@ SmmNotifyCallback ( &mIpmiInstance->IpmiTransport2 ); } - + ASSERT_EFI_ERROR (Status); return EFI_SUCCESS; } @@ -XXX,XX +XXX,XX @@ Returns: // Check interface data initialized successfully else register notify protocol. for (Index = SysInterfaceKcs; Index < SysInterfaceMax; Index++) { switch (Index) { - if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { - case SysInterfaceKcs: + case SysInterfaceKcs: + if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1) { if ((mIpmiInstance->BmcStatus != BMC_HARDFAIL) && (mIpmiInstance->BmcStatus != BMC_UPDATE_IN_PROGRESS)) { BMC_INTERFACE_STATUS BmcStatus; mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitialized; @@ -XXX,XX +XXX,XX @@ Returns: mIpmiInstance->IpmiTransport2.Interface.KcsInterfaceState = IpmiInterfaceInitError; } } + } + break; - break; - } - - if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { - case SysInterfaceBt: + case SysInterfaceBt: + if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Bt.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } + } + break; - break; - } - - if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { - case SysInterfaceSsif: + case SysInterfaceSsif: + if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ssif.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = SmmRegisterProtocolCallback (&mIpmiInstance->IpmiTransport2.Interface.Ssif.SsifInterfaceApiGuid); } + } + break; - break; - } - - if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { - case SysInterfaceIpmb: + case SysInterfaceIpmb: + if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) { if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitialized) { InterfaceState = IpmiInterfaceInitialized; } else if (mIpmiInstance->IpmiTransport2.Interface.Ipmb.InterfaceState == IpmiInterfaceInitError) { // Register protocol notify for SMBUS Protocol. Status = SmmRegisterProtocolCallback (&mIpmiInstance->IpmiTransport2.Interface.Ipmb.IpmbInterfaceApiGuid); } - - break; - } + } + break; default: break; -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108296): https://edk2.groups.io/g/devel/message/108296 Mute This Topic: https://groups.io/mt/101185487/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-