diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-09 18:38:27 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-09 18:38:27 -0800 |
commit | 073518083f2c7044d4b0c16948a192c5623d0752 (patch) | |
tree | 9d556497c1f6a1fae7356a4b34fe52371d94d162 /host | |
parent | 7824f130bd1296c78f5b0311d1c253f0476c6cab (diff) | |
download | uhd-073518083f2c7044d4b0c16948a192c5623d0752.tar.gz uhd-073518083f2c7044d4b0c16948a192c5623d0752.tar.bz2 uhd-073518083f2c7044d4b0c16948a192c5623d0752.zip |
usrp_e: use the transport to calculate the max spp (with a fix to init the xport first)
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/usrp_e/io_impl.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/usrp_e_impl.hpp | 5 |
2 files changed, 3 insertions, 11 deletions
diff --git a/host/lib/usrp/usrp_e/io_impl.cpp b/host/lib/usrp/usrp_e/io_impl.cpp index 9996e7172..e863944e8 100644 --- a/host/lib/usrp/usrp_e/io_impl.cpp +++ b/host/lib/usrp/usrp_e/io_impl.cpp @@ -150,6 +150,9 @@ void usrp_e_impl::io_init(void){ _recv_otw_type.shift = 0; _recv_otw_type.byteorder = otw_type_t::BO_LITTLE_ENDIAN; + //setup before the registers (transport called to calculate max spp) + _io_impl = UHD_PIMPL_MAKE(io_impl, (_iface)); + //setup rx data path _iface->poke32(UE_REG_CTRL_RX_NSAMPS_PER_PKT, get_max_recv_samps_per_packet()); _iface->poke32(UE_REG_CTRL_RX_NCHANNELS, 1); @@ -167,8 +170,6 @@ void usrp_e_impl::io_init(void){ _iface->poke32(UE_REG_CTRL_TX_REPORT_SID, tx_async_report_sid); _iface->poke32(UE_REG_CTRL_TX_POLICY, UE_FLAG_CTRL_TX_POLICY_NEXT_PACKET); - _io_impl = UHD_PIMPL_MAKE(io_impl, (_iface)); - //spawn a pirate, yarrr! _io_impl->recv_pirate_crew.create_thread(boost::bind( &usrp_e_impl::io_impl::recv_pirate_loop, _io_impl.get(), _clock_ctrl @@ -204,7 +205,6 @@ bool get_send_buffs( return buffs[0].get() != NULL; } -#if 0 size_t usrp_e_impl::get_max_send_samps_per_packet(void) const{ static const size_t hdr_size = 0 + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) @@ -213,7 +213,6 @@ size_t usrp_e_impl::get_max_send_samps_per_packet(void) const{ size_t bpp = _io_impl->data_xport->get_send_frame_size() - hdr_size; return bpp/_send_otw_type.get_sample_size(); } -#endif size_t usrp_e_impl::send( const std::vector<const void *> &buffs, size_t num_samps, @@ -235,7 +234,6 @@ size_t usrp_e_impl::send( /*********************************************************************** * Data Recv **********************************************************************/ -#if 0 size_t usrp_e_impl::get_max_recv_samps_per_packet(void) const{ static const size_t hdr_size = 0 + vrt::max_if_hdr_words32*sizeof(boost::uint32_t) @@ -245,7 +243,6 @@ size_t usrp_e_impl::get_max_recv_samps_per_packet(void) const{ size_t bpp = _io_impl->data_xport->get_recv_frame_size() - hdr_size; return bpp/_recv_otw_type.get_sample_size(); } -#endif size_t usrp_e_impl::recv( const std::vector<void *> &buffs, size_t num_samps, diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.hpp b/host/lib/usrp/usrp_e/usrp_e_impl.hpp index e55b46b80..b5f21810d 100644 --- a/host/lib/usrp/usrp_e/usrp_e_impl.hpp +++ b/host/lib/usrp/usrp_e/usrp_e_impl.hpp @@ -86,13 +86,8 @@ public: size_t send(const std::vector<const void *> &, size_t, const uhd::tx_metadata_t &, const uhd::io_type_t &, send_mode_t, double); size_t recv(const std::vector<void *> &, size_t, uhd::rx_metadata_t &, const uhd::io_type_t &, recv_mode_t, double); bool recv_async_msg(uhd::async_metadata_t &, double); -#if 0 size_t get_max_send_samps_per_packet(void) const; size_t get_max_recv_samps_per_packet(void) const; -#else - size_t get_max_send_samps_per_packet(void) const{return 503;} - size_t get_max_recv_samps_per_packet(void) const{return 503;} -#endif private: //interface to ioctls and file descriptor |