summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-11 17:57:59 -0800
committerJosh Blum <josh@joshknows.com>2010-11-11 17:57:59 -0800
commit258d9bb45fbe7a0fa246f860eee7bf3e3b978fe3 (patch)
tree68bb69d2b8500ba9b7c3526a7953902aa78795e0 /host
parent476afe68f5c37a3e10a1208b0150732d7770a023 (diff)
downloaduhd-258d9bb45fbe7a0fa246f860eee7bf3e3b978fe3.tar.gz
uhd-258d9bb45fbe7a0fa246f860eee7bf3e3b978fe3.tar.bz2
uhd-258d9bb45fbe7a0fa246f860eee7bf3e3b978fe3.zip
usrp-n: populated name properties to use the generated cname from iface
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/codec_impl.cpp18
-rw-r--r--host/lib/usrp/usrp2/dboard_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/dsp_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp10
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp2
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp4
6 files changed, 28 insertions, 14 deletions
diff --git a/host/lib/usrp/usrp2/codec_impl.cpp b/host/lib/usrp/usrp2/codec_impl.cpp
index 5f4937643..998d55297 100644
--- a/host/lib/usrp/usrp2/codec_impl.cpp
+++ b/host/lib/usrp/usrp2/codec_impl.cpp
@@ -59,7 +59,21 @@ void usrp2_mboard_impl::rx_codec_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<codec_prop_t>()){
case CODEC_PROP_NAME:
- val = std::string("usrp2 adc");
+ switch(_iface->get_rev()){
+ case usrp2_iface::USRP_N200:
+ case usrp2_iface::USRP_N210:
+ val = std::string(_iface->get_cname() + " adc - ads62p44");
+ break;
+
+ case usrp2_iface::USRP2_REV3:
+ case usrp2_iface::USRP2_REV4:
+ val = std::string(_iface->get_cname() + " adc - ltc2284");
+ break;
+
+ case usrp2_iface::USRP_NXXX:
+ val = std::string(_iface->get_cname() + " adc - ??????");
+ break;
+ }
return;
case CODEC_PROP_OTHERS:
@@ -139,7 +153,7 @@ void usrp2_mboard_impl::tx_codec_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<codec_prop_t>()){
case CODEC_PROP_NAME:
- val = std::string("usrp2 dac - ad9777");
+ val = std::string(_iface->get_cname() + " dac - ad9777");
return;
case CODEC_PROP_OTHERS:
diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp
index 540c9fefb..f839a4058 100644
--- a/host/lib/usrp/usrp2/dboard_impl.cpp
+++ b/host/lib/usrp/usrp2/dboard_impl.cpp
@@ -64,7 +64,7 @@ void usrp2_mboard_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<dboard_prop_t>()){
case DBOARD_PROP_NAME:
- val = std::string("usrp2 dboard (rx unit)");
+ val = std::string(_iface->get_cname() + " dboard (rx unit)");
return;
case DBOARD_PROP_SUBDEV:
@@ -121,7 +121,7 @@ void usrp2_mboard_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<dboard_prop_t>()){
case DBOARD_PROP_NAME:
- val = std::string("usrp2 dboard (tx unit)");
+ val = std::string(_iface->get_cname() + " dboard (tx unit)");
return;
case DBOARD_PROP_SUBDEV:
diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp
index c8da03955..243a8e905 100644
--- a/host/lib/usrp/usrp2/dsp_impl.cpp
+++ b/host/lib/usrp/usrp2/dsp_impl.cpp
@@ -61,7 +61,7 @@ void usrp2_mboard_impl::ddc_get(const wax::obj &key_, wax::obj &val){
switch(key.as<dsp_prop_t>()){
case DSP_PROP_NAME:
- val = std::string("usrp2 ddc0");
+ val = std::string(_iface->get_cname() + " ddc0");
return;
case DSP_PROP_OTHERS:
@@ -144,7 +144,7 @@ void usrp2_mboard_impl::duc_get(const wax::obj &key_, wax::obj &val){
switch(key.as<dsp_prop_t>()){
case DSP_PROP_NAME:
- val = std::string("usrp2 duc0");
+ val = std::string(_iface->get_cname() + " duc0");
return;
case DSP_PROP_OTHERS:
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 5b47045e2..3df89d327 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -133,14 +133,14 @@ void usrp2_mboard_impl::update_clock_config(void){
switch(_clock_config.pps_source){
case clock_config_t::PPS_SMA: pps_flags |= U2_FLAG_TIME64_PPS_SMA; break;
case clock_config_t::PPS_MIMO: pps_flags |= U2_FLAG_TIME64_PPS_MIMO; break;
- default: throw std::runtime_error("usrp2: unhandled clock configuration pps source");
+ default: throw std::runtime_error("unhandled clock configuration pps source");
}
//translate pps polarity enums
switch(_clock_config.pps_polarity){
case clock_config_t::PPS_POS: pps_flags |= U2_FLAG_TIME64_PPS_POSEDGE; break;
case clock_config_t::PPS_NEG: pps_flags |= U2_FLAG_TIME64_PPS_NEGEDGE; break;
- default: throw std::runtime_error("usrp2: unhandled clock configuration pps polarity");
+ default: throw std::runtime_error("unhandled clock configuration pps polarity");
}
//set the pps flags
@@ -154,7 +154,7 @@ void usrp2_mboard_impl::update_clock_config(void){
case clock_config_t::REF_INT : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x12); break;
case clock_config_t::REF_SMA : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x1C); break;
case clock_config_t::REF_MIMO: _iface->poke32(_iface->regs.misc_ctrl_clock, 0x15); break;
- default: throw std::runtime_error("usrp2: unhandled clock configuration reference source");
+ default: throw std::runtime_error("unhandled clock configuration reference source");
}
_clock_ctrl->enable_external_ref(true); //USRP2P has an internal 10MHz TCXO
break;
@@ -165,7 +165,7 @@ void usrp2_mboard_impl::update_clock_config(void){
case clock_config_t::REF_INT : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x10); break;
case clock_config_t::REF_SMA : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x1C); break;
case clock_config_t::REF_MIMO: _iface->poke32(_iface->regs.misc_ctrl_clock, 0x15); break;
- default: throw std::runtime_error("usrp2: unhandled clock configuration reference source");
+ default: throw std::runtime_error("unhandled clock configuration reference source");
}
_clock_ctrl->enable_external_ref(_clock_config.ref_source != clock_config_t::REF_INT);
break;
@@ -212,7 +212,7 @@ void usrp2_mboard_impl::get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<mboard_prop_t>()){
case MBOARD_PROP_NAME:
- val = str(boost::format("usrp2 mboard%d - rev %s") % _index % _iface->mb_eeprom["rev"]);
+ val = _iface->get_cname() + " mboard";
return;
case MBOARD_PROP_OTHERS:
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 01df68010..7208a47cf 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -269,7 +269,7 @@ public:
if (len == 0) break; //timeout
//didnt get seq or bad packet, continue looking...
}
- throw std::runtime_error("usrp2 no control response");
+ throw std::runtime_error(this->get_cname() + ": no control response");
}
rev_type get_rev(void){
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 01a753d9e..42fe9c018 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -214,8 +214,8 @@ void usrp2_impl::get(const wax::obj &key_, wax::obj &val){
//handle the get request conditioned on the key
switch(key.as<device_prop_t>()){
case DEVICE_PROP_NAME:
- if (_mboards.size() > 1) val = std::string("usrp2 mimo device");
- else val = std::string("usrp2 device");
+ if (_mboards.size() > 1) val = std::string("USRP-NXXX mimo device");
+ else val = std::string("USRP-NXXX device");
return;
case DEVICE_PROP_MBOARD: