aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidush <vidush.vishwanath@ettus.com>2018-07-09 10:36:19 -0700
committerMartin Braun <martin.braun@ettus.com>2018-07-12 15:48:22 -0700
commitdcd76b9e20b900d2da3ca8d6f32ad99c69e4e40f (patch)
treed2f63044c876e94df424171af95c1f0ca3562e37
parentd6f1ff717d702a0a2f7351e61a048c1c2d1ab779 (diff)
downloaduhd-dcd76b9e20b900d2da3ca8d6f32ad99c69e4e40f.tar.gz
uhd-dcd76b9e20b900d2da3ca8d6f32ad99c69e4e40f.tar.bz2
uhd-dcd76b9e20b900d2da3ca8d6f32ad99c69e4e40f.zip
B200: Check if recv_frame_size is larger than minimum value
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp8
-rw-r--r--host/lib/usrp/b200/b200_impl.hpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index e435afaad..6642ae0a7 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -533,6 +533,14 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
<< "Requested recv_frame_size of " << device_addr["recv_frame_size"]
<< " reduced to " << recv_frame_size << ".";
}
+ // Check that recv_frame_size was set to a reasonable value.
+ if (recv_frame_size < B200_USB_DATA_MIN_RECV_FRAME_SIZE) {
+ UHD_LOGGER_WARNING("B200")
+ << "Requested recv_frame_size of " << recv_frame_size
+ << " is too small. It will be set to "
+ << B200_USB_DATA_MIN_RECV_FRAME_SIZE << ".";
+ recv_frame_size = B200_USB_DATA_MIN_RECV_FRAME_SIZE;
+ }
data_xport_args["recv_frame_size"] = std::to_string(recv_frame_size);
data_xport_args["num_recv_frames"] = device_addr.get("num_recv_frames", "16");
data_xport_args["send_frame_size"] = device_addr.get("send_frame_size", std::to_string(B200_USB_DATA_DEFAULT_FRAME_SIZE));
diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp
index 5b4a03694..2e7ab176f 100644
--- a/host/lib/usrp/b200/b200_impl.hpp
+++ b/host/lib/usrp/b200/b200_impl.hpp
@@ -82,6 +82,8 @@ static const unsigned char B200_USB_DATA_SEND_ENDPOINT = 2;
// Default recv_frame_size. Must not be a multiple of 512.
static const int B200_USB_DATA_DEFAULT_FRAME_SIZE = 8176;
+// recv_frame_size values below this will be upped to this value
+static const int B200_USB_DATA_MIN_RECV_FRAME_SIZE = 40;
/*
* VID/PID pairs for all B2xx products