aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-26 18:05:31 -0700
committerMartin Braun <martin.braun@ettus.com>2016-11-09 14:59:14 -0800
commit646f05237d68f0e79a8ea8de52c2dd9f6e38e752 (patch)
treeef81f0e0f511f19d6163cce701402e065a89ee64 /host/lib/usrp
parent9b852f5f243e5cf68662b7152b5fa331a83e55fb (diff)
downloaduhd-646f05237d68f0e79a8ea8de52c2dd9f6e38e752.tar.gz
uhd-646f05237d68f0e79a8ea8de52c2dd9f6e38e752.tar.bz2
uhd-646f05237d68f0e79a8ea8de52c2dd9f6e38e752.zip
rfnoc: Moved transport endianness as property into both_xports_t
Reviewed-By: Michael West <michael.west@ettus.com>
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/device3/device3_impl.cpp9
-rw-r--r--host/lib/usrp/device3/device3_impl.hpp4
-rw-r--r--host/lib/usrp/device3/device3_io_impl.cpp8
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp4
-rw-r--r--host/lib/usrp/x300/x300_impl.hpp3
5 files changed, 11 insertions, 17 deletions
diff --git a/host/lib/usrp/device3/device3_impl.cpp b/host/lib/usrp/device3/device3_impl.cpp
index 50598a519..589925940 100644
--- a/host/lib/usrp/device3/device3_impl.cpp
+++ b/host/lib/usrp/device3/device3_impl.cpp
@@ -105,8 +105,7 @@ void device3_impl::enumerate_rfnoc_blocks(
size_t n_blocks,
size_t base_port,
const uhd::sid_t &base_sid,
- uhd::device_addr_t transport_args,
- uhd::endianness_t endianness
+ uhd::device_addr_t transport_args
) {
// entries that are already connected to this block
uhd::sid_t ctrl_sid = base_sid;
@@ -131,7 +130,7 @@ void device3_impl::enumerate_rfnoc_blocks(
);
UHD_DEVICE3_LOG() << str(boost::format("Setting up NoC-Shell Control for port #0 (SID: %s)...") % xport.send_sid.to_pp_string_hex());
uhd::rfnoc::ctrl_iface::sptr ctrl = uhd::rfnoc::ctrl_iface::make(
- endianness == ENDIANNESS_BIG,
+ xport.endianness == uhd::ENDIANNESS_BIG,
xport.send,
xport.recv,
xport.send_sid,
@@ -160,7 +159,7 @@ void device3_impl::enumerate_rfnoc_blocks(
);
UHD_DEVICE3_LOG() << str(boost::format("Setting up NoC-Shell Control for port #%d (SID: %s)...") % port_number % xport1.send_sid.to_pp_string_hex());
uhd::rfnoc::ctrl_iface::sptr ctrl1 = uhd::rfnoc::ctrl_iface::make(
- endianness == ENDIANNESS_BIG,
+ xport1.endianness == uhd::ENDIANNESS_BIG,
xport1.send,
xport1.recv,
xport1.send_sid,
@@ -173,7 +172,7 @@ void device3_impl::enumerate_rfnoc_blocks(
make_args.base_address = xport.send_sid.get_dst();
make_args.device_index = device_index;
make_args.tree = subtree;
- make_args.is_big_endian = (endianness == ENDIANNESS_BIG);
+ make_args.is_big_endian = (xport.endianness == ENDIANNESS_BIG);
_rfnoc_block_ctrl.push_back(uhd::rfnoc::block_ctrl_base::make(make_args, noc_id));
}
}
diff --git a/host/lib/usrp/device3/device3_impl.hpp b/host/lib/usrp/device3/device3_impl.hpp
index 117e4af1c..c496b5105 100644
--- a/host/lib/usrp/device3/device3_impl.hpp
+++ b/host/lib/usrp/device3/device3_impl.hpp
@@ -134,7 +134,6 @@ protected:
virtual uhd::device_addr_t get_tx_hints(size_t) { return uhd::device_addr_t(); };
virtual uhd::device_addr_t get_rx_hints(size_t) { return uhd::device_addr_t(); };
- virtual uhd::endianness_t get_transport_endianness(size_t mb_index) = 0;
//! Is called after a streamer is generated
virtual void post_streamer_hooks(uhd::direction_t) {};
@@ -167,8 +166,7 @@ protected:
size_t n_blocks,
size_t base_port,
const uhd::sid_t &base_sid,
- uhd::device_addr_t transport_args,
- uhd::endianness_t endianness
+ uhd::device_addr_t transport_args
);
/***********************************************************************
diff --git a/host/lib/usrp/device3/device3_io_impl.cpp b/host/lib/usrp/device3/device3_io_impl.cpp
index 4ec14c43b..a490ae5b4 100644
--- a/host/lib/usrp/device3/device3_io_impl.cpp
+++ b/host/lib/usrp/device3/device3_io_impl.cpp
@@ -571,7 +571,7 @@ rx_streamer::sptr device3_impl::get_rx_stream(const stream_args_t &args_)
//init some streamer stuff
std::string conv_endianness;
- if (get_transport_endianness(mb_index) == ENDIANNESS_BIG) {
+ if (xport.endianness == ENDIANNESS_BIG) {
my_streamer->set_vrt_unpacker(&vrt::chdr::if_hdr_unpack_be);
conv_endianness = "be";
} else {
@@ -624,7 +624,7 @@ rx_streamer::sptr device3_impl::get_rx_stream(const stream_args_t &args_)
&handle_rx_flowctrl,
xport.send_sid,
xport.send,
- get_transport_endianness(mb_index),
+ xport.endianness,
fc_cache,
_1
),
@@ -761,7 +761,7 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t &args_)
//init some streamer stuff
std::string conv_endianness;
- if (get_transport_endianness(mb_index) == ENDIANNESS_BIG) {
+ if (xport.endianness == ENDIANNESS_BIG) {
my_streamer->set_vrt_packer(&vrt::chdr::if_hdr_pack_be);
conv_endianness = "be";
} else {
@@ -809,7 +809,7 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t &args_)
&handle_tx_async_msgs,
fc_cache,
xport.recv,
- get_transport_endianness(mb_index),
+ xport.endianness,
tick_rate_retriever
)
);
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 959245135..548f7bd9c 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -942,8 +942,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
n_rfnoc_blocks,
X300_XB_DST_PCI + 1, /* base port */
uhd::sid_t(X300_SRC_ADDR0, 0, X300_DST_ADDR + mb_i, 0),
- dev_addr,
- mb.if_pkt_is_big_endian ? ENDIANNESS_BIG : ENDIANNESS_LITTLE
+ dev_addr
);
//////////////// RFNOC /////////////////
@@ -1063,6 +1062,7 @@ uhd::both_xports_t x300_impl::make_transport(
zero_copy_xport_params default_buff_args;
both_xports_t xports;
+ xports.endianness = mb.if_pkt_is_big_endian ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
if (mb.xport_path == "nirio") {
xports.send_sid = this->allocate_sid(mb, address, X300_SRC_ADDR0, X300_XB_DST_PCI);
xports.recv_sid = xports.send_sid.reversed();
diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp
index ff18b1a22..3ae37b54a 100644
--- a/host/lib/usrp/x300/x300_impl.hpp
+++ b/host/lib/usrp/x300/x300_impl.hpp
@@ -277,9 +277,6 @@ private:
/// More IO stuff
uhd::device_addr_t get_tx_hints(size_t mb_index);
uhd::device_addr_t get_rx_hints(size_t mb_index);
- uhd::endianness_t get_transport_endianness(size_t mb_index) {
- return _mb[mb_index].if_pkt_is_big_endian ? uhd::ENDIANNESS_BIG : uhd::ENDIANNESS_LITTLE;
- };
void post_streamer_hooks(uhd::direction_t dir);
};