summaryrefslogtreecommitdiffstats
path: root/occ_status.cpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-06-29 18:35:00 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-07-29 23:57:59 +0530
commitee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb (patch)
tree4d186ddf133d77880e857fccdddb71fcc155a6bf /occ_status.cpp
parent554d60059e7d0b699b3cdcbe8de2c341613e9931 (diff)
downloadopenpower-occ-control-ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb.tar.gz
openpower-occ-control-ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb.zip
Add support to watch for OCC errors
Change-Id: I98d95020a2d01e281e5c8efa825d6b4bd4c6c160 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_status.cpp')
-rw-r--r--occ_status.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/occ_status.cpp b/occ_status.cpp
index ca8a1f9..83825c5 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -13,15 +13,28 @@ bool Status::occActive(bool value)
{
// Bind the device
device.bind();
+
+ // And watch for errors
+ device.addErrorWatch();
}
else
{
- // Do the unbind
+ // Stop watching for errors
+ device.removeErrorWatch();
+
+ // Do the unbind.
device.unBind();
}
}
return Base::Status::occActive(value);
}
+// Callback handler when a device error is reported.
+void Status::deviceErrorHandler()
+{
+ // This would deem OCC inactive
+ this->occActive(false);
+}
+
} // namespace occ
} // namespace open_power
OpenPOWER on IntegriCloud