[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 38/148: rx working with vrt header
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 38/148: rx working with vrt 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 6360ce1702e8b0474aea8064224c2b8ba4c829a7
Author: Josh Blum <address@hidden>
Date: Tue Nov 17 17:56:24 2009 -0800
rx working with vrt header
---
usrp2/firmware/apps/txrx.c | 15 ++++++++-------
usrp2/host/lib/usrp2_impl.cc | 40 +++++++++++-----------------------------
2 files changed, 19 insertions(+), 36 deletions(-)
diff --git a/usrp2/firmware/apps/txrx.c b/usrp2/firmware/apps/txrx.c
index 5048aa2..61b151a 100644
--- a/usrp2/firmware/apps/txrx.c
+++ b/usrp2/firmware/apps/txrx.c
@@ -94,7 +94,7 @@ dbsm_t dsp_tx_sm; // the state machine
// 4 lines of ethernet hdr + 1 line transport hdr + 1 line (word0)
// DSP Rx writes timestamp followed by nlines_per_frame of samples
-#define DSP_RX_FIRST_LINE ((sizeof(u2_eth_hdr_t) +
sizeof(u2_transport_hdr_t))/4 + 1)
+#define DSP_RX_FIRST_LINE ((sizeof(u2_eth_hdr_t) +
sizeof(u2_transport_hdr_t))/4)
// receive from DSP
buf_cmd_args_t dsp_rx_recv_args = {
@@ -129,6 +129,9 @@ bool is_streaming(void){ return streaming_p; }
// ----------------------------------------------------------------
+#define VRT_HEADER_WORDS 5
+#define VRT_TRAILER_WORDS 1
+
void
restart_streaming(void)
{
@@ -140,8 +143,8 @@ restart_streaming(void)
| VRTH_PT_IF_DATA_WITH_SID
| VRTH_HAS_TRAILER
| VRTH_TSF_SAMPLE_CNT
- | (6+streaming_items_per_frame)); //MAGIC number 6
- sr_rx_ctrl->vrt_stream_id = 0xabab;
+ | (VRT_HEADER_WORDS+streaming_items_per_frame+VRT_TRAILER_WORDS));
+ sr_rx_ctrl->vrt_stream_id = 0;
sr_rx_ctrl->vrt_trailer = 0;
streaming_p = true;
@@ -170,15 +173,13 @@ start_rx_streaming_cmd(const u2_mac_addr_t *host,
op_start_rx_streaming_t *p)
host_mac_addr = *host; // remember who we're sending to
/*
- * Construct ethernet header and word0 and preload into two buffers
+ * Construct ethernet header and preload into two buffers
*/
- u2_eth_packet_t pkt;
+ u2_eth_packet_only_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_DATA_ETHERTYPE;
- u2p_set_word0(&pkt.fixed, 0, 0);
- // DSP RX will fill in timestamp
memcpy_wa(buffer_ram(DSP_RX_BUF_0), &pkt, sizeof(pkt));
memcpy_wa(buffer_ram(DSP_RX_BUF_1), &pkt, sizeof(pkt));
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 096ecf7..548e714 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -99,38 +99,20 @@ namespace usrp2 {
vrt::expanded_header vrt_hdr;
if (vrt::expanded_header::parse(
- (const uint32_t*)(d+1), payload_len_in_bytes/sizeof(uint32_t), //in
+ (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
- return true;
+
+ (*items)++;//FIXME wrong ptr from parse
+
+ //strip off the trailer if present
+ if (vrt_hdr.trailer_p()) (*nitems_in_uint32s)--;
+
} else {
+ *items = (uint32_t*)p; //KLUDGE until we move this code
+ *nitems_in_uint32s = payload_len_in_bytes/sizeof(uint32_t);
printf("Bad vrt header %x\n", vrt_hdr.header);
}
- if (payload_len_in_bytes < sizeof(u2_fixed_hdr_t)) // invalid format
- return false;
-
- // FIXME deal with the fact that (p % 4) == 2
- //assert((((uintptr_t) p) % 4) == 0); // must be 4-byte
aligned
-
- u2_fixed_hdr_t *fh = static_cast<u2_fixed_hdr_t *>(p);
-
- // FIXME unaligned loads!
- md->word0 = u2p_word0(fh);
- md->timestamp = u2p_timestamp(fh);
-
- // FIXME when we've got more info
- // md->start_of_burst = (md->word0 & XXX) != 0;
- // md->end_of_burst = (md->word0 & XXX) != 0;
- // md->rx_overrun = (md->word0 & XXX) != 0;
- md->start_of_burst = 0;
- md->end_of_burst = 0;
- md->rx_overrun = 0;
-
- *items = (uint32_t *)(&fh[1]);
- size_t nbytes = payload_len_in_bytes - sizeof(u2_fixed_hdr_t);
- assert((nbytes % sizeof(uint32_t)) == 0);
- *nitems_in_uint32s = nbytes / sizeof(uint32_t);
-
return true;
}
@@ -315,8 +297,8 @@ namespace usrp2 {
sbuff::sptr sb = sbs[i];
u2_fixed_hdr_t *fixed_hdr = (u2_fixed_hdr_t*)sb->buff();
- // FIXME unaligned load!
- unsigned int chan = u2p_chan(fixed_hdr);
+ // FIXME get channel from vrt
+ unsigned int chan = 0;
gruel::scoped_lock l(d_channel_rings_mutex);
- [Commit-gnuradio] [gnuradio] 52/148: seems to correctly deframe packets. now need to consume them., (continued)
- [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
- [Commit-gnuradio] [gnuradio] 54/148: flag packets which arrive way too early so the device doesn't sit there forever., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 38/148: rx working with vrt header,
git <=
- [Commit-gnuradio] [gnuradio] 45/148: Re-implemented find.cc with gruel and eth_ctrl_transport class. Added constructor args to the eth control transport to set the timeout and target for the packet filter., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 49/148: Added read_packet with timeout method to ethernet. Now the control recv can timeout and immediately recv., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 21/148: put 64 bit timer for vita49 on the settings bus, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 47/148: Handled the case of short packets in eth data transport by using padding., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 70/148: changed debug pins to see incoming data, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 51/148: progress on vita_tx. it compiles now, need to work on vita_tx_control., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 46/148: Created and used a typedef for a vector of sbuffs. Changed the return type for the transport sendv to bool. Not all transports can return the number of bytes sent, and we only care if the transport succeeded or not. This fixes an issue of the usrp2 impl freezing on close after tx, because the return value from sednv was improperly handled., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 66/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 79/148: cleaned up the main ibs state machine, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 71/148: Merge branch 'vita_rx' of gnuradio.org:matt into vita_rx, git, 2016/08/14