add flash-ipmi header defining sub-commands
Each IPMI flow-control or data packet is expected to specify a
sub-command. This introduces the list of known sub-commands.
Change-Id: I4b5b64ca1a605bdaf4acabab05aea567cd9961ee
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/flash-ipmi.hpp b/flash-ipmi.hpp
new file mode 100644
index 0000000..43cafe1
--- /dev/null
+++ b/flash-ipmi.hpp
@@ -0,0 +1,57 @@
+#pragma once
+
+/*
+ * flashStartTransfer -- starts file upload.
+ * flashDataBlock -- adds data to image file.
+ * flashDataFinish -- closes the file.
+ *
+ * flashStartHash -- starts uploading hash.
+ * flashDataHash -- adds data to the hash.
+ * flashDataVerify -- triggers verification.
+ *
+ * flashAbort -- abort everything.
+ *
+ * flashVerifyCheck -- Check if the verification has completed.
+ *
+ * flashVersion -- Get the version of this OEM Handler.
+ *
+ * flashRequestRegion -- Request the physical address for decode (bridge)
+ * flashDataExtBlock -- Provide image data via a bridge
+ * flashHashExtData -- Provide hash data via a bridge
+ */
+enum FlashSubCmds
+{
+ /* Start a transfer. */
+ flashStartTransfer = 0,
+ /* Data block. */
+ flashDataBlock = 1,
+ /* Close file. */
+ flashDataFinish = 2,
+
+ /* Start a hash transfer. */
+ flashStartHash = 3,
+ /* Add data to the hash. */
+ flashHashData = 4,
+ /* Close out the hash file. */
+ flashHashFinish = 5,
+
+ /* Verify the flash image against the hast sent. */
+ flashDataVerify = 6,
+
+ /* Abort. */
+ flashAbort = 7,
+
+ /*
+ * Check if the verification is ready and was successful.
+ * If the response from the IPMI command is OK, check the
+ * response bytes to know if it's ready or still computing,
+ * or failed.
+ */
+ flashVerifyCheck = 8,
+
+ flashVersion = 9,
+ flashRequestRegion = 10,
+ flashDataExtBlock = 11,
+ flashHashExtData = 12,
+ flashMapRegionLpc = 13,
+};
diff --git a/main.cpp b/main.cpp
index 36f4662..8a6bac1 100644
--- a/main.cpp
+++ b/main.cpp
@@ -17,6 +17,8 @@
#include "host-ipmid/ipmid-api.h"
#include "host-ipmid/oemrouter.hpp"
+#include "flash-ipmi.hpp"
+
/* TODO: Once OEM IPMI number placement is settled, point to that. */
namespace oem
{