summaryrefslogtreecommitdiffstats
path: root/user_channel/channel_layer.cpp
diff options
context:
space:
mode:
authorVernon Mauery <vernon.mauery@linux.intel.com>2019-02-15 13:38:52 -0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-04-22 15:19:38 -0700
commit735ee953d0ae274435fb0276415ca7a01a0c3c9d (patch)
tree6569dcf2249c7b81814156d448f1957d7821d97f /user_channel/channel_layer.cpp
parent788362ce51d45977292e34c28c27d03523b14024 (diff)
downloadphosphor-host-ipmid-735ee953d0ae274435fb0276415ca7a01a0c3c9d.tar.gz
phosphor-host-ipmid-735ee953d0ae274435fb0276415ca7a01a0c3c9d.zip
look up channel from D-Bus connection
With a single IPMI execution queue and multiple bridges, it is important for the queue to be able to map the incoming D-Bus message to a channel. Each bridge should request a well-known name of the form "xyz.openbmc_project.Ipmi.Channel.<name>" where name is the name field in the /usr/share/ipmi-providers/channel_config.json file. The mapping is done by registering a name change listener on D-Bus and then doing some name lookups via the D-Bus interface to match well-known names to unique names. Then, each incoming messages comes from a unique-named sender and can be resolved to which channel it came from. For now, any unmapped channels will show up as INTRABMC, which is not ideal, but should not break things until the bridges can be converted to the correct name and D-Bus API. Tested-by: run ipmid, start and stop bridges named xyz.openbmc_project.Ipmi.Channel.<NAME> and see the messages show that a new channel has been mapped. Then, with commands that use the ipmi::Context, the correct channel shows up. Change-Id: I3e6bbfbf2e068020e07eeafe64eb09d70c03dc65 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'user_channel/channel_layer.cpp')
-rw-r--r--user_channel/channel_layer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/user_channel/channel_layer.cpp b/user_channel/channel_layer.cpp
index 34a596d..da9c613 100644
--- a/user_channel/channel_layer.cpp
+++ b/user_channel/channel_layer.cpp
@@ -142,4 +142,8 @@ std::string getChannelName(const uint8_t chNum)
return getChannelConfigObject().getChannelName(chNum);
}
+uint8_t getChannelByName(const std::string& chName)
+{
+ return getChannelConfigObject().getChannelByName(chName);
+}
} // namespace ipmi
OpenPOWER on IntegriCloud