From b12b9465ed13bf2eb7c0fe379c22dcb3b86c4054 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 15 Nov 2017 17:21:27 -0800 Subject: mpm/mpmd: Move to request_xport()/commit_xport() architecture This commit combines code from various branches to finally enable both UDP and Liberio transports. --- host/lib/usrp/mpmd/mpmd_impl.hpp | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/mpmd/mpmd_impl.hpp') diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp index 7eca982a4..3143378dd 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.hpp +++ b/host/lib/usrp/mpmd/mpmd_impl.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include static const size_t MPMD_RX_SW_BUFF_SIZE_ETH = 0x2000000;//32MiB For an ~8k frame size any size >32MiB is just wasted buffer space @@ -36,13 +37,6 @@ static const char MPM_ECHO_CMD[] = "MPM-ECHO"; static const size_t MPMD_10GE_DATA_FRAME_MAX_SIZE = 8000; // CHDR packet size in bytes -struct frame_size_t -{ - size_t recv_frame_size; - size_t send_frame_size; -}; - - /*! Stores all attributes specific to a single MPM device */ class mpmd_mboard_impl @@ -195,10 +189,42 @@ class mpmd_impl : public uhd::usrp::device3_impl */ size_t identify_mboard_by_sid(const size_t remote_addr); + using xport_info_t = std::map; + using xport_info_list_t = std::vector>; + + uhd::both_xports_t make_transport_udp( + const size_t mb_index, + xport_info_t &xport_info, + const xport_type_t xport_type, + const uhd::device_addr_t& xport_args + ); + +#ifdef HAVE_LIBERIO + /*! 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 + ); + + uhd::both_xports_t make_transport_liberio( + const size_t mb_index, + xport_info_t &xport_info, + const xport_type_t xport_type, + const uhd::device_addr_t& xport_args + ); +#endif /************************************************************************* * Private attributes ************************************************************************/ + // FIXME move the next two into their own transport manager class + //! 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; + uhd::dict recv_args; uhd::dict send_args; -- cgit v1.2.3