Adding more app command for FB

Added more FB supported App commands like get/set sys_params,
manufacturing test

Change-Id: I75cf06fb3a85a4d0008732261e912be1f3752d60
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/include/appcommands.hpp b/include/appcommands.hpp
index b0ef418..ba61ffa 100644
--- a/include/appcommands.hpp
+++ b/include/appcommands.hpp
@@ -18,20 +18,67 @@
 
 enum fb_app_cmds
 {
+    CMD_APP_GET_SELFTEST_RESULTS = 0x04,
+    CMD_APP_MFR_TEST_ON = 0x05,
     CMD_APP_SET_ACPI = 0x06,
     CMD_APP_GET_ACPI = 0x07,
     CMD_APP_GET_DEV_GUID = 0x08,
-    CMD_APP_RESET_WD = 0x22,
-    CMD_APP_SET_WD = 0x24,
-    CMD_APP_GET_WD = 0x25,
     CMD_APP_SET_GLOBAL_ENABLES = 0x2E,
     CMD_APP_GET_GLOBAL_ENABLES = 0x2F,
-    CMD_APP_GET_MSG_FLAGS = 0x31,
-    CMD_APP_READ_EVENT = 0x35,
-    CMD_APP_GET_CAP_BIT = 0x36,
+    CMD_APP_CLEAR_MESSAGE_FLAGS = 0x30,
     CMD_APP_GET_SYS_GUID = 0x37,
-    CMD_APP_SET_CHAN_ACCESS = 0x40,
-    CMD_APP_GET_CHANNEL_ACCESS = 0x41,
-    CMD_APP_GET_CHAN_INFO = 0x42,
+    CMD_APP_SET_SYS_INFO_PARAMS = 0x58,
+    CMD_APP_GET_SYS_INFO_PARAMS = 0x59,
 
 };
+
+#define SIZE_SYSFW_VER 17
+#define SIZE_SYS_NAME 17
+#define SIZE_OS_NAME 17
+#define SIZE_OS_VER 17
+#define SIZE_BMC_URL 17
+#define SIZE_OS_HV_URL 17
+#define SIZE_BIOS_CURRENT_BOOT_LIST 250
+#define SIZE_BIOS_FIXED_BOOT_DEVICE 1
+#define SIZE_BIOS_RSTR_DFLT_SETTING 1
+#define SIZE_LAST_BOOT_TIME 4
+#define SIZE_PCIE_PORT_CONFIG 2
+
+#define JSON_DATA_FILE "/etc/appData.json"
+#define KEY_SYSFW_VER "sysfw_ver_server"
+#define KEY_BIOS_BOOT_LEN "bios_boot_list_len"
+
+// System Info Parameters (IPMI/Table 22-16c)
+enum SysInfoParams
+{
+    SYS_INFO_PARAM_SET_IN_PROG,
+    SYS_INFO_PARAM_SYSFW_VER,
+    SYS_INFO_PARAM_SYS_NAME,
+    SYS_INFO_PARAM_PRI_OS_NAME,
+    SYS_INFO_PARAM_PRESENT_OS_NAME,
+    SYS_INFO_PARAM_PRESENT_OS_VER,
+    SYS_INFO_PARAM_BMC_URL,
+    SYS_INFO_PARAM_OS_HV_URL,
+    SYS_INFO_PARAM_BIOS_CURRENT_BOOT_LIST = 0xC1,
+    SYS_INFO_PARAM_BIOS_FIXED_BOOT_DEVICE = 0xC2,
+    SYS_INFO_PARAM_BIOS_RSTR_DFLT_SETTING = 0xC3,
+    SYS_INFO_PARAM_LAST_BOOT_TIME = 0xC4,
+};
+
+// Structure for System Info Params (IPMI/Section 22.14a)
+struct SysInfoParam
+{
+    uint8_t set_in_prog;
+    uint8_t sysfw_ver[SIZE_SYSFW_VER];
+    uint8_t sys_name[SIZE_SYS_NAME];
+    uint8_t pri_os_name[SIZE_OS_NAME];
+    uint8_t present_os_name[SIZE_OS_NAME];
+    uint8_t present_os_ver[SIZE_OS_VER];
+    uint8_t bmc_url[SIZE_BMC_URL];
+    uint8_t os_hv_url[SIZE_OS_HV_URL];
+    uint8_t bios_current_boot_list[SIZE_BIOS_CURRENT_BOOT_LIST];
+    uint8_t bios_fixed_boot_device[SIZE_BIOS_FIXED_BOOT_DEVICE];
+    uint8_t bios_rstr_dflt_setting[SIZE_BIOS_RSTR_DFLT_SETTING];
+    uint8_t last_boot_time[SIZE_LAST_BOOT_TIME];
+
+} __attribute__((packed));