Add LUN to the IPMI sensor context structure
Systems monitored by BMCs may have more than 255 sensors. This code
change provides the necessary piece to allow a BMC to support more
than 255 sensors. It does this by adding a variable to store a LUN
value. This allows LUN 0 to manage 255 sensors, and any overflow may
be assigned to LUN 1.
Tested:
Confirmed the following commands still work:
"ipmitool sdr elist"
"ipmitool sensor list"
"ipmitool raw 4 0x20 0"
"ipmitool raw -l 1 4 0x20 0"
Change-Id: I92d5205eac33829d8133f2e38ed96bfc5a9bc033
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index abd0a10..c3eb451 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -542,15 +542,16 @@
}
// check to see if the requested priv/username is valid
log<level::DEBUG>("Set up ipmi context", entry("SENDER=%s", sender.c_str()),
- entry("NETFN=0x%X", netFn), entry("CMD=0x%X", cmd),
- entry("CHANNEL=%u", channel), entry("USERID=%u", userId),
+ entry("NETFN=0x%X", netFn), entry("LUN=0x%X", lun),
+ entry("CMD=0x%X", cmd), entry("CHANNEL=%u", channel),
+ entry("USERID=%u", userId),
entry("SESSIONID=0x%X", sessionId),
entry("PRIVILEGE=%u", static_cast<uint8_t>(privilege)),
entry("RQSA=%x", rqSA));
- auto ctx =
- std::make_shared<ipmi::Context>(getSdBus(), netFn, cmd, channel, userId,
- sessionId, privilege, rqSA, yield);
+ auto ctx = std::make_shared<ipmi::Context>(getSdBus(), netFn, lun, cmd,
+ channel, userId, sessionId,
+ privilege, rqSA, yield);
auto request = std::make_shared<ipmi::message::Request>(
ctx, std::forward<std::vector<uint8_t>>(data));
message::Response::ptr response = executeIpmiCommand(request);
@@ -763,7 +764,7 @@
m.read(seq, netFn, lun, cmd, data);
std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus();
auto ctx = std::make_shared<ipmi::Context>(
- bus, netFn, cmd, 0, 0, 0, ipmi::Privilege::Admin, 0, yield);
+ bus, netFn, lun, cmd, 0, 0, 0, ipmi::Privilege::Admin, 0, yield);
auto request = std::make_shared<ipmi::message::Request>(
ctx, std::forward<std::vector<uint8_t>>(data));
ipmi::message::Response::ptr response =