aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/device.cpp')
-rw-r--r--host/lib/device.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp
index ca76781da..d0aa0f200 100644
--- a/host/lib/device.cpp
+++ b/host/lib/device.cpp
@@ -36,14 +36,27 @@ static size_t hash_device_addr(
//combine the hashes of sorted keys/value pairs
size_t hash = 0;
+ // The device addr can contain all sorts of stuff, which sometimes gets in
+ // the way of hashing reliably. TODO: Make this a whitelist
+ const std::vector<std::string> hash_key_blacklist = {
+ "claimed",
+ "skip_dram",
+ "skip_ddc",
+ "skip_duc"
+ };
+
if(dev_addr.has_key("resource")) {
boost::hash_combine(hash, "resource");
boost::hash_combine(hash, dev_addr["resource"]);
}
else {
- for(const std::string &key: uhd::sorted(dev_addr.keys())){
- boost::hash_combine(hash, key);
- boost::hash_combine(hash, dev_addr[key]);
+ for (const std::string &key: uhd::sorted(dev_addr.keys())) {
+ if (std::find(hash_key_blacklist.begin(),
+ hash_key_blacklist.end(),
+ key) == hash_key_blacklist.end()) {
+ boost::hash_combine(hash, key);
+ boost::hash_combine(hash, dev_addr[key]);
+ }
}
}
return hash;