summaryrefslogtreecommitdiffstats
path: root/monitor/fan.hpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-08-22 11:18:19 -0500
committerMatthew Barth <msbarth@us.ibm.com>2017-08-23 16:33:36 -0500
commit6ad28430764b7d16ee7abcb9965b76ea5583008f (patch)
tree8eb3bc7cf78b1d7807a240b5e20c739f97e1db4e /monitor/fan.hpp
parentd953bb25955584410bb29ddac97587b3b633d4bd (diff)
downloadphosphor-fan-presence-6ad28430764b7d16ee7abcb9965b76ea5583008f.tar.gz
phosphor-fan-presence-6ad28430764b7d16ee7abcb9965b76ea5583008f.zip
Create fan monitor init mode
Allowing fan monitor to run in an init mode will set the fans to a functional state at each poweron for fans that were non-functional at poweroff. Then fan monitor can be started in monitor mode after the fans have ramped up to full speed and can begin being monitored for faults. This also allows for the removal of fan monitor doing a sd_notify prior to fan control starting. Change-Id: I634c9b4ec8bb30860dea54c8abd1cd6c56831d25 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'monitor/fan.hpp')
-rw-r--r--monitor/fan.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/monitor/fan.hpp b/monitor/fan.hpp
index 0004353..3da75cf 100644
--- a/monitor/fan.hpp
+++ b/monitor/fan.hpp
@@ -15,6 +15,17 @@ namespace monitor
{
/**
+ * The mode fan monitor will run in:
+ * - init - only do the initialization steps
+ * - monitor - run normal monitoring algorithm
+ */
+enum class Mode
+{
+ init,
+ monitor
+};
+
+/**
* @class InvalidSensorError
*
* An exception type for sensors that don't exist or
@@ -75,11 +86,13 @@ class Fan
/**
* @brief Constructor
*
+ * @param mode - mode of fan monitor
* @param bus - the dbus object
* @param events - pointer to sd_event object
* @param def - the fan definition structure
*/
- Fan(sdbusplus::bus::bus& bus,
+ Fan(Mode mode,
+ sdbusplus::bus::bus& bus,
phosphor::fan::event::EventPtr& events,
const FanDefinition& def);
OpenPOWER on IntegriCloud