Change "mctp instance id" to "pldm instance id"
It's not a MCTP thing.
Change-Id: I922d28f848c8948d43ea4b8926d2310c8fb50228
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
diff --git a/pldm.cpp b/pldm.cpp
index a30c757..dc7a280 100644
--- a/pldm.cpp
+++ b/pldm.cpp
@@ -390,7 +390,7 @@
CompositeEffecterCount effecterCount,
uint8_t stateIdPos, uint8_t stateSetValue)
{
- if (!getMctpInstanceId())
+ if (!getPldmInstanceId())
{
return std::vector<uint8_t>();
}
@@ -415,7 +415,7 @@
}
}
auto rc = encode_set_state_effecter_states_req(
- mctpInstance.value(), effecterId, effecterCount, stateField.data(),
+ pldmInstanceID.value(), effecterId, effecterCount, stateField.data(),
requestMsg);
if (rc != PLDM_SUCCESS)
{
@@ -519,9 +519,9 @@
}
}
-bool Interface::getMctpInstanceId()
+bool Interface::getPldmInstanceId()
{
- if (!mctpInstance)
+ if (!pldmInstanceID)
{
// Request new instance ID
auto& bus = open_power::occ::utils::getBus();
@@ -534,11 +534,11 @@
auto reply = bus.call(method);
uint8_t newInstanceId;
reply.read(newInstanceId);
- mctpInstance = newInstanceId;
+ pldmInstanceID = newInstanceId;
if (!throttleTraces)
{
log<level::INFO>(std::format("pldm: got new InstanceId: {}",
- mctpInstance.value())
+ pldmInstanceID.value())
.c_str());
}
}
@@ -557,9 +557,9 @@
void Interface::sendPldm(const std::vector<uint8_t>& request,
const uint8_t instance, const bool rspExpected)
{
- if (!mctpInstance)
+ if (!pldmInstanceID)
{
- log<level::ERR>("sendPldm: No MCTP Instance ID found!");
+ log<level::ERR>("sendPldm: No PLDM Instance ID found!");
return;
}
@@ -588,7 +588,7 @@
log<level::INFO>(
std::format(
"sendPldm: calling pldm_send(OCC{}, instance:{}, {} bytes)",
- instance, mctpInstance.value(), request.size())
+ instance, pldmInstanceID.value(), request.size())
.c_str());
}
pldmResponseReceived = false;
@@ -643,7 +643,7 @@
else
{
// Not waiting for response, instance ID should be freed
- mctpInstance = std::nullopt;
+ pldmInstanceID = std::nullopt;
}
pldmClose();
}
@@ -716,10 +716,10 @@
auto pldmIface = static_cast<Interface*>(userData);
- if (!pldmIface->mctpInstance)
+ if (!pldmIface->pldmInstanceID)
{
log<level::ERR>(
- "pldmRspCallback: No outstanding MCTP Instance ID found");
+ "pldmRspCallback: No outstanding PLDM Instance ID found");
return -1;
}
@@ -730,10 +730,10 @@
{
log<level::INFO>(
std::format("pldmRspCallback: calling pldm_recv() instance:{}",
- pldmIface->mctpInstance.value())
+ pldmIface->pldmInstanceID.value())
.c_str());
}
- auto rc = pldm_recv(mctpEid, fd, pldmIface->mctpInstance.value(),
+ auto rc = pldm_recv(mctpEid, fd, pldmIface->pldmInstanceID.value(),
&responseMsg, &responseMsgSize);
int lastErrno = errno;
if (rc)
@@ -767,7 +767,7 @@
}
// instance ID should be freed
- pldmIface->mctpInstance = std::nullopt;
+ pldmIface->pldmInstanceID = std::nullopt;
// Set pointer to autodelete
std::unique_ptr<uint8_t, decltype(std::free)*> responseMsgPtr{responseMsg,
@@ -858,10 +858,10 @@
std::vector<uint8_t> Interface::encodeGetStateSensorRequest(uint8_t instance,
uint16_t sensorId)
{
- if (!getMctpInstanceId())
+ if (!getPldmInstanceId())
{
log<level::ERR>(
- "encodeGetStateSensorRequest: failed to getMctpInstanceId");
+ "encodeGetStateSensorRequest: failed to getPldmInstanceId");
return std::vector<uint8_t>();
}
@@ -871,7 +871,7 @@
std::vector<uint8_t> request(msgSize);
auto msg = reinterpret_cast<pldm_msg*>(request.data());
- auto msgRc = encode_get_state_sensor_readings_req(mctpInstance.value(),
+ auto msgRc = encode_get_state_sensor_readings_req(pldmInstanceID.value(),
sensorId, sRearm, 0, msg);
if (msgRc != PLDM_SUCCESS)
{