Add CPU functional property
ProcessorSummary in bmcweb always shows disable. Because bmcweb depends
on `xyz.openbmc_project.State.Decorator.OperationalStatus` interface
and `Functional` property to return CPU functional state.
In this change, include the interface into smbios-mdr and re-add the
property `Functional` removed by smbios-mdr/+/36177
Tested:
```
GET /redfish/v1/Systems/system/
"ProcessorSummary": {
"CoreCount": 112,
"Count": 2,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
busctl introspect xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
xyz.openbmc_project.State.Decorator.OperationalStatus interface - - -
.Functional property b true emits-change writable
```
Change-Id: I1b4d239ce02d2634a54afb98e4b5e72923fda4fb
Signed-off-by: David Wang <davidwang@quantatw.com>
diff --git a/include/cpu.hpp b/include/cpu.hpp
index 26579a6..20ff0cf 100644
--- a/include/cpu.hpp
+++ b/include/cpu.hpp
@@ -24,6 +24,7 @@
#include <xyz/openbmc_project/Inventory/Decorator/Revision/server.hpp>
#include <xyz/openbmc_project/Inventory/Item/Cpu/server.hpp>
#include <xyz/openbmc_project/Inventory/Item/server.hpp>
+#include <xyz/openbmc_project/State/Decorator/OperationalStatus/server.hpp>
namespace phosphor
{
@@ -43,6 +44,8 @@
using Item = sdbusplus::server::xyz::openbmc_project::inventory::Item;
using association =
sdbusplus::server::xyz::openbmc_project::association::Definitions;
+using operationalStatus = sdbusplus::xyz::openbmc_project::State::Decorator::
+ server::OperationalStatus;
// This table is up to date as of SMBIOS spec DSP0134 3.7.0
static const std::map<uint8_t, const char*> familyTable = {
@@ -305,7 +308,7 @@
class Cpu :
sdbusplus::server::object_t<processor, asset, location, connector, rev,
- Item, association>
+ Item, association, operationalStatus>
{
public:
Cpu() = delete;
@@ -318,7 +321,8 @@
Cpu(sdbusplus::bus_t& bus, const std::string& objPath, const uint8_t& cpuId,
uint8_t* smbiosTableStorage, const std::string& motherboard) :
sdbusplus::server::object_t<processor, asset, location, connector, rev,
- Item, association>(bus, objPath.c_str()),
+ Item, association, operationalStatus>(
+ bus, objPath.c_str()),
cpuNum(cpuId), storage(smbiosTableStorage), motherboardPath(motherboard)
{
infoUpdate(smbiosTableStorage, motherboard);