From c256b9df6502536c2e451e690f1ad5962c664d1a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 3 Jul 2019 20:15:35 -0700 Subject: x300/mpmd: Port all RFNoC devices to the new RFNoC framework Co-Authored-By: Alex Williams Co-Authored-By: Sugandha Gupta Co-Authored-By: Brent Stapleton Co-Authored-By: Ciro Nishiguchi --- host/lib/usrp/x300/x300_eth_mgr.hpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'host/lib/usrp/x300/x300_eth_mgr.hpp') diff --git a/host/lib/usrp/x300/x300_eth_mgr.hpp b/host/lib/usrp/x300/x300_eth_mgr.hpp index 022e14bbd..1f4013e17 100644 --- a/host/lib/usrp/x300/x300_eth_mgr.hpp +++ b/host/lib/usrp/x300/x300_eth_mgr.hpp @@ -10,13 +10,14 @@ #include "x300_conn_mgr.hpp" #include "x300_device_args.hpp" #include "x300_mboard_type.hpp" +#include #include #include #include //mtu -#include #include -#include +#include #include +#include #include namespace uhd { namespace usrp { namespace x300 { @@ -52,12 +53,20 @@ public: */ void release_ctrl_iface(std::function&& release_fn); - both_xports_t make_transport(both_xports_t xports, - const uhd::usrp::device3_impl::xport_type_t xport_type, - const uhd::device_addr_t& args, - const size_t send_mtu, - const size_t recv_mtu, - std::function&& allocate_sid); + /*! Return the list of local device IDs associated with this link + * + * Note: this will only be valid after init_link() is called. + */ + std::vector get_local_device_ids() + { + return _local_device_ids; + } + + uhd::transport::both_links_t get_links(uhd::transport::link_type_t link_type, + const uhd::rfnoc::device_id_t local_device_id, + const uhd::rfnoc::sep_id_t& local_epid, + const uhd::rfnoc::sep_id_t& remote_epid, + const uhd::device_addr_t& link_args); private: //! Function to create a udp_simple::sptr (kernel-based or DPDK-based) @@ -87,7 +96,7 @@ private: // Get the primary ethernet connection inline const x300_eth_conn_t& get_pri_eth() const { - return eth_conns[0]; + return eth_conns.at(_local_device_ids.at(0)); } static udp_simple_factory_t x300_get_udp_factory(const device_addr_t& args); @@ -111,15 +120,14 @@ private: udp_simple_factory_t _x300_make_udp_connected; - std::vector eth_conns; - size_t _next_src_addr = 0; - size_t _next_tx_src_addr = 0; - size_t _next_rx_src_addr = 0; + std::map eth_conns; frame_size_t _max_frame_sizes; uhd::device_addr_t recv_args; uhd::device_addr_t send_args; + + std::vector _local_device_ids; }; }}} // namespace uhd::usrp::x300 -- cgit v1.2.3