diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/common/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/lib/usrp/n230/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/lib/usrp/n230/fw_comm_protocol.h (renamed from host/lib/usrp/common/fw_comm_protocol.h) | 0 | ||||
-rw-r--r-- | host/lib/usrp/n230/n230_fw_ctrl_iface.cpp (renamed from host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp) | 28 | ||||
-rw-r--r-- | host/lib/usrp/n230/n230_fw_ctrl_iface.hpp (renamed from host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp) | 14 | ||||
-rw-r--r-- | host/lib/usrp/n230/n230_impl.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/n230/n230_resource_manager.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/n230/n230_resource_manager.hpp | 8 |
8 files changed, 34 insertions, 35 deletions
diff --git a/host/lib/usrp/common/CMakeLists.txt b/host/lib/usrp/common/CMakeLists.txt index 9f4cf09b5..9480d0284 100644 --- a/host/lib/usrp/common/CMakeLists.txt +++ b/host/lib/usrp/common/CMakeLists.txt @@ -38,5 +38,4 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/validate_subdev_spec.cpp ${CMAKE_CURRENT_SOURCE_DIR}/recv_packet_demuxer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fifo_ctrl_excelsior.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/usrp3_fw_ctrl_iface.cpp ) diff --git a/host/lib/usrp/n230/CMakeLists.txt b/host/lib/usrp/n230/CMakeLists.txt index 9eaccffba..8bed1f26d 100644 --- a/host/lib/usrp/n230/CMakeLists.txt +++ b/host/lib/usrp/n230/CMakeLists.txt @@ -33,5 +33,6 @@ IF(ENABLE_N230) ${CMAKE_CURRENT_SOURCE_DIR}/n230_frontend_ctrl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/n230_uart.cpp ${CMAKE_CURRENT_SOURCE_DIR}/n230_image_loader.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/n230_fw_ctrl_iface.cpp ) ENDIF(ENABLE_N230) diff --git a/host/lib/usrp/common/fw_comm_protocol.h b/host/lib/usrp/n230/fw_comm_protocol.h index 14adb33a9..14adb33a9 100644 --- a/host/lib/usrp/common/fw_comm_protocol.h +++ b/host/lib/usrp/n230/fw_comm_protocol.h diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp b/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp index 35758d4dd..68fad3035 100644 --- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp +++ b/host/lib/usrp/n230/n230_fw_ctrl_iface.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "usrp3_fw_ctrl_iface.hpp" +#include "n230_fw_ctrl_iface.hpp" #include <uhd/utils/byteswap.hpp> #include <uhd/utils/msg.hpp> @@ -24,24 +24,24 @@ #include <boost/asio.hpp> //used for htonl and ntohl #include "fw_comm_protocol.h" -namespace uhd { namespace usrp { namespace usrp3 { +namespace uhd { namespace usrp { namespace n230 { //---------------------------------------------------------- // Factory method //---------------------------------------------------------- -uhd::wb_iface::sptr usrp3_fw_ctrl_iface::make( +uhd::wb_iface::sptr n230_fw_ctrl_iface::make( uhd::transport::udp_simple::sptr udp_xport, const uint16_t product_id, const bool verbose) { - return wb_iface::sptr(new usrp3_fw_ctrl_iface(udp_xport, product_id, verbose)); + return wb_iface::sptr(new n230_fw_ctrl_iface(udp_xport, product_id, verbose)); } //---------------------------------------------------------- // udp_fw_ctrl_iface //---------------------------------------------------------- -usrp3_fw_ctrl_iface::usrp3_fw_ctrl_iface( +n230_fw_ctrl_iface::n230_fw_ctrl_iface( uhd::transport::udp_simple::sptr udp_xport, const uint16_t product_id, const bool verbose) : @@ -52,18 +52,18 @@ usrp3_fw_ctrl_iface::usrp3_fw_ctrl_iface( peek32(0); } -usrp3_fw_ctrl_iface::~usrp3_fw_ctrl_iface() +n230_fw_ctrl_iface::~n230_fw_ctrl_iface() { flush(); } -void usrp3_fw_ctrl_iface::flush() +void n230_fw_ctrl_iface::flush() { boost::mutex::scoped_lock lock(_mutex); _flush(); } -void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const uint32_t data) +void n230_fw_ctrl_iface::poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); @@ -80,7 +80,7 @@ void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const uint32_t data) } } -uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) +uint32_t n230_fw_ctrl_iface::peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); @@ -97,7 +97,7 @@ uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) return 0; } -void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const uint32_t data) +void n230_fw_ctrl_iface::_poke32(const wb_addr_type addr, const uint32_t data) { //Load request struct fw_comm_pkt_t request; @@ -128,7 +128,7 @@ void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const uint32_t data) UHD_ASSERT_THROW(reply.data[0] == request.data[0]); } -uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) +uint32_t n230_fw_ctrl_iface::_peek32(const wb_addr_type addr) { //Load request struct fw_comm_pkt_t request; @@ -161,7 +161,7 @@ uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) return uhd::ntohx<uint32_t>(reply.data[0]); } -void usrp3_fw_ctrl_iface::_flush(void) +void n230_fw_ctrl_iface::_flush(void) { char buff[FW_COMM_PROTOCOL_MTU] = {}; while (_udp_xport->recv(boost::asio::buffer(buff), 0.0)) { @@ -169,7 +169,7 @@ void usrp3_fw_ctrl_iface::_flush(void) } } -std::vector<std::string> usrp3_fw_ctrl_iface::discover_devices( +std::vector<std::string> n230_fw_ctrl_iface::discover_devices( const std::string& addr_hint, const std::string& port, uint16_t product_id) { @@ -212,7 +212,7 @@ std::vector<std::string> usrp3_fw_ctrl_iface::discover_devices( return addrs; } -uint32_t usrp3_fw_ctrl_iface::get_iface_id( +uint32_t n230_fw_ctrl_iface::get_iface_id( const std::string& addr, const std::string& port, uint16_t product_id) { diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp b/host/lib/usrp/n230/n230_fw_ctrl_iface.hpp index 9dc35ef9e..675c843b3 100644 --- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.hpp +++ b/host/lib/usrp/n230/n230_fw_ctrl_iface.hpp @@ -15,24 +15,24 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#ifndef INCLUDED_LIBUHD_USRP_USRP3_UDP_FW_CTRL_IFACE_HPP -#define INCLUDED_LIBUHD_USRP_USRP3_UDP_FW_CTRL_IFACE_HPP +#ifndef INCLUDED_LIBUHD_USRP_N230_UDP_FW_CTRL_IFACE_HPP +#define INCLUDED_LIBUHD_USRP_N230_UDP_FW_CTRL_IFACE_HPP #include <uhd/types/wb_iface.hpp> #include <uhd/transport/udp_simple.hpp> #include <boost/thread/mutex.hpp> #include <vector> -namespace uhd { namespace usrp { namespace usrp3 { +namespace uhd { namespace usrp { namespace n230 { -class usrp3_fw_ctrl_iface : public uhd::wb_iface +class n230_fw_ctrl_iface : public uhd::wb_iface { public: - usrp3_fw_ctrl_iface( + n230_fw_ctrl_iface( uhd::transport::udp_simple::sptr udp_xport, const uint16_t product_id, const bool verbose); - virtual ~usrp3_fw_ctrl_iface(); + virtual ~n230_fw_ctrl_iface(); // -- uhd::wb_iface -- void poke32(const wb_addr_type addr, const uint32_t data); @@ -69,4 +69,4 @@ private: }}} //namespace -#endif //INCLUDED_LIBUHD_USRP_USRP3_USRP3_UDP_FW_CTRL_HPP +#endif // INCLUDED_LIBUHD_USRP_N230_UDP_FW_CTRL_IFACE_HPP diff --git a/host/lib/usrp/n230/n230_impl.cpp b/host/lib/usrp/n230/n230_impl.cpp index 325b90575..817868ef0 100644 --- a/host/lib/usrp/n230/n230_impl.cpp +++ b/host/lib/usrp/n230/n230_impl.cpp @@ -17,7 +17,7 @@ #include "n230_impl.hpp" -#include "usrp3_fw_ctrl_iface.hpp" +#include "n230_fw_ctrl_iface.hpp" #include "validate_subdev_spec.hpp" #include <uhd/utils/static.hpp> #include <uhd/transport/if_addrs.hpp> @@ -41,7 +41,6 @@ #include <boost/asio.hpp> //used for htonl and ntohl #include <boost/make_shared.hpp> -#include "../common/fw_comm_protocol.h" #include "n230_defaults.h" #include "n230_fpga_defs.h" #include "n230_fw_defs.h" @@ -115,7 +114,7 @@ uhd::device_addrs_t n230_impl::n230_find(const uhd::device_addr_t &multi_dev_hin } std::vector<std::string> discovered_addrs = - usrp3::usrp3_fw_ctrl_iface::discover_devices( + n230_fw_ctrl_iface::discover_devices( hint["addr"], BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID); for(const std::string& addr: discovered_addrs) @@ -135,10 +134,10 @@ uhd::device_addrs_t n230_impl::n230_find(const uhd::device_addr_t &multi_dev_hin //connected communication can fail. Retry the following call to allow //the stack to update size_t first_conn_retries = 10; - usrp3::usrp3_fw_ctrl_iface::sptr fw_ctrl; + n230_fw_ctrl_iface::sptr fw_ctrl; while (first_conn_retries > 0) { try { - fw_ctrl = usrp3::usrp3_fw_ctrl_iface::make(ctrl_xport, N230_FW_PRODUCT_ID, false /*verbose*/); + fw_ctrl = n230_fw_ctrl_iface::make(ctrl_xport, N230_FW_PRODUCT_ID, false /*verbose*/); break; } catch (uhd::io_error& ex) { boost::this_thread::sleep(boost::posix_time::milliseconds(500)); diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp index 08a98d245..c5617bbf7 100644 --- a/host/lib/usrp/n230/n230_resource_manager.cpp +++ b/host/lib/usrp/n230/n230_resource_manager.cpp @@ -17,7 +17,7 @@ #include "n230_resource_manager.hpp" -#include "usrp3_fw_ctrl_iface.hpp" +#include "n230_fw_ctrl_iface.hpp" #include <uhd/transport/if_addrs.hpp> #include <uhd/transport/udp_zero_copy.hpp> #include <uhd/utils/byteswap.hpp> @@ -91,7 +91,7 @@ n230_resource_manager::n230_resource_manager( uint32_t iface_id = 0xFFFFFFFF; try { - iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id( + iface_id = n230::n230_fw_ctrl_iface::get_iface_id( conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID); } catch (uhd::io_error&) { throw uhd::io_error(str(boost::format( @@ -118,7 +118,7 @@ n230_resource_manager::n230_resource_manager( } //Create firmware communication interface - _fw_ctrl = usrp3::usrp3_fw_ctrl_iface::make( + _fw_ctrl = n230::n230_fw_ctrl_iface::make( transport::udp_simple::make_connected( _get_conn(PRI_ETH).ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT)), N230_FW_PRODUCT_ID); if (_fw_ctrl.get() == NULL) { @@ -276,7 +276,7 @@ transport::zero_copy_if::sptr n230_resource_manager::create_transport( return xport; } -bool n230_resource_manager::is_device_claimed(uhd::usrp::usrp3::usrp3_fw_ctrl_iface::sptr fw_ctrl) +bool n230_resource_manager::is_device_claimed(n230_fw_ctrl_iface::sptr fw_ctrl) { boost::mutex::scoped_lock(_claimer_mutex); diff --git a/host/lib/usrp/n230/n230_resource_manager.hpp b/host/lib/usrp/n230/n230_resource_manager.hpp index 180f4f437..6da3b9035 100644 --- a/host/lib/usrp/n230/n230_resource_manager.hpp +++ b/host/lib/usrp/n230/n230_resource_manager.hpp @@ -37,7 +37,7 @@ #include <uhd/transport/bounded_buffer.hpp> #include <uhd/usrp/gps_ctrl.hpp> -#include "usrp3_fw_ctrl_iface.hpp" +#include "n230_fw_ctrl_iface.hpp" #include "n230_clk_pps_ctrl.hpp" #include "n230_cores.hpp" #include "n230_fpga_defs.h" @@ -98,7 +98,7 @@ public: //Methods n230_resource_manager(const std::vector<std::string> ip_addrs, const bool safe_mode); virtual ~n230_resource_manager(); - static bool is_device_claimed(uhd::usrp::usrp3::usrp3_fw_ctrl_iface::sptr fw_ctrl); + static bool is_device_claimed(n230_fw_ctrl_iface::sptr fw_ctrl); inline bool is_device_claimed() { if (_fw_ctrl.get()) { @@ -276,12 +276,12 @@ private: ver_info_t _fpga_version; //Firmware register interface - uhd::usrp::usrp3::usrp3_fw_ctrl_iface::sptr _fw_ctrl; + n230_fw_ctrl_iface::sptr _fw_ctrl; uhd::task::sptr _claimer_task; static boost::mutex _claimer_mutex; //All claims and checks in this process are serialized //Transport - uint8_t _last_host_enpoint; + uint8_t _last_host_enpoint; //Radio settings interface radio_ctrl_core_3000::sptr _core_ctrl; |