aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
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/usrp1
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/usrp1')
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index d86bf6d56..37bd4a4a2 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -47,9 +47,15 @@ static device_addrs_t usrp1_find(const device_addr_t& hint)
// Return an empty list of addresses when an address or resource is specified,
// since an address and resource is intended for a different, non-USB, device.
- if (hint.has_key("addr") || hint.has_key("resource"))
+ if (hint.has_key("addr"))
return usrp1_addrs;
+ if (hint.has_key_with_prefix("resource")) {
+ UHD_LOG_TRACE(
+ "USRP1 FIND", "Returning early, PCIe is not supported with usrp1 devices.");
+ return usrp1_addrs;
+ }
+
uint16_t vid, pid;
if (hint.has_key("vid") && hint.has_key("pid") && hint.has_key("type")
@@ -121,7 +127,7 @@ static device_addrs_t usrp1_find(const device_addr_t& hint)
// this is a found usrp1 when the hint serial and name match or blank
if ((not hint.has_key("name") or hint["name"] == new_addr["name"])
and (not hint.has_key("serial")
- or hint["serial"] == new_addr["serial"])) {
+ or hint["serial"] == new_addr["serial"])) {
usrp1_addrs.push_back(new_addr);
}
}