aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200/b200_io_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-04-27 16:17:30 -0700
committerMartin Braun <martin.braun@ettus.com>2015-04-27 16:17:30 -0700
commitc3b384feb166013bfd31a6f42d5fc4a06341b67e (patch)
treeda0543dfc978a9dd6aa8106cb2d1a579b5d46368 /host/lib/usrp/b200/b200_io_impl.cpp
parent1cf3ac765cdfb80cebd375d527eae0a00fce83c6 (diff)
parent0e1bba1ae05aa3edff65eddfc174d98d64fa1f42 (diff)
downloaduhd-c3b384feb166013bfd31a6f42d5fc4a06341b67e.tar.gz
uhd-c3b384feb166013bfd31a6f42d5fc4a06341b67e.tar.bz2
uhd-c3b384feb166013bfd31a6f42d5fc4a06341b67e.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/b200/b200_io_impl.cpp')
-rw-r--r--host/lib/usrp/b200/b200_io_impl.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp
index 52a90a623..61bcc5f64 100644
--- a/host/lib/usrp/b200/b200_io_impl.cpp
+++ b/host/lib/usrp/b200/b200_io_impl.cpp
@@ -245,29 +245,31 @@ void b200_impl::update_tx_samp_rate(const size_t dspno, const double rate)
/***********************************************************************
* frontend selection
**********************************************************************/
+uhd::usrp::subdev_spec_t b200_impl::coerce_subdev_spec(const uhd::usrp::subdev_spec_t &spec_)
+{
+ uhd::usrp::subdev_spec_t spec = spec_;
+ // Because of the confusing nature of the subdevs on B200
+ // with different revs, we provide a convenience override,
+ // where both A:A and A:B are mapped to A:A.
+ //
+ // Any other spec is probably illegal and will be caught by
+ // validate_subdev_spec().
+ if (spec.size() and _b200_type == B200 and spec[0].sd_name == "B") {
+ spec[0].sd_name = "A";
+ }
+ return spec;
+}
+
void b200_impl::update_subdev_spec(const std::string &tx_rx, const uhd::usrp::subdev_spec_t &spec)
{
//sanity checking
- if (spec.size()) validate_subdev_spec(_tree, spec, tx_rx);
- UHD_ASSERT_THROW(spec.size() <= _radio_perifs.size());
-
- if (spec.size() >= 1)
- {
- UHD_ASSERT_THROW(spec[0].db_name == "A");
- UHD_ASSERT_THROW(spec[0].sd_name == "A" or spec[0].sd_name == "B");
- }
- if (spec.size() == 2)
- {
- UHD_ASSERT_THROW(spec[1].db_name == "A");
- UHD_ASSERT_THROW(
- (spec[0].sd_name == "A" and spec[1].sd_name == "B") or
- (spec[0].sd_name == "B" and spec[1].sd_name == "A")
- );
+ if (spec.size()) {
+ validate_subdev_spec(_tree, spec, tx_rx);
}
std::vector<size_t> chan_to_dsp_map(spec.size(), 0);
for (size_t i = 0; i < spec.size(); i++) {
- chan_to_dsp_map[i] = (spec[i].sd_name == "A") ? 0 : 1;
+ chan_to_dsp_map[i] = (spec[i].sd_name == "A") ? 0 : 1;
}
_tree->access<std::vector<size_t> >("/mboards/0" / (tx_rx + "_chan_dsp_mapping")).set(chan_to_dsp_map);