PEL: Maintenance procedure callout definitions
A maintenance procedure is a short string that resides in the FRU
identity structure in the SRC section of a PEL that maps to a service
procedure in the service documentation.
This commit adds the initial framework for dealing with these by adding
an enum type to specify them, and a pel_values.hpp function to get the
actual string value of the maintenance procedure based on its enum.
A single procedure is created in this commit, NoVPDforFRU, which will
be used in a future commit when the location code, part number, etc,
aren't available when trying to do a callout and so this procedure will
be used instead.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I45f366e98794462c70d851f743e4f497c0af77b4
diff --git a/extensions/openpower-pels/pel_values.cpp b/extensions/openpower-pels/pel_values.cpp
index 7e7f93b..9fb6f05 100644
--- a/extensions/openpower-pels/pel_values.cpp
+++ b/extensions/openpower-pels/pel_values.cpp
@@ -16,6 +16,7 @@
#include "pel_values.hpp"
#include <algorithm>
+#include <cassert>
namespace openpower
{
@@ -24,9 +25,6 @@
namespace pel_values
{
-// Note: The description fields will be filled in as part of the
-// PEL parser work.
-
/**
* The possible values for the subsystem field in the User Header.
*/
@@ -213,6 +211,12 @@
{0x43, "medium_group_c", "Medium Priority C, replace these as a group"},
{0x4C, "low", "Lowest priority replacement"}};
+/**
+ * @brief The possible maintenance procedures.
+ */
+const MaintenanceProcedureValues maintenanceProcedures = {
+ {MaintProcedure::noVPDforFRU, "no_vpd_for_fru", "BMCSP01"}};
+
PELValues::const_iterator findByValue(uint32_t value, const PELValues& fields)
{
return std::find_if(fields.begin(), fields.end(),
@@ -324,6 +328,21 @@
});
return foundValues;
}
+
+MaintenanceProcedureValues::const_iterator
+ getMaintProcedure(MaintProcedure procedure)
+{
+ auto proc =
+ std::find_if(maintenanceProcedures.begin(), maintenanceProcedures.end(),
+ [procedure](const auto& entry) {
+ return std::get<mpEnumPos>(entry) == procedure;
+ });
+
+ assert(proc != maintenanceProcedures.end());
+
+ return proc;
+}
+
} // namespace pel_values
} // namespace pels
} // namespace openpower