update oemcommands.hpp to use new API
All the command handler numbers and netfn numbers were done
using the old API. This updates all the enums to be ipmi::Cmd
or ipmi::NetFn types. This improves readability by eliminating
unneeded static_casts and brings the legacy code to the present.
One minor fix, otherwise the code is the same. The call to
registerFilter was passing a netfn instead of a priority. It compiled
but it was incorrect. This updates it to use the correct parameter.
Tested: builds and produces the same binary output (other than the
aforementioned registerFilter fix)
Change-Id: I7e83123245b3f340088f8ec75a31b7611d0ecda0
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/src/smbiosmdrv2handler.cpp b/src/smbiosmdrv2handler.cpp
index 18aff58..52d23ad 100644
--- a/src/smbiosmdrv2handler.cpp
+++ b/src/smbiosmdrv2handler.cpp
@@ -26,6 +26,7 @@
#include <fstream>
#include <ipmid/api.hpp>
#include <ipmid/utils.hpp>
+#include <oemcommands.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/message/types.hpp>
#include <smbiosmdrv2handler.hpp>
@@ -1252,63 +1253,62 @@
{
// MDR V2 Command
// <Get MDRII Status Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_AGENT_STATUS,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIAgentStatus,
ipmi::Privilege::Operator, mdr2AgentStatus);
// <Get MDRII Directory Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_GET_DIR,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIGetDir,
ipmi::Privilege::Operator, mdr2GetDir);
// <Send MDRII Directory Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_SEND_DIR,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIISendDir,
ipmi::Privilege::Operator, mdr2SendDir);
// <Get MDRII Data Info Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_GET_DATA_INFO,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIGetDataInfo,
ipmi::Privilege::Operator, mdr2GetDataInfo);
// <Send MDRII Info Offer>
- ipmi::registerHandler(
- ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_SEND_DATA_INFO_OFFER,
- ipmi::Privilege::Operator, mdr2DataInfoOffer);
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIISendDataInfoOffer,
+ ipmi::Privilege::Operator, mdr2DataInfoOffer);
// <Send MDRII Data Info>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_SEND_DATA_INFO,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIISendDataInfo,
ipmi::Privilege::Operator, mdr2SendDataInfo);
// <Get MDRII Data Block Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_GET_DATA_BLOCK,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIGetDataBlock,
ipmi::Privilege::Operator, mdr2GetDataBlock);
// <Send MDRII Data Block>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_SEND_DATA_BLOCK,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIISendDataBlock,
ipmi::Privilege::Operator, mdr2SendDataBlock);
// <Lock MDRII Data Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_LOCK_DATA,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIILockData,
ipmi::Privilege::Operator, mdr2LockData);
// <Unlock MDRII Data Command>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_UNLOCK_DATA,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIUnlockData,
ipmi::Privilege::Operator, mdr2UnlockData);
// <Send MDRII Data Start>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_DATA_START,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIDataStart,
ipmi::Privilege::Operator, cmd_mdr2_data_start);
// <Send MDRII Data Done>
- ipmi::registerHandler(ipmi::prioOemBase, NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDRII_DATA_DONE,
+ ipmi::registerHandler(ipmi::prioOemBase, ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrIIDataDone,
ipmi::Privilege::Operator, cmd_mdr2_data_done);
}