aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-07-03 20:15:35 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:16:25 -0800
commitc256b9df6502536c2e451e690f1ad5962c664d1a (patch)
treea83ad13e6f5978bbe14bb3ecf8294ba1e3d28db4 /host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp
parent9a8435ed998fc5c65257f4c55768750b227ab19e (diff)
downloaduhd-c256b9df6502536c2e451e690f1ad5962c664d1a.tar.gz
uhd-c256b9df6502536c2e451e690f1ad5962c664d1a.tar.bz2
uhd-c256b9df6502536c2e451e690f1ad5962c664d1a.zip
x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com> Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com> Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com> Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp
new file mode 100644
index 000000000..a9cb456e5
--- /dev/null
+++ b/host/lib/usrp/mpmd/mpmd_link_if_ctrl_base.hpp
@@ -0,0 +1,56 @@
+//
+// Copyright 2017 Ettus Research, a National Instruments Company
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_MPMD_XPORT_CTRL_BASE_HPP
+#define INCLUDED_MPMD_XPORT_CTRL_BASE_HPP
+
+#include "mpmd_link_if_mgr.hpp"
+#include <uhd/types/device_addr.hpp>
+#include <uhdlib/rfnoc/chdr_packet.hpp>
+#include <uhdlib/transport/links.hpp>
+#include <memory>
+
+namespace uhd { namespace mpmd { namespace xport {
+
+/*! Transport manager implementation base
+ */
+class mpmd_link_if_ctrl_base
+{
+public:
+ using uptr = std::unique_ptr<mpmd_link_if_ctrl_base>;
+ virtual ~mpmd_link_if_ctrl_base() {}
+
+ virtual size_t get_num_links() const = 0;
+
+ /*! Return links object
+ *
+ * \param link_idx The number of the link to use. link_idx < get_num_links()
+ * must hold true. link_idx is often 0. Example: When
+ * the underlying transport is Ethernet, and the user
+ * specified both addr and second_addr, then get_num_links()
+ * equals 2 and link_idx can also be 1.
+ * \param link_type CTRL, RX_DATA, or TX_DATA (for configuring the link)
+ * \param link_args Link-specific additional information that the underlying
+ * mpmd_link_if_ctrl instantiation can use
+ */
+ virtual uhd::transport::both_links_t get_link(const size_t link_idx,
+ const uhd::transport::link_type_t link_type,
+ const uhd::device_addr_t& link_args) = 0;
+
+ //! Return the underlying link's MTU in bytes
+ virtual size_t get_mtu(const uhd::direction_t dir) const = 0;
+
+ //! Return the rate of the underlying link in bytes/sec
+ virtual double get_link_rate(const size_t link_idx) const = 0;
+
+ //! Get the packet factory associated with this link
+ virtual const uhd::rfnoc::chdr::chdr_packet_factory& get_packet_factory() const = 0;
+};
+
+}}} /* namespace uhd::mpmd::xport */
+
+#endif /* INCLUDED_MPMD_XPORT_CTRL_BASE_HPP */