pfr-manager: add ufmSupport property to PFR.Attributes interface.
Add support to update the ufmSupport property in PFR.Attributes
interface.
Tested:
Command: busctl introspect xyz.openbmc_project.PFR.Manager /xyz/
openbmc_project/pfr
Response:
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
xyz.openbmc_project.PFR.Attributes interface - -
.UfmLocked property b false
.UfmProvisioned property b false
.UfmSupport property b true
Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
Change-Id: I76d9ce70e21c53b85959054155904760b5078782
diff --git a/service/inc/pfr_mgr.hpp b/service/inc/pfr_mgr.hpp
index 13091d7..6f55eb9 100644
--- a/service/inc/pfr_mgr.hpp
+++ b/service/inc/pfr_mgr.hpp
@@ -37,6 +37,7 @@
static constexpr const char* versionStr = "Version";
static constexpr const char* ufmProvisionedStr = "UfmProvisioned";
static constexpr const char* ufmLockedStr = "UfmLocked";
+static constexpr const char* ufmSupportStr = "UfmSupport";
class PfrVersion
{
@@ -80,6 +81,7 @@
bool ufmProvisioned;
bool ufmLocked;
+ bool ufmSupport;
};
} // namespace pfr
diff --git a/service/src/pfr_mgr.cpp b/service/src/pfr_mgr.cpp
index 4d77c0e..479cf5f 100644
--- a/service/src/pfr_mgr.cpp
+++ b/service/src/pfr_mgr.cpp
@@ -116,7 +116,10 @@
pfrCfgIface = server.add_interface("/xyz/openbmc_project/pfr",
"xyz.openbmc_project.PFR.Attributes");
- getProvisioningStatus(ufmLocked, ufmProvisioned);
+ ufmLocked = false;
+ ufmProvisioned = false;
+ ufmSupport = false;
+ getProvisioningStatus(ufmLocked, ufmProvisioned, ufmSupport);
pfrCfgIface->register_property(ufmProvisionedStr, ufmProvisioned,
// Override set
@@ -148,6 +151,21 @@
return 0;
});
+ pfrCfgIface->register_property(ufmSupportStr, ufmSupport,
+ // Override set
+ [this](const bool req, bool propertyValue) {
+ if (internalSet)
+ {
+ if (req != propertyValue)
+ {
+ ufmSupport = req;
+ propertyValue = req;
+ return 1;
+ }
+ }
+ return 0;
+ });
+
pfrCfgIface->initialize();
associationIface =
@@ -163,10 +181,12 @@
{
bool lockVal = false;
bool provVal = false;
- getProvisioningStatus(lockVal, provVal);
+ bool supportVal = false;
+ getProvisioningStatus(lockVal, provVal, supportVal);
internalSet = true;
pfrCfgIface->set_property(ufmProvisionedStr, provVal);
pfrCfgIface->set_property(ufmLockedStr, lockVal);
+ pfrCfgIface->set_property(ufmSupportStr, supportVal);
internalSet = false;
}
return;