From 13f1dc28f162c74cc0eac6673d3c12d5195238d1 Mon Sep 17 00:00:00 2001 From: michael-west Date: Sat, 6 Feb 2021 14:34:19 -0800 Subject: mpmd: Skip find if "resource" key is specified MPM devices were being discovered when trying to locate PCIe connected devices. Adding filter to exclude them if the "resource" key is specified in the device address arguments. Replaces "lib: disable non pcie types in find with resource" to reduce impact to older devices and remove API change. Signed-off-by: michael-west --- host/lib/usrp/mpmd/mpmd_find.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/mpmd') diff --git a/host/lib/usrp/mpmd/mpmd_find.cpp b/host/lib/usrp/mpmd/mpmd_find.cpp index 77f7486dd..5d5aab1ba 100644 --- a/host/lib/usrp/mpmd/mpmd_find.cpp +++ b/host/lib/usrp/mpmd/mpmd_find.cpp @@ -139,6 +139,9 @@ device_addrs_t mpmd_find_with_addrs(const device_addrs_t& hints) device_addrs_t found_devices; found_devices.reserve(hints.size()); for (const auto& hint : hints) { + if (hint.has_key("resource")) { + continue; + } if (not(hint.has_key(xport::FIRST_ADDR_KEY) or hint.has_key(MGMT_ADDR_KEY))) { UHD_LOG_DEBUG("MPMD FIND", "No address given in hint " << hint.to_string()); continue; @@ -169,6 +172,9 @@ device_addrs_t mpmd_find_with_addrs(const device_addrs_t& hints) device_addrs_t mpmd_find_with_bcast(const device_addr_t& hint) { device_addrs_t addrs; + if (hint.has_key("resource")) { + return addrs; + } UHD_LOG_TRACE( "MPMD FIND", "Broadcasting on all available interfaces to find MPM devices."); std::vector> task_list; @@ -224,12 +230,6 @@ device_addrs_t mpmd_find(const device_addr_t& hint_) return {}; } } - if (hint_.has_key_with_prefix("resource")) { - UHD_LOG_TRACE( - "MPMD FIND", "Returning early, PCIe is not support with mpm devices."); - return {}; - } - UHD_LOG_TRACE("MPMD FIND", "Finding with " << hints.size() << " different hint(s)."); // Scenario 1): User gave us at least one address -- cgit v1.2.3