aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/n230/n230_eeprom_manager.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-31 14:30:52 -0700
committerMartin Braun <martin.braun@ettus.com>2016-11-08 08:02:22 -0800
commit99c2730bc9db270560671f2d7d173768465ed51f (patch)
treebc4df495734a075ebe2f7917cf67dec6fb7d8177 /host/lib/usrp/n230/n230_eeprom_manager.cpp
parent218f4b0b63927110df9dbbaa8353c346eee2d98a (diff)
downloaduhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.gz
uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.bz2
uhd-99c2730bc9db270560671f2d7d173768465ed51f.zip
Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with stdint.h (The 'correct' replacement would be <cstdint>, but not all of our compilers support that).
Diffstat (limited to 'host/lib/usrp/n230/n230_eeprom_manager.cpp')
-rw-r--r--host/lib/usrp/n230/n230_eeprom_manager.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/host/lib/usrp/n230/n230_eeprom_manager.cpp b/host/lib/usrp/n230/n230_eeprom_manager.cpp
index b19deb23a..d9d02c58c 100644
--- a/host/lib/usrp/n230/n230_eeprom_manager.cpp
+++ b/host/lib/usrp/n230/n230_eeprom_manager.cpp
@@ -65,13 +65,13 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom()
const n230_eeprom_map_t* map_ptr = reinterpret_cast<const n230_eeprom_map_t*>(_response.data);
const n230_eeprom_map_t& map = *map_ptr;
- uint16_t ver_major = uhd::htonx<boost::uint16_t>(map.data_version_major);
- uint16_t ver_minor = uhd::htonx<boost::uint16_t>(map.data_version_minor);
+ uint16_t ver_major = uhd::htonx<uint16_t>(map.data_version_major);
+ uint16_t ver_minor = uhd::htonx<uint16_t>(map.data_version_minor);
_mb_eeprom["product"] = boost::lexical_cast<std::string>(
- uhd::htonx<boost::uint16_t>(map.hw_product));
+ uhd::htonx<uint16_t>(map.hw_product));
_mb_eeprom["revision"] = boost::lexical_cast<std::string>(
- uhd::htonx<boost::uint16_t>(map.hw_revision));
+ uhd::htonx<uint16_t>(map.hw_revision));
//The revision_compat field does not exist in version 1.0
//EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set
//revision_compat = revision
@@ -79,20 +79,20 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom()
_mb_eeprom["revision_compat"] = _mb_eeprom["revision"];
} else {
_mb_eeprom["revision_compat"] = boost::lexical_cast<std::string>(
- uhd::htonx<boost::uint16_t>(map.hw_revision_compat));
+ uhd::htonx<uint16_t>(map.hw_revision_compat));
}
_mb_eeprom["serial"] = _bytes_to_string(
map.serial, N230_EEPROM_SERIAL_LEN);
//Extract ethernet info
_mb_eeprom["gateway"] = boost::asio::ip::address_v4(
- uhd::htonx<boost::uint32_t>(map.gateway)).to_string();
+ uhd::htonx<uint32_t>(map.gateway)).to_string();
for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) {
const std::string n(1, i+'0');
_mb_eeprom["ip-addr"+n] = boost::asio::ip::address_v4(
- uhd::htonx<boost::uint32_t>(map.eth_info[i].ip_addr)).to_string();
+ uhd::htonx<uint32_t>(map.eth_info[i].ip_addr)).to_string();
_mb_eeprom["subnet"+n] = boost::asio::ip::address_v4(
- uhd::htonx<boost::uint32_t>(map.eth_info[i].subnet)).to_string();
+ uhd::htonx<uint32_t>(map.eth_info[i].subnet)).to_string();
byte_vector_t mac_addr(map.eth_info[i].mac_addr, map.eth_info[i].mac_addr + 6);
_mb_eeprom["mac-addr"+n] = mac_addr_t::from_bytes(mac_addr).to_string();
}
@@ -117,28 +117,28 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom)
n230_eeprom_map_t& map = *map_ptr;
// Automatic version upgrade handling
- uint16_t old_ver_major = uhd::htonx<boost::uint16_t>(map.data_version_major);
- uint16_t old_ver_minor = uhd::htonx<boost::uint16_t>(map.data_version_minor);
+ uint16_t old_ver_major = uhd::htonx<uint16_t>(map.data_version_major);
+ uint16_t old_ver_minor = uhd::htonx<uint16_t>(map.data_version_minor);
//The revision_compat field does not exist for version 1.0 so force write it
//EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set
//revision_compat = revision for the upgrade
bool force_write_version_compat = (old_ver_major == 1 and old_ver_minor == 0);
- map.data_version_major = uhd::htonx<boost::uint16_t>(N230_EEPROM_VER_MAJOR);
- map.data_version_minor = uhd::htonx<boost::uint16_t>(N230_EEPROM_VER_MINOR);
+ map.data_version_major = uhd::htonx<uint16_t>(N230_EEPROM_VER_MAJOR);
+ map.data_version_minor = uhd::htonx<uint16_t>(N230_EEPROM_VER_MINOR);
if (_mb_eeprom.has_key("product")) {
- map.hw_product = uhd::htonx<boost::uint16_t>(
- boost::lexical_cast<boost::uint16_t>(_mb_eeprom["product"]));
+ map.hw_product = uhd::htonx<uint16_t>(
+ boost::lexical_cast<uint16_t>(_mb_eeprom["product"]));
}
if (_mb_eeprom.has_key("revision")) {
- map.hw_revision = uhd::htonx<boost::uint16_t>(
- boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision"]));
+ map.hw_revision = uhd::htonx<uint16_t>(
+ boost::lexical_cast<uint16_t>(_mb_eeprom["revision"]));
}
if (_mb_eeprom.has_key("revision_compat")) {
- map.hw_revision_compat = uhd::htonx<boost::uint16_t>(
- boost::lexical_cast<boost::uint16_t>(_mb_eeprom["revision_compat"]));
+ map.hw_revision_compat = uhd::htonx<uint16_t>(
+ boost::lexical_cast<uint16_t>(_mb_eeprom["revision_compat"]));
} else if (force_write_version_compat) {
map.hw_revision_compat = map.hw_revision;
}
@@ -148,17 +148,17 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom)
//Push ethernet info
if (_mb_eeprom.has_key("gateway")){
- map.gateway = uhd::htonx<boost::uint32_t>(
+ map.gateway = uhd::htonx<uint32_t>(
boost::asio::ip::address_v4::from_string(_mb_eeprom["gateway"]).to_ulong());
}
for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) {
const std::string n(1, i+'0');
if (_mb_eeprom.has_key("ip-addr"+n)){
- map.eth_info[i].ip_addr = uhd::htonx<boost::uint32_t>(
+ map.eth_info[i].ip_addr = uhd::htonx<uint32_t>(
boost::asio::ip::address_v4::from_string(_mb_eeprom["ip-addr"+n]).to_ulong());
}
if (_mb_eeprom.has_key("subnet"+n)){
- map.eth_info[i].subnet = uhd::htonx<boost::uint32_t>(
+ map.eth_info[i].subnet = uhd::htonx<uint32_t>(
boost::asio::ip::address_v4::from_string(_mb_eeprom["subnet"+n]).to_ulong());
}
if (_mb_eeprom.has_key("mac-addr"+n)) {
@@ -175,11 +175,11 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom)
_transact(N230_FLASH_COMM_CMD_WRITE_NV_DATA);
}
-void n230_eeprom_manager::_transact(const boost::uint32_t command)
+void n230_eeprom_manager::_transact(const uint32_t command)
{
//Load request struct
- _request.flags = uhd::htonx<boost::uint32_t>(N230_FLASH_COMM_FLAGS_ACK | command);
- _request.seq = uhd::htonx<boost::uint32_t>(_seq_num++);
+ _request.flags = uhd::htonx<uint32_t>(N230_FLASH_COMM_FLAGS_ACK | command);
+ _request.seq = uhd::htonx<uint32_t>(_seq_num++);
//Send request
_flush_xport();
@@ -190,7 +190,7 @@ void n230_eeprom_manager::_transact(const boost::uint32_t command)
if (nbytes == 0) throw uhd::io_error("n230_eeprom_manager::_transact failure");
//Sanity checks
- const size_t flags = uhd::ntohx<boost::uint32_t>(_response.flags);
+ const size_t flags = uhd::ntohx<uint32_t>(_response.flags);
UHD_ASSERT_THROW(nbytes == sizeof(_response));
UHD_ASSERT_THROW(_response.seq == _request.seq);
UHD_ASSERT_THROW(flags & command);