summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-12 11:27:10 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-27 08:06:26 -0600
commitcc3b64aebb1760750888324f116d11a952acd203 (patch)
treefd6bc0c48ed0f0313ea0473bd6bf300294bed8d8 /extensions
parent7d800a4e5d1305fa64ce02b99b0ec522bc454bbd (diff)
downloadphosphor-logging-cc3b64aebb1760750888324f116d11a952acd203.tar.gz
phosphor-logging-cc3b64aebb1760750888324f116d11a952acd203.zip
PEL: Support for the host acking a PEL
After the host firmware successfully transfers a PEL to the OS, it will respond with an 'Ack' command that the PLDM daemon sends over to this daemon via a D-Bus method call. Add support to the HostNotifier class for this. It will change the state field in the PEL to 'acked' so that it doesn't get sent up again. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id2a9985965017d9431419c1375d5374a2d0ae00b
Diffstat (limited to 'extensions')
-rw-r--r--extensions/openpower-pels/host_notifier.cpp12
-rw-r--r--extensions/openpower-pels/host_notifier.hpp9
2 files changed, 21 insertions, 0 deletions
diff --git a/extensions/openpower-pels/host_notifier.cpp b/extensions/openpower-pels/host_notifier.cpp
index f2d951f..b4e92a8 100644
--- a/extensions/openpower-pels/host_notifier.cpp
+++ b/extensions/openpower-pels/host_notifier.cpp
@@ -345,4 +345,16 @@ void HostNotifier::stopCommand()
}
}
+void HostNotifier::ackPEL(uint32_t id)
+{
+ _repo.setPELHostTransState(id, TransmissionState::acked);
+
+ // No longer just 'sent', so remove it from the sent list.
+ auto sent = std::find(_sentPELs.begin(), _sentPELs.end(), id);
+ if (sent != _sentPELs.end())
+ {
+ _sentPELs.erase(sent);
+ }
+}
+
} // namespace openpower::pels
diff --git a/extensions/openpower-pels/host_notifier.hpp b/extensions/openpower-pels/host_notifier.hpp
index 3e50c83..d160dd4 100644
--- a/extensions/openpower-pels/host_notifier.hpp
+++ b/extensions/openpower-pels/host_notifier.hpp
@@ -82,6 +82,15 @@ class HostNotifier
*/
bool notifyRequired(uint32_t id) const;
+ /**
+ * @brief Called when the host sends the 'ack' PLDM command.
+ *
+ * This means the PEL never needs to be sent up again.
+ *
+ * @param[in] id - The PEL ID
+ */
+ void ackPEL(uint32_t id);
+
private:
/**
* @brief This function gets called by the Repository class
OpenPOWER on IntegriCloud