commit-gnuradio
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]