From b40ace72dd1b940fc0ce6e4a5e06346439dd5625 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 6 Oct 2010 18:41:30 -0700 Subject: usrp1: use the transport frame sizes to calculate the max spp The max send spp is the frame size minus the alignment padding. This allows us to copy a remainder into a new buffer and always commit multiples of the alignment size (512 bytes). Reworked the managed send buffer implementation to handle the above. Uses only managed memory, and only mem-copied under the alignment. --- host/lib/usrp/usrp1/usrp1_impl.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'host/lib/usrp/usrp1/usrp1_impl.hpp') diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index f2c464610..ff4d40762 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -90,15 +90,9 @@ public: const uhd::io_type_t &, recv_mode_t, double); - static const size_t BYTES_PER_PACKET = 512*4; //under the transfer size + size_t get_max_send_samps_per_packet(void) const; - size_t get_max_send_samps_per_packet(void) const { - return BYTES_PER_PACKET/_tx_otw_type.get_sample_size()/_tx_subdev_spec.size(); - } - - size_t get_max_recv_samps_per_packet(void) const { - return BYTES_PER_PACKET/_rx_otw_type.get_sample_size()/_rx_subdev_spec.size(); - } + size_t get_max_recv_samps_per_packet(void) const; bool recv_async_msg(uhd::async_metadata_t &, double); -- cgit v1.2.3