summaryrefslogtreecommitdiffstats
path: root/occ_pass_through.hpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-04-14 18:12:14 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-04-26 16:15:07 +0530
commit38b08d791b159424c9c9f9a21876f73f6020062b (patch)
tree95b9007eff763921cdcd3e66436ffddd80a74516 /occ_pass_through.hpp
parentafd21a650715bf7a0ecc9b71a93d60639706d980 (diff)
downloadopenpower-occ-control-38b08d791b159424c9c9f9a21876f73f6020062b.tar.gz
openpower-occ-control-38b08d791b159424c9c9f9a21876f73f6020062b.zip
Open device and populate file descriptor
Change-Id: I8159f71ff3dd087f10cdf3b013e1acb60d4758fb Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_pass_through.hpp')
-rw-r--r--occ_pass_through.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/occ_pass_through.hpp b/occ_pass_through.hpp
index da8c617..673b68e 100644
--- a/occ_pass_through.hpp
+++ b/occ_pass_through.hpp
@@ -2,10 +2,12 @@
#include <string>
#include <vector>
+#include <unistd.h>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server/object.hpp>
#include "org/open_power/OCC/PassThrough/server.hpp"
#include "config.h"
+#include "file.hpp"
namespace open_power
{
@@ -39,11 +41,11 @@ class PassThrough : public Iface
{
public:
PassThrough() = delete;
+ ~PassThrough() = default;
PassThrough(const PassThrough&) = delete;
PassThrough& operator=(const PassThrough&) = delete;
PassThrough(PassThrough&&) = default;
PassThrough& operator=(PassThrough&&) = default;
- ~PassThrough() = default;
/** @brief Ctor to put pass-through d-bus object on the bus
* @param[in] bus - Bus to attach to
@@ -65,12 +67,18 @@ class PassThrough : public Iface
/** @brief OCC device path
* For now, here is the hard-coded mapping until
- * the udev rule is in
+ * the udev rule is in.
* occ0 --> /dev/occfifo1
* occ1 --> /dev/occfifo2
* ...
*/
std::string devicePath = "/dev/occfifo";
+
+ /** @brief File descriptor manager */
+ FileDescriptor fd;
+
+ /** Opens devicePath and returns file descritor */
+ int openDevice();
};
} // namespace pass_through
OpenPOWER on IntegriCloud