ipmid: channel: add max transfer size property
Each channel can have a different maximum transfer size. This should be
exposed so that it is easier to tell how many bytes it is possible to
send or receive on a given channel.
Change-Id: Ie277eb7a802edc1deeefe201a7560d371920f519
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 0ece27e..310ac2b 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -62,6 +62,7 @@
static constexpr const char* nameString = "name";
static constexpr const char* isValidString = "is_valid";
static constexpr const char* activeSessionsString = "active_sessions";
+static constexpr const char* maxTransferSizeString = "max_transfer_size";
static constexpr const char* channelInfoString = "channel_info";
static constexpr const char* mediumTypeString = "medium_type";
static constexpr const char* protocolTypeString = "protocol_type";
@@ -86,6 +87,7 @@
static constexpr const uint8_t defaultAuthType =
static_cast<uint8_t>(EAuthType::none);
static constexpr const bool defaultIsIpmiState = false;
+static constexpr size_t smallChannelSize = 64;
std::unique_ptr<sdbusplus::bus::match_t> chPropertiesSignal(nullptr);
@@ -419,6 +421,11 @@
return channelData[chNum].activeSessCount;
}
+size_t ChannelConfig::getChannelMaxTransferSize(uint8_t chNum)
+{
+ return channelData[chNum].maxTransferSize;
+}
+
ipmi_ret_t ChannelConfig::getChannelInfo(const uint8_t chNum,
ChannelInfo& chInfo)
{
@@ -941,6 +948,8 @@
jsonChData[isValidString].get<bool>();
channelData[chNum].activeSessCount =
jsonChData.value(activeSessionsString, 0);
+ channelData[chNum].maxTransferSize =
+ jsonChData.value(maxTransferSizeString, smallChannelSize);
Json jsonChInfo = jsonChData[channelInfoString].get<Json>();
if (jsonChInfo.is_null())
{