Add fan profile host support

Implement the fan profile portions of get / set fan
profile ipmi commands. These commands have been overused
with too much debug information, currently we only plan
to support the part that the host needs.

Tested-by: Modified the settings on the host and they
were persisted correctly on the next boot

Change-Id: I5736703123154193b8e193ccb14fc2ffb9f5320b
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/oemcommands.hpp b/include/oemcommands.hpp
index a348db2..df6b007 100644
--- a/include/oemcommands.hpp
+++ b/include/oemcommands.hpp
@@ -26,6 +26,8 @@
     cmdGetPowerRestoreDelay = 0x55,
     cmdSetShutdownPolicy = 0x60,
     cmdGetShutdownPolicy = 0x62,
+    cmdSetFanConfig = 0x89,
+    cmdGetFanConfig = 0x8a,
     cmdGetChassisIdentifier = 0x92,
     cmdGetProcessorErrConfig = 0x9A,
     cmdSetProcessorErrConfig = 0x9B,
@@ -127,6 +129,8 @@
 static constexpr const char* fwSetEnvCmd = "/sbin/fw_setenv";
 static constexpr const char* fwHostSerailCfgEnvName = "hostserialcfg";
 
+constexpr const char* settingsBusName = "xyz.openbmc_project.Settings";
+
 static constexpr const uint8_t getHostSerialCfgCmd = 0;
 static constexpr const uint8_t setHostSerialCfgCmd = 1;
 
@@ -264,9 +268,34 @@
     uint8_t policySupport;
 };
 
+struct SetFanConfigReq
+{
+    uint8_t selectedProfile;
+    uint8_t flags;
+    // other parameters from previous generation are not supported
+};
+
+struct GetFanConfigResp
+{
+    uint8_t supportMask;
+    uint8_t profileSupport;
+    uint8_t fanControlProfileEnable;
+    uint8_t flags;
+    uint8_t dimmPresenceMap[4];
+};
+
 struct CfgHostSerialReq
 {
     uint8_t command;
     uint8_t parameter;
 };
 #pragma pack(pop)
+
+enum class setFanProfileFlags : uint8_t
+{
+    setFanProfile = 7,
+    setPerfAcousMode = 6,
+    // reserved [5:3]
+    performAcousSelect = 2
+    // reserved [1:0]
+};
\ No newline at end of file