[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 29/148: cleanup stuff
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 29/148: cleanup stuff |
Date: |
Mon, 15 Aug 2016 00:47:21 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit cfedec528ada129ef6bc0699f8c8d93fe793b66f
Author: Josh Blum <address@hidden>
Date: Thu Nov 5 18:39:11 2009 -0800
cleanup stuff
---
usrp2/host/lib/usrp2.cc | 2 +-
usrp2/host/lib/usrp2_impl.cc | 58 +++++++++++++++++++-------------------------
usrp2/host/lib/usrp2_impl.h | 6 ++---
3 files changed, 28 insertions(+), 38 deletions(-)
diff --git a/usrp2/host/lib/usrp2.cc b/usrp2/host/lib/usrp2.cc
index 6949107..81f6c9d 100644
--- a/usrp2/host/lib/usrp2.cc
+++ b/usrp2/host/lib/usrp2.cc
@@ -161,7 +161,7 @@ namespace usrp2 {
transport::sptr ctrl_transport(new eth_ctrl_transport(ifc, mac));
transport::sptr data_transport(new eth_data_transport(ifc, mac,
rx_bufsize));
//pass the transports into a new usrp2 impl
- d_impl = std::auto_ptr<impl>(new usrp2::impl(data_transport,
ctrl_transport, data_transport->max_buffs()));
+ d_impl = std::auto_ptr<impl>(new usrp2::impl(data_transport,
ctrl_transport));
}
// Public class destructor. d_impl will auto-delete.
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 203afac..14d673b 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -122,7 +122,7 @@ namespace usrp2 {
}
- usrp2::impl::impl(transport::sptr data_transport, transport::sptr
ctrl_transport, size_t ring_size) :
+ usrp2::impl::impl(transport::sptr data_transport, transport::sptr
ctrl_transport) :
d_next_rid(0),
d_num_enqueued(0),
d_enqueued_mutex(),
@@ -132,8 +132,7 @@ namespace usrp2 {
d_rx_decim(0),
d_dont_enqueue(true),
d_ctrl_transport(ctrl_transport),
- d_data_transport(data_transport),
- d_ring_size(ring_size)
+ d_data_transport(data_transport)
{
d_ctrl_transport->set_callback(boost::bind(&usrp2::impl::handle_control_packet,
this, _1));
d_ctrl_transport->start();
@@ -198,14 +197,7 @@ namespace usrp2 {
d_ctrl_transport->stop();
d_data_transport->stop();
}
-
- void
- usrp2::impl::init_fx_data_hdrs(u2_fixed_hdr_t *p, int word0_flags, int chan,
uint32_t timestamp)
- {
- u2p_set_word0(p, word0_flags, chan);
- u2p_set_timestamp(p, timestamp);
- }
-
+
void
usrp2::impl::init_op_ctrl_hdrs(op_fixed_hdr_t *p, int word0_flags, uint32_t
timestamp){
u2p_set_word0(&p->fixed, word0_flags, 0);
@@ -304,6 +296,8 @@ namespace usrp2 {
{
if (d_dont_enqueue) return;
+ // process all data packets handed to us
+ // enqueue data packets in channel rings
for (size_t i = 0; i < sbs.size(); i++) {
sbuff::sptr sb = sbs[i];
@@ -311,23 +305,19 @@ namespace usrp2 {
// FIXME unaligned load!
unsigned int chan = u2p_chan(fixed_hdr);
- // process all data packets handed to us
- // enqueue data packets in channel rings
- {
- gruel::scoped_lock l(d_channel_rings_mutex);
-
- if (!d_channel_rings[chan]) {
- DEBUG_LOG("!");
- continue; // discard packet, no channel handler
- }
-
- if (d_channel_rings[chan]->enqueue(sb)) {
- inc_enqueued();
- DEBUG_LOG("+");
- } else {
- DEBUG_LOG("!");
- continue; //discard packet, enqueue failed
- }
+ gruel::scoped_lock l(d_channel_rings_mutex);
+
+ if (!d_channel_rings[chan]) {
+ DEBUG_LOG("!");
+ continue; // discard packet, no channel handler
+ }
+
+ if (d_channel_rings[chan]->enqueue(sb)) {
+ inc_enqueued();
+ DEBUG_LOG("+");
+ } else {
+ DEBUG_LOG("!");
+ continue; //discard packet, enqueue failed
}
}
@@ -513,7 +503,7 @@ namespace usrp2 {
success = success && (ntohx(reply.ok) == 1);
if (success)
- d_channel_rings[channel] = ring_sptr(new ring(d_ring_size));
+ d_channel_rings[channel] = ring_sptr(new
ring(d_data_transport->max_buffs()));
else
d_dont_enqueue = true;
@@ -847,7 +837,6 @@ namespace usrp2 {
size_t nframes = (nitems + U2_MAX_SAMPLES - 1) / U2_MAX_SAMPLES;
size_t last_frame = nframes - 1;
- u2_fixed_hdr_t hdrs;
size_t n = 0;
for (size_t fn = 0; fn < nframes; fn++){
@@ -869,7 +858,10 @@ namespace usrp2 {
flags |= U2P_TX_END_OF_BURST;
}
- init_fx_data_hdrs(&hdrs, flags, channel, timestamp);
+ //setup the fixed header
+ u2_fixed_hdr_t fixed_hdr;
+ u2p_set_word0(&fixed_hdr, flags, channel);
+ u2p_set_timestamp(&fixed_hdr, timestamp);
// Avoid short packet by splitting last two packets if reqd
size_t i;
@@ -879,8 +871,8 @@ namespace usrp2 {
i = std::min((size_t) U2_MAX_SAMPLES, nitems - n);
eth_iovec iov[2];
- iov[0].iov_base = &hdrs;
- iov[0].iov_len = sizeof(hdrs);
+ iov[0].iov_base = &fixed_hdr;
+ iov[0].iov_len = sizeof(fixed_hdr);
iov[1].iov_base = const_cast<uint32_t *>(&items[n]);
iov[1].iov_len = i * sizeof(uint32_t);
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index 71aafd9..f48b635 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -90,8 +90,7 @@ namespace usrp2 {
if (--d_num_enqueued == 0)
d_data_pending_cond.notify_one();
}
-
- void init_fx_data_hdrs(u2_fixed_hdr_t *p, int word0_flags, int chan,
uint32_t timestamp);
+
void init_op_ctrl_hdrs(op_fixed_hdr_t *p, int word0_flags, uint32_t
timestamp);
void init_config_rx_v2_cmd(op_config_rx_v2_cmd *cmd);
void init_config_tx_v2_cmd(op_config_tx_v2_cmd *cmd);
@@ -104,10 +103,9 @@ namespace usrp2 {
transport::sptr d_ctrl_transport;
transport::sptr d_data_transport;
- size_t d_ring_size;
public:
- impl(transport::sptr data_transport, transport::sptr ctrl_transport,
size_t ring_size);
+ impl(transport::sptr data_transport, transport::sptr ctrl_transport);
~impl();
// Rx
- [Commit-gnuradio] [gnuradio] 15/148: virtual destructor and shared ptr for transport, (continued)
- [Commit-gnuradio] [gnuradio] 15/148: virtual destructor and shared ptr for transport, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 28/148: Cleaned up the parse ethernet stuff. Made an official max_buffs method for the transport., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 20/148: Created sbuff class to house chunks of memory, their length, and possible callback for freeing/cleanup. Switched ring and transport to make use of the sbuff on receive., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 37/148: Fixes usrp2 firmware configure with mb-gcc on ubuntu 9.10/autoconf 2.64. Disables the regression test for fopen since stdio is non-functional., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 22/148: usrp2 impl working with data transport. not up to full potential yet, but working. needs major cleanup., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 23/148: Changed the transport to return a vector of sbuffs. This way the ethernet can pass up as many buffs as ready., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 11/148: some house keeping while trying to fix thread exception, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 12/148: Disable interruption in those functions that use interruption points such as sleep, wait, and timed_wait., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 30/148: being more c++y with the ring, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 36/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 29/148: cleanup stuff,
git <=
- [Commit-gnuradio] [gnuradio] 31/148: pass vector of sbuffs by reference to callback, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 41/148: be a little more PC about it, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 32/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 27/148: new memory map for vita49. Apps won't compile, since symbol names are different, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 16/148: Put ethernet control transport into its own cc/h files. Ethernet control transport is in-charge of ethernet and transport headers, so that usrp2 impl knows nothing about ethernet stuff (as far as control goes)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 24/148: vita rx instead of rx_control. Ready for firmware testing. Misses timing by a little bit, will worry later., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 33/148: got firmware compiling with vrt rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 34/148: forgot to declare wires, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 39/148: mostly just copied over from the rx side. Still needs a lot of work., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 40/148: Added missing flag to vrt header in txrx.c. Added parsing to vrt expanded header to copy out header entries. Modified usrp2 impl to use the correctly parsed header., git, 2016/08/14