ipmi: start implementing flashStartHash
Change-Id: I5465bd672eac510be30d50cac8cf34b86a24ca40
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/ipmi.cpp b/ipmi.cpp
index d8e9f89..00f027a 100644
--- a/ipmi.cpp
+++ b/ipmi.cpp
@@ -25,6 +25,7 @@
static const std::unordered_map<FlashSubCmds, size_t> minimumLengths = {
{FlashSubCmds::flashStartTransfer, sizeof(struct StartTx)},
{FlashSubCmds::flashDataBlock, sizeof(struct ChunkHdr) + 1},
+ {FlashSubCmds::flashStartHash, sizeof(struct StartTx)},
};
auto results = minimumLengths.find(command);
@@ -98,3 +99,19 @@
(*dataLen) = 1;
return IPMI_CC_OK;
}
+
+ipmi_ret_t startHash(UpdateInterface* updater, const uint8_t* reqBuf,
+ uint8_t* replyBuf, size_t* dataLen)
+{
+ auto request = reinterpret_cast<const struct StartTx*>(reqBuf);
+
+ if (!updater->startHash(request->length))
+ {
+ return IPMI_CC_INVALID;
+ }
+
+ /* We were successful and set the response byte to 0. */
+ replyBuf[0] = 0x00;
+ (*dataLen) = 1;
+ return IPMI_CC_OK;
+}