oem_ibm: Add Slot enable infrastructure in BMC
With this commit PDRs are created for each of these
PCIe slots and adapters which have a corresponding
entry in the entity associate map. The sensor/effector
states are monitored and accordingly D-Bus calls are
sent for enabling a slot, process property change
of a PCIe slot, etc.
Tested By: SIMICS power on/off and reset reload.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I51b79b75c909ddf2cc29872fec6aa01c2d56b418
diff --git a/libpldmresponder/meson.build b/libpldmresponder/meson.build
index 2e0ed5a..cf6ecf5 100644
--- a/libpldmresponder/meson.build
+++ b/libpldmresponder/meson.build
@@ -54,6 +54,7 @@
'../oem/ibm/libpldmresponder/oem_ibm_handler.cpp',
'../oem/ibm/libpldmresponder/inband_code_update.cpp',
'../oem/ibm/requester/dbus_to_file_handler.cpp',
+ '../oem/ibm/libpldmresponder/collect_slot_vpd.cpp',
'../oem/ibm/libpldmresponder/file_io_type_progress_src.cpp',
'../oem/ibm/libpldmresponder/file_io_type_vpd.cpp',
'../oem/ibm/libpldmresponder/file_io_type_pcie.cpp',
diff --git a/libpldmresponder/oem_handler.hpp b/libpldmresponder/oem_handler.hpp
index bd65dd2..8215b37 100644
--- a/libpldmresponder/oem_handler.hpp
+++ b/libpldmresponder/oem_handler.hpp
@@ -22,8 +22,10 @@
*
* @param[in] entityType - entity type corresponding to the sensor
* @param[in] entityInstance - entity instance number
+ * @param[in] entityContainerID - container id
* @param[in] stateSetId - state set id
* @param[in] compSensorCnt - composite sensor count
+ * @param[in] sensorId - sensor ID
* @param[out] stateField - The state field data for each of the states,
* equal to composite sensor count in number
*
@@ -34,8 +36,9 @@
virtual int getOemStateSensorReadingsHandler(
pldm::pdr::EntityType entityType,
pldm::pdr::EntityInstance entityInstance,
+ pldm::pdr::ContainerID entityContainerId,
pldm::pdr::StateSetId stateSetId,
- pldm::pdr::CompositeCount compSensorCnt,
+ pldm::pdr::CompositeCount compSensorCnt, uint16_t sensorId,
std::vector<get_sensor_state_field>& stateField) = 0;
/** @brief Interface to set the effecter requested by pldm requester
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 0a0de64..d04bb1e 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -789,13 +789,15 @@
uint16_t entityType{};
uint16_t entityInstance{};
uint16_t stateSetId{};
+ uint16_t containerId{};
if (isOemStateSensor(*this, sensorId, sensorRearmCount, comSensorCnt,
- entityType, entityInstance, stateSetId) &&
- oemPlatformHandler != nullptr && !sensorDbusObjMaps.contains(sensorId))
+ entityType, entityInstance, stateSetId, containerId) &&
+ oemPlatformHandler && !sensorDbusObjMaps.contains(sensorId))
{
rc = oemPlatformHandler->getOemStateSensorReadingsHandler(
- entityType, entityInstance, stateSetId, comSensorCnt, stateField);
+ entityType, entityInstance, containerId, stateSetId, comSensorCnt,
+ sensorId, stateField);
}
else
{
@@ -835,7 +837,7 @@
bool isOemStateSensor(Handler& handler, uint16_t sensorId,
uint8_t sensorRearmCount, uint8_t& compSensorCnt,
uint16_t& entityType, uint16_t& entityInstance,
- uint16_t& stateSetId)
+ uint16_t& stateSetId, uint16_t& containerId)
{
pldm_state_sensor_pdr* pdr = nullptr;
@@ -868,6 +870,7 @@
}
auto tmpEntityType = pdr->entity_type;
auto tmpEntityInstance = pdr->entity_instance;
+ auto tmpEntityContainerId = pdr->container_id;
auto tmpCompSensorCnt = pdr->composite_sensor_count;
auto tmpPossibleStates =
reinterpret_cast<state_sensor_possible_states*>(
@@ -892,6 +895,7 @@
entityInstance = tmpEntityInstance;
stateSetId = tmpStateSetId;
compSensorCnt = tmpCompSensorCnt;
+ containerId = tmpEntityContainerId;
return true;
}
else
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index 97e5aa5..6c30c52 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -529,6 +529,7 @@
* @param[out] entityType - entity type
* @param[out] entityInstance - entity instance number
* @param[out] stateSetId - state set id
+ * @param[out] containerId - container id
*
* @return true if the sensor is OEM. All out parameters are invalid
* for a non OEM sensor
@@ -536,7 +537,7 @@
bool isOemStateSensor(Handler& handler, uint16_t sensorId,
uint8_t sensorRearmCount, uint8_t& compSensorCnt,
uint16_t& entityType, uint16_t& entityInstance,
- uint16_t& stateSetId);
+ uint16_t& stateSetId, uint16_t& containerId);
/** @brief Function to check if an effecter falls in OEM range
* An effecter is considered to be oem if either of entity