psu-ng: Add in handling of specific MFR faults

Add in a function to determine what the various bits in statusMFR may be
indicating for a fault, based on the type of power supply (device driver
bound).

Add in PS_Kill, 12Vcs, and 12V CS faults for IBM power supply types.

Add in creating error logs for PS_Kill, 12Vcs, and 12V CS faults. The
12Vcs and 12V CS faults can essentially be treated the same as VOUT_UV
faults (same error type, same call out).

Tested:
Verified no PS_Kill, 12Vcs, or 12V CS fault on normal Rainier 2S4U

Simulated PS_Kill fault:
MFR fault: STATUS_WORD = 0x1840 STATUS_MFR_SPECIFIC = 0x10

Simulated 12Vcs fault:
PGOOD fault: STATUS_WORD = 0x1840, STATUS_MFR_SPECIFIC = 0x40
MFR fault: STATUS_WORD = 0x1840 STATUS_MFR_SPECIFIC = 0x40

Simulated 12V CS fault/warning:
MFR fault: STATUS_WORD = 0x1000 STATUS_MFR_SPECIFIC = 0x80

Change-Id: Ie89a58836ecec86dfa2e124eb6ab03e9dccce929
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index ec523ae..c995376 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -302,6 +302,30 @@
     }
 
     /**
+     * @brief Return true if there is a PS_Kill fault.
+     */
+    bool hasPSKillFault() const
+    {
+        return psKillFault;
+    }
+
+    /**
+     * @brief Returns true if there is a 12Vcs (standy power) fault.
+     */
+    bool hasPS12VcsFault() const
+    {
+        return ps12VcsFault;
+    }
+
+    /**
+     * @brief Returns true if there is a 12V current-share fault.
+     */
+    bool hasPSCS12VFault() const
+    {
+        return psCS12VFault;
+    }
+
+    /**
      * @brief Returns the device path
      *
      * This can be used for error call outs.
@@ -426,10 +450,35 @@
      */
     int pgoodFault = 0;
 
+    /**
+     * @brief Power Supply Kill fault.
+     */
+    bool psKillFault = false;
+
+    /**
+     * @brief Power Supply 12Vcs fault (standby power).
+     */
+    bool ps12VcsFault = false;
+
+    /**
+     * @brief Power Supply Current-Share fault in 12V domain.
+     */
+    bool psCS12VFault = false;
+
     /** @brief Count of the number of read failures. */
     size_t readFail = 0;
 
     /**
+     * @brief Determine possible manufacturer-specific faults from bits in
+     * STATUS_MFR.
+     *
+     * The bits in the STATUS_MFR_SPECIFIC command response have "Manufacturer
+     * Defined" meanings. Determine which faults, if any, are present based on
+     * the power supply (device driver) type.
+     */
+    void determineMFRFault();
+
+    /**
      * @brief D-Bus path to use for this power supply's inventory status.
      **/
     std::string inventoryPath;