aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_claim.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-07-25 10:41:25 -0700
committerMartin Braun <martin.braun@ettus.com>2019-08-02 11:03:11 -0700
commit173531521970ed823b2f300180b8cacda94ec841 (patch)
treedf23a21876e4430ae2b232499af5626189b819a3 /host/lib/usrp/x300/x300_claim.hpp
parente2ce13e35d915c2d8b1300fd88745610c17638d1 (diff)
downloaduhd-173531521970ed823b2f300180b8cacda94ec841.tar.gz
uhd-173531521970ed823b2f300180b8cacda94ec841.tar.bz2
uhd-173531521970ed823b2f300180b8cacda94ec841.zip
x300: Refactor heavily
This pulls out a lot of code from x300_impl and puts it into its own compilation units: - EEPROM code goes to x300_mb_eeprom.* - Claim code goes to x300_claim.* - PCIe code goes to uhd::usrp::x300::pcie_manager - Ethernet code goes to uhd::usrp::x300::eth_manager
Diffstat (limited to 'host/lib/usrp/x300/x300_claim.hpp')
-rw-r--r--host/lib/usrp/x300/x300_claim.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/x300_claim.hpp b/host/lib/usrp/x300/x300_claim.hpp
new file mode 100644
index 000000000..bd222f55e
--- /dev/null
+++ b/host/lib/usrp/x300/x300_claim.hpp
@@ -0,0 +1,25 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#ifndef INCLUDED_X300_CLAIM_HPP
+#define INCLUDED_X300_CLAIM_HPP
+
+#include <uhd/types/wb_iface.hpp>
+
+namespace uhd { namespace usrp { namespace x300 {
+
+// device claim functions
+enum claim_status_t { UNCLAIMED, CLAIMED_BY_US, CLAIMED_BY_OTHER };
+
+claim_status_t claim_status(uhd::wb_iface::sptr iface);
+void claimer_loop(uhd::wb_iface::sptr iface);
+void claim(uhd::wb_iface::sptr iface);
+bool try_to_claim(uhd::wb_iface::sptr iface, long timeout = 2000);
+void release(uhd::wb_iface::sptr iface);
+
+}}} // namespace uhd::usrp::x300
+
+#endif /* INCLUDED_X300_CLAIM_HPP */