aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100/b100_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/b100/b100_impl.cpp')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 138d328aa..305ba42a7 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2012 Ettus Research LLC
+// Copyright 2012-2013 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -188,12 +188,27 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
ctrl_xport_args["send_frame_size"] = "512";
ctrl_xport_args["num_send_frames"] = "16";
- _ctrl_transport = usb_zero_copy::make(
- handle,
- 4, 8, //interface, endpoint
- 3, 4, //interface, endpoint
- ctrl_xport_args
- );
+ //try to open ctrl transport
+ //this could fail with libusb_submit_transfer under some conditions
+ try{
+ _ctrl_transport = usb_zero_copy::make(
+ handle,
+ 4, 8, //interface, endpoint
+ 3, 4, //interface, endpoint
+ ctrl_xport_args
+ );
+ }
+ //try reset once in the case of failure
+ catch(const uhd::exception &ex){
+ if (initialization_count > 1) throw;
+ UHD_MSG(warning) <<
+ "The control endpoint was left in a bad state.\n"
+ "Attempting endpoint re-enumeration...\n" << ex.what() << std::endl;
+ _fifo_ctrl.reset();
+ _ctrl_transport.reset();
+ _fx2_ctrl->usrp_fx2_reset();
+ goto b100_impl_constructor_begin;
+ }
this->enable_gpif(true);
////////////////////////////////////////////////////////////////////
@@ -245,7 +260,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
const size_t rx_lut_size = size_t(data_xport_args.cast<double>("recv_frame_size", 0.0));
_fifo_ctrl->poke32(TOREG(SR_PADDER+0), rx_lut_size/sizeof(boost::uint32_t));
- _data_transport = usb_zero_copy::make_wrapper(
+ _data_transport = usb_zero_copy_make_wrapper(
usb_zero_copy::make(
handle, // identifier
2, 6, // IN interface, endpoint
@@ -474,7 +489,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
}
//initialize io handling
- _recv_demuxer = recv_packet_demuxer::make(_data_transport, _rx_dsps.size(), B100_RX_SID_BASE);
+ _recv_demuxer.reset(new recv_packet_demuxer_3000(_data_transport));
//allocate streamer weak ptrs containers
_rx_streamers.resize(_rx_dsps.size());
@@ -518,6 +533,7 @@ void b100_impl::check_fw_compat(void){
"%s"
) % B100_FW_COMPAT_NUM % fw_compat_num % print_images_error()));
}
+ _tree->create<std::string>("/mboards/0/fw_version").set(str(boost::format("%u.0") % fw_compat_num));
}
void b100_impl::check_fpga_compat(void){