[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 40/148: Added missing flag to vrt header in
From: |
git |
Subject: |
[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. |
Date: |
Mon, 15 Aug 2016 00:47:22 +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 1103abf34bb3618aa202164d784a8b445cd03092
Author: Josh Blum <address@hidden>
Date: Wed Nov 18 15:54:07 2009 -0800
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.
---
usrp2/firmware/apps/txrx.c | 1 +
usrp2/host/lib/ring.cc | 2 +-
usrp2/host/lib/ring.h | 2 +-
usrp2/host/lib/usrp2_impl.cc | 10 ++--------
usrp2/host/lib/usrp2_impl.h | 7 +------
vrt/lib/expanded_header.cc | 15 ++++++++++++++-
6 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/usrp2/firmware/apps/txrx.c b/usrp2/firmware/apps/txrx.c
index 61b151a..8f0df8e 100644
--- a/usrp2/firmware/apps/txrx.c
+++ b/usrp2/firmware/apps/txrx.c
@@ -142,6 +142,7 @@ restart_streaming(void)
sr_rx_ctrl->vrt_header = (0
| VRTH_PT_IF_DATA_WITH_SID
| VRTH_HAS_TRAILER
+ | VRTH_TSI_OTHER
| VRTH_TSF_SAMPLE_CNT
| (VRT_HEADER_WORDS+streaming_items_per_frame+VRT_TRAILER_WORDS));
sr_rx_ctrl->vrt_stream_id = 0;
diff --git a/usrp2/host/lib/ring.cc b/usrp2/host/lib/ring.cc
index ac1bda2..0e9068d 100644
--- a/usrp2/host/lib/ring.cc
+++ b/usrp2/host/lib/ring.cc
@@ -42,7 +42,7 @@ namespace usrp2 {
}
bool
- ring::enqueue(sbuff::sptr sb)
+ ring::enqueue(sbuff::sptr &sb)
{
gruel::scoped_lock l(d_mutex);
if (full())
diff --git a/usrp2/host/lib/ring.h b/usrp2/host/lib/ring.h
index 0e8d76e..c8559e5 100644
--- a/usrp2/host/lib/ring.h
+++ b/usrp2/host/lib/ring.h
@@ -70,7 +70,7 @@ namespace usrp2 {
void wait_for_not_empty();
- bool enqueue(sbuff::sptr sb);
+ bool enqueue(sbuff::sptr &sb);
bool dequeue(sbuff::sptr &sb);
};
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 548e714..65f2791 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -95,18 +95,12 @@ namespace usrp2 {
uint32_t **items, size_t *nitems_in_uint32s, rx_metadata
*md)
{
- uint32_t *d = (uint32_t*)p;
vrt::expanded_header vrt_hdr;
if (vrt::expanded_header::parse(
(const uint32_t*)p, payload_len_in_bytes/sizeof(uint32_t), //in
&vrt_hdr, (const uint32_t**)items, nitems_in_uint32s) and
vrt_hdr.if_data_p()){ //out
-
- (*items)++;//FIXME wrong ptr from parse
-
- //strip off the trailer if present
- if (vrt_hdr.trailer_p()) (*nitems_in_uint32s)--;
-
+ //printf("%d --- %d time %d:%.8llx\n", *nitems_in_uint32s, (*items) -
(uint32_t*)p, vrt_hdr.integer_secs, vrt_hdr.fractional_secs);
} else {
*items = (uint32_t*)p; //KLUDGE until we move this code
*nitems_in_uint32s = payload_len_in_bytes/sizeof(uint32_t);
@@ -296,7 +290,7 @@ namespace usrp2 {
for (size_t i = 0; i < sbs.size(); i++) {
sbuff::sptr sb = sbs[i];
- u2_fixed_hdr_t *fixed_hdr = (u2_fixed_hdr_t*)sb->buff();
+ //u2_fixed_hdr_t *fixed_hdr = (u2_fixed_hdr_t*)sb->buff();
// FIXME get channel from vrt
unsigned int chan = 0;
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index 0cb786d..d48650d 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -33,14 +33,9 @@
#define MAX_SUBPKT_LEN 252
namespace usrp2 {
-
- class eth_buffer;
- class ethernet;
- class pktfilter;
- class usrp2_thread;
+
class usrp2_tune_result;
class pending_reply;
- class ring;
//! High-level d'board info
struct db_info {
diff --git a/vrt/lib/expanded_header.cc b/vrt/lib/expanded_header.cc
index 0eb2042..ce0bd49 100644
--- a/vrt/lib/expanded_header.cc
+++ b/vrt/lib/expanded_header.cc
@@ -91,7 +91,20 @@ namespace vrt {
return false;
}
- h->header = ntohl(p[0]);
+ /*
+ * Load vrt header entries into the expanded_header h.
+ * Check h to see if the entry exists, then load and handle byte ordering.
+ */
+ size_t word_offset = 0;
+ if (true) h->header = ntohx(p[word_offset++]);
+ if (h->stream_id_p()) h->stream_id = ntohx(p[word_offset++]);
+ if (h->class_id_p()) h->class_id = ntohx(p[word_offset++]);
+ if (h->integer_secs_p()) h->integer_secs = ntohx(p[word_offset++]);
+ if (h->fractional_secs_p()){
+ h->fractional_secs = ntohx(*((uint64_t*)p+word_offset));
+ word_offset+=2;
+ }
+ if (h->trailer_p()) h->trailer =
ntohx(p[n32_bit_words_packet-1]);
if (h->pkt_size() > len)
return false; // VRT header says packet is bigger than what
we've got
- [Commit-gnuradio] [gnuradio] 29/148: cleanup stuff, (continued)
- [Commit-gnuradio] [gnuradio] 29/148: cleanup stuff, git, 2016/08/14
- [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 <=
- [Commit-gnuradio] [gnuradio] 35/148: got vrt rx somewhat working, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 52/148: seems to correctly deframe packets. now need to consume them., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 50/148: make the testbench work in this environment, without the crossclock settings bus, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 26/148: moved regs around for vita49, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 19/148: VITA49 rx (and tx skeleton) copied over from quad radio, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 43/148: minor tweak to transport loop and debug printf for vrt, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 44/148: Removed temporary u2_eth_packet_only_t. Removed the fixed header portion from the u2_eth_packet_t. Removed places in code where control uses the fixed header (always unused 0 for word, and -1 for timestamp). Flagged the fixed header stuff for removal (once we get vrt tx)., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 25/148: cleanup, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 42/148: Created a ring data structure held by the ring. It holds an sbuff and its parsed vrt data (header, payload, and len). The impl data handler parses the packets and enqueues them., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 48/148: Added interrupt call from transport::stop so the recv or callback will throw at interruption points. This fixes the issue where the app would hang in the stop method when exiting (we were hanging here: d_data_pending_cond.wait(l), but now wait throws() and we exit)., git, 2016/08/14