aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_mb_eeprom.cpp
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_mb_eeprom.cpp
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_mb_eeprom.cpp')
-rw-r--r--host/lib/usrp/x300/x300_mb_eeprom.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/host/lib/usrp/x300/x300_mb_eeprom.cpp b/host/lib/usrp/x300/x300_mb_eeprom.cpp
index 663f4c9db..54505a43d 100644
--- a/host/lib/usrp/x300/x300_mb_eeprom.cpp
+++ b/host/lib/usrp/x300/x300_mb_eeprom.cpp
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include "x300_impl.hpp"
+#include "x300_mb_eeprom.hpp"
#include <uhd/types/serial.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhdlib/utils/eeprom_utils.hpp>
@@ -41,7 +41,7 @@ struct x300_eeprom_map
using namespace uhd;
using uhd::usrp::mboard_eeprom_t;
-mboard_eeprom_t x300_impl::get_mb_eeprom(uhd::i2c_iface::sptr iface)
+mboard_eeprom_t uhd::usrp::x300::get_mb_eeprom(uhd::i2c_iface::sptr iface)
{
byte_vector_t bytes =
iface->read_eeprom(X300_EEPROM_ADDR, 0, sizeof(struct x300_eeprom_map));
@@ -110,9 +110,10 @@ mboard_eeprom_t x300_impl::get_mb_eeprom(uhd::i2c_iface::sptr iface)
return mb_eeprom;
}
-void x300_impl::set_mb_eeprom(i2c_iface::sptr iface, const mboard_eeprom_t& mb_eeprom)
+void uhd::usrp::x300::set_mb_eeprom(
+ i2c_iface::sptr iface, const mboard_eeprom_t& mb_eeprom)
{
- const mboard_eeprom_t curr_eeprom = get_mb_eeprom(iface);
+ const mboard_eeprom_t curr_eeprom = uhd::usrp::x300::get_mb_eeprom(iface);
// Check for duplicate MAC and IP addresses
const std::vector<std::string> mac_keys{"mac-addr0", "mac-addr1"};