From f27cb2a7711e428a88c59a5af762055c7f1e3e13 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Tue, 11 Apr 2017 15:56:13 -0700 Subject: uhd: add a simple make_transport to netd_impl --- host/lib/usrp/netd/netd_impl.cpp | 18 +++++++++--------- host/lib/usrp/netd/netd_impl.hpp | 5 +++++ 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'host/lib/usrp/netd') diff --git a/host/lib/usrp/netd/netd_impl.cpp b/host/lib/usrp/netd/netd_impl.cpp index 0b4da86ef..555aedea5 100644 --- a/host/lib/usrp/netd/netd_impl.cpp +++ b/host/lib/usrp/netd/netd_impl.cpp @@ -53,8 +53,8 @@ netd_mboard_impl::netd_mboard_impl(const std::string& addr) }; boost::this_thread::sleep_for(boost::chrono::milliseconds(1000)); }); - std::vector data_ifaces = - rpc.call>("get_interfaces", _rpc_token); + // std::vector data_ifaces = + // rpc.call>("get_interfaces", _rpc_token); // discover path to device and tell MPM our MAC address seen at the data // interfaces @@ -81,9 +81,11 @@ netd_mboard_impl::uptr netd_mboard_impl::make(const std::string& addr) return mb; } -bool netd_mboard_impl::claim() { return rpc.call("claim", _rpc_token); } +bool netd_mboard_impl::claim() { return rpc.call("reclaim", _rpc_token); } -netd_impl::netd_impl(const device_addr_t& device_addr) : usrp::device3_impl() +netd_impl::netd_impl(const device_addr_t& device_addr) : + usrp::device3_impl(), + _sid_framer(0) { UHD_LOGGER_INFO("NETD") << "NETD initialization sequence..."; _tree->create("/name").set("NETD - Series device"); @@ -151,9 +153,9 @@ netd_mboard_impl::uptr netd_impl::setup_mb(const size_t mb_i, // } // Everything fake below here -both_xports_t netd_impl::make_transport(const sid_t&, - usrp::device3_impl::xport_type_t, - const uhd::device_addr_t&) +both_xports_t netd_impl::make_transport(const sid_t& address, + usrp::device3_impl::xport_type_t xport_type, + const uhd::device_addr_t& args) { //const size_t mb_index = address.get_dst_addr(); size_t mb_index = 0; @@ -191,8 +193,6 @@ both_xports_t netd_impl::make_transport(const sid_t&, xports.send_sid = _mb[mb_index]->allocate_sid(port, address, xbar_src_addr, xbar_src_dst); xports.recv_sid = xports.send_sid.reversed(); - //std::cout << xports.send_sid << std::endl; - //std::cout << xports.recv_sid << std::endl; xports.recv_buff_size = buff_params.recv_buff_size; xports.send_buff_size = buff_params.send_buff_size; diff --git a/host/lib/usrp/netd/netd_impl.hpp b/host/lib/usrp/netd/netd_impl.hpp index 418f3aef6..4b08f50cd 100644 --- a/host/lib/usrp/netd/netd_impl.hpp +++ b/host/lib/usrp/netd/netd_impl.hpp @@ -54,6 +54,10 @@ class netd_mboard_impl std::string loaded_fpga_image; std::string xport_path; uhd::rpc_client rpc; + uhd::sid_t allocate_sid(const uint16_t port, + const uhd::sid_t address, + const uint32_t xbar_src_addr, + const uint32_t xbar_src_dst); private: bool claim(); @@ -76,6 +80,7 @@ class netd_impl : public uhd::usrp::device3_impl private: std::vector _mb; + size_t _sid_framer; }; uhd::device_addrs_t netd_find(const uhd::device_addr_t& hint_); #endif /* INCLUDED_NETD_IMPL_HPP */ -- cgit v1.2.3