From 24de462a9d931de89426ead8524952e3a2816633 Mon Sep 17 00:00:00 2001 From: Mike Maslenkin Date: Wed, 29 Nov 2023 00:59:38 +0300 Subject: RedfishPkg: add proper initialization of IPMI request All fields of IPMI_CHANNEL_INFO_CHANNEL_NUMBER union must be initialized to avoid error condition on BMC side. Cc: Nickle Wang Cc: Igor Kulchytskyy Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../PlatformHostInterfaceBmcUsbNicLib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'RedfishPkg/Library') diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c index 7f295fe7f1..c73e76df57 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c @@ -616,9 +616,10 @@ HostInterfaceIpmiCheckMacAddress ( } // Initial the get MAC address request. - GetLanConfigReq.SetSelector = 0; - GetLanConfigReq.BlockSelector = 0; - GetLanConfigReq.ParameterSelector = IpmiLanMacAddress; + GetLanConfigReq.ChannelNumber.Uint8 = 0; + GetLanConfigReq.SetSelector = 0; + GetLanConfigReq.BlockSelector = 0; + GetLanConfigReq.ParameterSelector = IpmiLanMacAddress; ExitStatus = EFI_NOT_FOUND; for (ChannelNum = IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_1; @@ -640,6 +641,7 @@ HostInterfaceIpmiCheckMacAddress ( } else { DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " No cached IPMI LAN info\n")); DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Send NetFn = App, Command = 0x42 to channel %d\n", ChannelNum)); + GetChanelInfoRequest.ChannelNumber.Uint8 = 0; GetChanelInfoRequest.ChannelNumber.Bits.ChannelNo = (UINT8)ChannelNum; Status = IpmiGetChannelInfo ( &GetChanelInfoRequest, -- cgit v1.2.3