usrp2: fix for 'start_rx_streaming_at' hang
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 18 Jan 2010 04:18:59 +0000 (20:18 -0800)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 18 Jan 2010 04:18:59 +0000 (20:18 -0800)
The start_rx_streaming_at call was not clearing the
d_dont_enqueue flag, resulting in the receiver loop
discarding data packets.

usrp2/host/lib/usrp2_impl.cc

index a74707634cd4c7c73ffc0d5320f2afe17a49a796..b19c6ecf196b333d6c078d64660d046713fc6545 100644 (file)
@@ -705,6 +705,7 @@ namespace usrp2 {
       cmd.eop.opcode = OP_EOP;
       cmd.eop.len = sizeof(cmd.eop);
 
+      d_dont_enqueue = false;
       bool success = false;
       pending_reply p(cmd.op.rid, &reply, sizeof(reply));
       success = transmit_cmd_and_wait(&cmd, sizeof(cmd), &p, DEF_CMD_TIMEOUT);
@@ -712,6 +713,8 @@ namespace usrp2 {
 
       if (success)
        d_channel_rings[channel] = ring_sptr(new ring(d_eth_buf->max_frames()));
+      else
+       d_dont_enqueue = true;
 
       return success;
     }
@@ -759,6 +762,7 @@ namespace usrp2 {
       cmd.eop.opcode = OP_EOP;
       cmd.eop.len = sizeof(cmd.eop);
 
+      d_dont_enqueue = false;
       bool success = false;
       pending_reply p(cmd.sync_op.rid, &reply, sizeof(reply));
       success = transmit_cmd_and_wait(&cmd, sizeof(cmd), &p, DEF_CMD_TIMEOUT);
@@ -766,6 +770,8 @@ namespace usrp2 {
 
       if (success)
        d_channel_rings[channel] = ring_sptr(new ring(d_eth_buf->max_frames()));
+      else
+       d_dont_enqueue = true;
 
       return success;
     }