aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200
diff options
context:
space:
mode:
authorBalint Seeber <balint@ettus.com>2013-11-20 20:10:14 -0800
committerBalint Seeber <balint@ettus.com>2013-11-20 20:10:14 -0800
commit7788c69225f68f67b95a5f778c7b45adf9cc046f (patch)
treed681aea5e057c4af63225b2b3c64dc871bb7dab5 /host/lib/usrp/b200
parent8c79e285b0f4b6b80f8ae1fe69a5288d2b4d0194 (diff)
downloaduhd-7788c69225f68f67b95a5f778c7b45adf9cc046f.tar.gz
uhd-7788c69225f68f67b95a5f778c7b45adf9cc046f.tar.bz2
uhd-7788c69225f68f67b95a5f778c7b45adf9cc046f.zip
b200: fix loopback transfer timeout when operating at USB2release_003_006_001
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r--host/lib/usrp/b200/b200_iface.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp
index a8e96f4ac..bb46fbfce 100644
--- a/host/lib/usrp/b200/b200_iface.cpp
+++ b/host/lib/usrp/b200/b200_iface.cpp
@@ -505,7 +505,8 @@ public:
unsigned char out_buff[VREQ_MAX_SIZE];
// Request loopback read, which will indicate the firmware's current control request buffer size
- int nread = fx3_control_read(B200_VREQ_LOOP, 0, 0, out_buff, sizeof(out_buff), 1000);
+ // Make sure that if operating as USB2, requested length is within spec
+ int nread = fx3_control_read(B200_VREQ_LOOP, 0, 0, out_buff, std::min(transfer_size, (int)sizeof(out_buff)), 1000);
if (nread <= 0)
throw uhd::io_error("load_fpga: unable to complete firmware loopback request.");
transfer_size = std::min(transfer_size, nread); // Select the smaller value