Firmware update commmands re-write

Firmware update commands re-write
 * Updated to new API style
 * Coding guidelines for all names
 * Restricted few commands for PFR
 * Few updates as per new OpenBMC EPS
 * Changes for fw update status
 * Removed legacy API's used for FW update

Tested:
 - Tested firmware update using fwpiaupd.efi tool
   in usb and kcs trasfer mode.
 - Tested all firmware update commands over LAN.

Change-Id: I666cb139b2ca61d352e1cb6b1c18d045b7b1f197
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 209edd8..9980397 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -3445,6 +3445,25 @@
     return ipmi::responseSuccess(result);
 }
 
+/** @brief implements the maximum size of
+ *  bridgeable messages used between KCS and
+ *  IPMB interfacesget security mode command.
+ *
+ *  @returns IPMI completion code with following data
+ *   - KCS Buffer Size (In multiples of four bytes)
+ *   - IPMB Buffer Size (In multiples of four bytes)
+ **/
+ipmi::RspType<uint8_t, uint8_t> ipmiOEMGetBufferSize()
+{
+    // for now this is hard coded; really this number is dependent on
+    // the BMC kcs driver as well as the host kcs driver....
+    // we can't know the latter.
+    uint8_t kcsMaxBufferSize = 63 / 4;
+    uint8_t ipmbMaxBufferSize = 128 / 4;
+
+    return ipmi::responseSuccess(kcsMaxBufferSize, ipmbMaxBufferSize);
+}
+
 static void registerOEMFunctions(void)
 {
     phosphor::logging::log<phosphor::logging::level::INFO>(
@@ -3611,6 +3630,10 @@
     registerHandler(prioOemBase, intel::netFnGeneral,
                     intel::general::cmdGetPSUVersion, Privilege::User,
                     ipmiOEMGetPSUVersion);
+
+    registerHandler(prioOemBase, intel::netFnGeneral,
+                    intel::general::cmdGetBufferSize, Privilege::User,
+                    ipmiOEMGetBufferSize);
 }
 
 } // namespace ipmi