summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/pce_identity.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-10-08 14:13:31 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-10-22 14:09:56 +0000
commit5b3a11db9c1f9715cc6371ecdcaa6bc54343ecc0 (patch)
tree5bcf71cb6f215c3c1568f475dbad6ed9b21500a9 /extensions/openpower-pels/pce_identity.cpp
parentced1a2185f3d38ab153cb4050dd074dcdc6a478d (diff)
downloadphosphor-logging-5b3a11db9c1f9715cc6371ecdcaa6bc54343ecc0.tar.gz
phosphor-logging-5b3a11db9c1f9715cc6371ecdcaa6bc54343ecc0.zip
PEL: Power controlling enc SRC substructure
This substructure is part of the callout subsection in the SRC section of a PEL, and contains enclosure information for when another enclosure controls the power of the failing entity. This would be an unusual case, when the piece of hardware that is being called out has its power controlled by another enclosure, for example when an I/O expansion drawer is connected to 2 servers, and only one of them controls its power. This includes: * The enclosure's name * The enclosure's machine type, model, and serial number The BMC will never create this section for BMC errors, but it may need to unflatten them for PELs sent down from a host that has to deal with I/O drawers. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ie04c1ee3fdfa67ee8666c10fa3bc837f4d33a9ef
Diffstat (limited to 'extensions/openpower-pels/pce_identity.cpp')
-rw-r--r--extensions/openpower-pels/pce_identity.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/extensions/openpower-pels/pce_identity.cpp b/extensions/openpower-pels/pce_identity.cpp
new file mode 100644
index 0000000..12b21ae
--- /dev/null
+++ b/extensions/openpower-pels/pce_identity.cpp
@@ -0,0 +1,33 @@
+#include "pce_identity.hpp"
+
+namespace openpower
+{
+namespace pels
+{
+namespace src
+{
+
+PCEIdentity::PCEIdentity(Stream& pel)
+{
+ pel >> _type >> _size >> _flags >> _mtms;
+
+ // Whatever is left is the enclosure name.
+ if (_size < (4 + _mtms.flattenedSize()))
+ {
+ throw std::runtime_error("PCE identity structure size field too small");
+ }
+
+ size_t pceNameSize = _size - (4 + _mtms.flattenedSize());
+
+ _pceName.resize(pceNameSize);
+ pel >> _pceName;
+}
+
+void PCEIdentity::flatten(Stream& pel)
+{
+ pel << _type << _size << _flags << _mtms << _pceName;
+}
+
+} // namespace src
+} // namespace pels
+} // namespace openpower
OpenPOWER on IntegriCloud