From 87dbcd9f1a5b2b464c27af56c3a91ab00f66c441 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 1 Dec 2017 16:14:11 -0800 Subject: mpmd: Refactor MPM transport architecture, use managers This splits up the transport code in mpmd_impl across multiple classes to properly leverage the request_xport/commit_xport API in MPM. Different types of transport (UDP, liberio) use their own distinct classes, which are generated dynamically on request. This is a true refactoring despite the large amount of changes; there are no functional differences. Reviewed-By: Brent Stapleton Reviewed-By: Trung Tran Reviewed-By: Ashish Chaudhari --- host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp (limited to 'host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp') diff --git a/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp new file mode 100644 index 000000000..76bb88f03 --- /dev/null +++ b/host/lib/usrp/mpmd/mpmd_xport_ctrl_liberio.hpp @@ -0,0 +1,59 @@ +// +// Copyright 2017 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0 +// + +#ifndef INCLUDED_MPMD_XPORT_ctrl_liberio_HPP +#define INCLUDED_MPMD_XPORT_ctrl_liberio_HPP + +#include "mpmd_xport_ctrl_base.hpp" +#include +#include "../device3/device3_impl.hpp" +#include + +namespace uhd { namespace mpmd { namespace xport { + +/*! Liberio transport manager + */ +class mpmd_xport_ctrl_liberio : public mpmd_xport_ctrl_base +{ +public: + mpmd_xport_ctrl_liberio( + const uhd::device_addr_t& mb_args + ); + + /*! Open DMA interface to kernel (and thus to FPGA DMA engine) + */ + both_xports_t make_transport( + mpmd_xport_mgr::xport_info_t& xport_info, + const usrp::device3_impl::xport_type_t xport_type, + const uhd::device_addr_t& xport_args + ); + + bool is_valid( + const mpmd_xport_mgr::xport_info_t& xport_info + ) const; + +private: + /*! Create a muxed liberio transport for control packets */ + uhd::transport::muxed_zero_copy_if::sptr make_muxed_liberio_xport( + const std::string &tx_dev, + const std::string &rx_dev, + const uhd::transport::zero_copy_xport_params &buff_args, + const size_t max_muxed_ports + ); + + const uhd::device_addr_t _mb_args; + const uhd::dict _recv_args; + const uhd::dict _send_args; + + //! Control transport for one liberio connection + uhd::transport::muxed_zero_copy_if::sptr _ctrl_dma_xport; + //! Control transport for one liberio connection + uhd::transport::muxed_zero_copy_if::sptr _async_msg_dma_xport; +}; + +}}} /* namespace uhd::mpmd::xport */ + +#endif /* INCLUDED_MPMD_XPORT_ctrl_liberio_HPP */ -- cgit v1.2.3