summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2019-03-26 16:23:43 -0700
committerTom Joseph <tomjoseph@in.ibm.com>2019-04-01 11:28:59 +0000
commite8d43235a3318831053a9d13f6b8ffe2a65088a9 (patch)
tree5d0ee29254e667c4856b39a2c9f84cfac1e5ba4c
parentb0ab5fe80b7d5ce601550638bd836267dc878da9 (diff)
downloadphosphor-host-ipmid-e8d43235a3318831053a9d13f6b8ffe2a65088a9.zip
phosphor-host-ipmid-e8d43235a3318831053a9d13f6b8ffe2a65088a9.tar.gz
allow legacy handlers to register with groupoem extension
DCMI uses the group oem extension 0xdc. The legacy registration allowed for registering with the group extension netfn and did nothing with the actual group extension ID. This change makes the assumption that all legacy group extension registrations are dcmi and registers them as such with the new group handler machinery. Tested-by: Run ipmitool dcmi discover and see it show information Change-Id: I862ba212a7fe2e2dad83d6c9f22e7d1a48b7d406 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
-rw-r--r--ipmid-new.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index 5741842..2668157 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -21,6 +21,7 @@
#include <algorithm>
#include <any>
+#include <dcmihandler.hpp>
#include <exception>
#include <filesystem>
#include <forward_list>
@@ -482,7 +483,19 @@ void ipmi_register_callback(ipmi_netfn_t netFn, ipmi_cmd_t cmd,
realPriv = ipmi::Privilege::Admin;
break;
}
- ipmi::impl::registerHandler(ipmi::prioOpenBmcBase, netFn, cmd, realPriv, h);
+ // The original ipmi_register_callback allowed for group OEM handlers
+ // to be registered via this same interface. It just so happened that
+ // all the handlers were part of the DCMI group, so default to that.
+ if (netFn == NETFUN_GRPEXT)
+ {
+ ipmi::impl::registerGroupHandler(ipmi::prioOpenBmcBase,
+ dcmi::groupExtId, cmd, realPriv, h);
+ }
+ else
+ {
+ ipmi::impl::registerHandler(ipmi::prioOpenBmcBase, netFn, cmd, realPriv,
+ h);
+ }
}
namespace oem
OpenPOWER on IntegriCloud