diff options
author | Josh Blum <josh@joshknows.com> | 2010-12-17 13:46:31 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-12-17 13:46:31 -0800 |
commit | 37365d1c93ad330a71fa2f6640fe9ce9a7aedad8 (patch) | |
tree | e00f806a6af91d3b66ea125cfc55976a8e727b2a | |
parent | 0e66165d43d896bbc263dcf3481b94450d7de89f (diff) | |
download | uhd-37365d1c93ad330a71fa2f6640fe9ce9a7aedad8.tar.gz uhd-37365d1c93ad330a71fa2f6640fe9ce9a7aedad8.tar.bz2 uhd-37365d1c93ad330a71fa2f6640fe9ce9a7aedad8.zip |
udp_ports: host code tweaks, seems to be closer to working
-rw-r--r-- | host/lib/usrp/usrp2/fw_common.h | 5 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 13 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h index a26f56e8b..29c2a8484 100644 --- a/host/lib/usrp/usrp2/fw_common.h +++ b/host/lib/usrp/usrp2/fw_common.h @@ -42,8 +42,9 @@ extern "C" { // udp ports for the usrp2 communication // Dynamic and/or private ports: 49152-65535 #define USRP2_UDP_CTRL_PORT 49152 -#define USRP2_UDP_DATA_PORT 49153 -#define USRP2_UDP_ERR0_PORT 49154 +//#define USRP2_UDP_UPDATE_PORT 49154 +#define USRP2_UDP_DATA_PORT 49156 +#define USRP2_UDP_ERR0_PORT 49157 //////////////////////////////////////////////////////////////////////// // I2C addresses diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index c8e4b7096..fbab0202a 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -121,7 +121,7 @@ struct usrp2_impl::io_impl{ )); //init empty packet infos vrt::if_packet_info_t packet_info; - packet_info.packet_count = 0; + packet_info.packet_count = 0xf; packet_info.has_tsi = true; packet_info.tsi = 0; packet_info.has_tsf = true; @@ -157,7 +157,7 @@ struct usrp2_impl::io_impl{ } bool get_recv_buffs( - const std::vector<zero_copy_if::sptr> xports, + const std::vector<zero_copy_if::sptr> &xports, vrt_packet_handler::managed_recv_buffs_t &buffs, double timeout ); @@ -330,7 +330,9 @@ static UHD_INLINE double from_time_dur(const boost::posix_time::time_duration &t return 1e-6*time_dur.total_microseconds(); } -static UHD_INLINE time_spec_t extract_time_spec(const vrt::if_packet_info_t &packet_info){ +static UHD_INLINE time_spec_t extract_time_spec( + const vrt::if_packet_info_t &packet_info +){ return time_spec_t( //assumes has_tsi and has_tsf are true time_t(packet_info.tsi), size_t(packet_info.tsf), 100e6 //tick rate does not have to be correct for comparison purposes @@ -338,12 +340,13 @@ static UHD_INLINE time_spec_t extract_time_spec(const vrt::if_packet_info_t &pac } static UHD_INLINE void extract_packet_info( - managed_recv_buffer::sptr buff, + managed_recv_buffer::sptr &buff, vrt::if_packet_info_t &prev_info, time_spec_t &time, bool &clear ){ //extract packet info vrt::if_packet_info_t next_info; + next_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); vrt::if_hdr_unpack_be(buff->cast<const boost::uint32_t *>(), next_info); //handle the packet count / sequence number @@ -357,7 +360,7 @@ static UHD_INLINE void extract_packet_info( } UHD_INLINE bool usrp2_impl::io_impl::get_recv_buffs( - const std::vector<zero_copy_if::sptr> xports, + const std::vector<zero_copy_if::sptr> &xports, vrt_packet_handler::managed_recv_buffs_t &buffs, double timeout ){ diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index ca4a463b7..3f8da5fda 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -212,7 +212,7 @@ sep_indexed_dev_addrs(device_addr); dev_addr_i["addr"], num2str(USRP2_UDP_DATA_PORT), device_addr )); err0_transports.push_back(udp_zero_copy::make( - dev_addr_i["addr"], num2str(USRP2_UDP_ERR0_PORT), device_addr + dev_addr_i["addr"], num2str(USRP2_UDP_ERR0_PORT), device_addr_t() )); } |