aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1/usrp1_impl.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-06 18:41:30 -0700
committerJosh Blum <josh@joshknows.com>2010-10-06 18:41:30 -0700
commitb40ace72dd1b940fc0ce6e4a5e06346439dd5625 (patch)
treefbf22e843529d475f8a4b9f028cb1b0462a9327d /host/lib/usrp/usrp1/usrp1_impl.hpp
parent7c127b6c82db773ca2dcab372ab28b4dc4e5b347 (diff)
downloaduhd-b40ace72dd1b940fc0ce6e4a5e06346439dd5625.tar.gz
uhd-b40ace72dd1b940fc0ce6e4a5e06346439dd5625.tar.bz2
uhd-b40ace72dd1b940fc0ce6e4a5e06346439dd5625.zip
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.
Diffstat (limited to 'host/lib/usrp/usrp1/usrp1_impl.hpp')
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp10
1 files changed, 2 insertions, 8 deletions
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);