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/smbioshandler.cpp b/src/smbioshandler.cpp
index 9eebf7f..6e3cff9 100644
--- a/src/smbioshandler.cpp
+++ b/src/smbioshandler.cpp
@@ -471,27 +471,24 @@
{
// MDR V1 Command
// <Get MDR Status Command>
- ipmi_register_callback(NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDR_STATUS, NULL,
+ ipmi_register_callback(ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrStatus, NULL,
cmd_region_status, PRIVILEGE_OPERATOR);
// <Update Complete Status Command>
- ipmi_register_callback(NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDR_COMPLETE, NULL,
+ ipmi_register_callback(ipmi::intel::netFnApp,
+ ipmi::intel::app::cmdMdrComplete, NULL,
cmd_region_complete, PRIVILEGE_OPERATOR);
// <Read MDR Command>
- ipmi_register_callback(NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDR_READ, NULL,
- cmd_region_read, PRIVILEGE_OPERATOR);
+ ipmi_register_callback(ipmi::intel::netFnApp, ipmi::intel::app::cmdMdrRead,
+ NULL, cmd_region_read, PRIVILEGE_OPERATOR);
// <Write MDR Command>
- ipmi_register_callback(NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDR_WRITE, NULL,
- cmd_region_write, PRIVILEGE_OPERATOR);
+ ipmi_register_callback(ipmi::intel::netFnApp, ipmi::intel::app::cmdMdrWrite,
+ NULL, cmd_region_write, PRIVILEGE_OPERATOR);
// <Lock MDR Command>
- ipmi_register_callback(NETFUN_INTEL_APP_OEM,
- IPMI_NETFN_INTEL_OEM_APP_CMD::MDR_LOCK, NULL,
- cmd_region_lock, PRIVILEGE_OPERATOR);
+ ipmi_register_callback(ipmi::intel::netFnApp, ipmi::intel::app::cmdMdrLock,
+ NULL, cmd_region_lock, PRIVILEGE_OPERATOR);
}