Make Terminus ID & Terminus Handle configurable
The current pldm code hardcoded the terminus id and the
terminus handles, making it configurable so that the
oem vendors can set them as per thier need in the
bitbake meta data.
Also,in the current state the FRU record set PDR's and
the Sensor/Effecter PDR's are generated with terminus
handle 0, but the terminus locator PDR is hardcoded with
handle 1. This commit also fixes that behaviour.
Tested :
1. Terminus locator PDR
{
"nextRecordHandle": 89,
"responseCount": 19,
"recordHandle": 88,
"PDRHeaderVersion": 1,
"PDRType": "Terminus Locator PDR",
"recordChangeNumber": 0,
"dataLength": 9,
"PLDMTerminusHandle": 1,
"validity": "valid",
"TID": 1,
"containerID": 0,
"terminusLocatorType": "MCTP_EID",
"terminusLocatorValueSize": 1,
"EID": 8
}
2. FRU record set PDR
{
"nextRecordHandle": 77,
"responseCount": 20,
"recordHandle": 76,
"PDRHeaderVersion": 1,
"PDRType": "FRU Record Set PDR",
"recordChangeNumber": 0,
"dataLength": 10,
"PLDMTerminusHandle": 1,
"FRURecordSetIdentifier": 76,
"entityType": "[Physical] Slot",
"entityInstanceNumber": 12,
"containerID": 3
}
3. Sensor PDR
{
"nextRecordHandle": 208,
"responseCount": 28,
"recordHandle": 207,
"PDRHeaderVersion": 1,
"PDRType": "State Sensor PDR",
"recordChangeNumber": 0,
"dataLength": 18,
"PLDMTerminusHandle": 1,
"sensorID": 2,
"entityType": "[Physical] External Environment",
"entityInstanceNumber": 0,
"containerID": 1,
"sensorInit": "noInit",
"sensorAuxiliaryNamesPDR": false,
"compositeSensorCount": 1,
"stateSetID[0]": "Health State(1)",
"possibleStatesSize[0]": 2,
"possibleStates[0]": [
"Normal(1)",
"Upper Fatal(9)"
]
}
4. Effecter PDR
{
"nextRecordHandle": 142,
"responseCount": 29,
"recordHandle": 141,
"PDRHeaderVersion": 1,
"PDRType": "State Effecter PDR",
"recordChangeNumber": 0,
"dataLength": 19,
"PLDMTerminusHandle": 1,
"effecterID": 53,
"entityType": "[Physical] Fan",
"entityInstanceNumber": 1,
"containerID": 3,
"effecterSemanticID": 0,
"effecterInit": "noInit",
"effecterDescriptionPDR": false,
"compositeEffecterCount": 1,
"stateSetID[0]": "Identify State(17)",
"possibleStatesSize[0]": 1,
"possibleStates[0]": [
"Identify State Unasserted(1)",
"Identify State Asserted(2)"
]
}
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I68d1c5c121b9389cc9b89dde9f1a8d8679b068f1
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 1b4c8f5..7c011fa 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -1,4 +1,3 @@
-
#include "platform.hpp"
#include "libpldm/entity.h"
@@ -16,6 +15,8 @@
#include "platform_state_effecter.hpp"
#include "platform_state_sensor.hpp"
+#include <config.h>
+
using namespace pldm::utils;
using namespace pldm::responder::pdr;
using namespace pldm::responder::pdr_utils;
@@ -596,9 +597,9 @@
pdr->hdr.type = PLDM_TERMINUS_LOCATOR_PDR;
pdr->hdr.record_change_num = 0;
pdr->hdr.length = sizeof(pldm_terminus_locator_pdr) - sizeof(pldm_pdr_hdr);
- pdr->terminus_handle = BmcPldmTerminusHandle;
+ pdr->terminus_handle = TERMINUS_HANDLE;
pdr->validity = PLDM_TL_PDR_VALID;
- pdr->tid = BmcTerminusId;
+ pdr->tid = TERMINUS_ID;
pdr->container_id = 0x0;
pdr->terminus_locator_type = PLDM_TERMINUS_LOCATOR_TYPE_MCTP_EID;
pdr->terminus_locator_value_size =