aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_conn_mgr.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-08-13 15:28:13 -0700
committerMartin Braun <martin.braun@ettus.com>2019-08-16 13:42:02 -0700
commit3d157e09f642caa7a5d48c71468b444d0566cf8d (patch)
treeb29219cb40d3f887d97a068d4a6e45c5ce2b5a65 /host/lib/usrp/x300/x300_conn_mgr.hpp
parentbbb869ca80fa299f7888b35134218229521dd0c0 (diff)
downloaduhd-3d157e09f642caa7a5d48c71468b444d0566cf8d.tar.gz
uhd-3d157e09f642caa7a5d48c71468b444d0566cf8d.tar.bz2
uhd-3d157e09f642caa7a5d48c71468b444d0566cf8d.zip
x300: Introduce conn_manager
This is a superclass to eth_manager and pcie_manager, since they usually do the same thing. This saves storing and passing multiple pointers. Also, x300_impl now stores a shared_ptr of the conn_manager, because we'll need to pass it around in the future.
Diffstat (limited to 'host/lib/usrp/x300/x300_conn_mgr.hpp')
-rw-r--r--host/lib/usrp/x300/x300_conn_mgr.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/x300_conn_mgr.hpp b/host/lib/usrp/x300/x300_conn_mgr.hpp
new file mode 100644
index 000000000..8aca2eb06
--- /dev/null
+++ b/host/lib/usrp/x300/x300_conn_mgr.hpp
@@ -0,0 +1,35 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_X300_CONN_MGR_HPP
+#define INCLUDED_X300_CONN_MGR_HPP
+
+#include <uhd/transport/if_addrs.hpp>
+#include <uhd/types/direction.hpp>
+#include <uhd/types/wb_iface.hpp>
+#include <uhd/usrp/mboard_eeprom.hpp>
+#include <string>
+
+namespace uhd { namespace usrp { namespace x300 {
+
+/*! Helper base class to manage the connection to the device
+ */
+class conn_manager
+{
+public:
+ using sptr = std::shared_ptr<conn_manager>;
+ virtual ~conn_manager() {}
+
+ /*! Return a reference to a ZPU ctrl interface object
+ */
+ virtual uhd::wb_iface::sptr get_ctrl_iface() = 0;
+
+ virtual size_t get_mtu(uhd::direction_t dir) = 0;
+};
+
+}}} // namespace uhd::usrp::x300
+
+#endif /* INCLUDED_X300_CONN_MGR_HPP */