aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2020-09-24 13:05:34 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-05 12:02:05 -0500
commit8fea36aa81195d758a29067141afdc4becefe5ae (patch)
tree4f0d411d872355726b7a88c6632a7646425c2587 /host/lib/usrp/x300
parent75fe86a92bfbd037545afdafd2677f390eccefa5 (diff)
downloaduhd-8fea36aa81195d758a29067141afdc4becefe5ae.tar.gz
uhd-8fea36aa81195d758a29067141afdc4becefe5ae.tar.bz2
uhd-8fea36aa81195d758a29067141afdc4becefe5ae.zip
lib: disable non pcie types in find with resource
mpmd find doesn't respect the "resource" arg hint and can be detected when "resource" is set. This results in incorrect device selection when using PCIe. This change adds detection for "resource" as a prefix in the device hints for mpmd and the other devices.
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index fa8425fac..663b951a1 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -100,7 +100,9 @@ device_addrs_t x300_find(const device_addr_t& hint_)
return reply_addrs;
}
- if (!hint.has_key("resource")) {
+ bool has_resource_key = hint.has_key_with_prefix("resource");
+
+ if (!has_resource_key) {
// otherwise, no address was specified, send a broadcast on each interface
for (const transport::if_addrs_t& if_addrs : transport::get_if_addrs()) {
// avoid the loopback device
@@ -135,7 +137,7 @@ device_addrs_t x300_find(const device_addr_t& hint_)
}
}
- device_addrs_t pcie_addrs = pcie_manager::find(hint, hint.has_key("resource"));
+ device_addrs_t pcie_addrs = pcie_manager::find(hint, has_resource_key);
if (not pcie_addrs.empty()) {
addrs.insert(addrs.end(), pcie_addrs.begin(), pcie_addrs.end());
}