commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 22/148: usrp2 impl working with data transp


From: git
Subject: [Commit-gnuradio] [gnuradio] 22/148: usrp2 impl working with data transport. not up to full potential yet, but working. needs major cleanup.
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 088d3ce56d012a2f2f9f3f2a06c420a19c498ca7
Author: Josh Blum <address@hidden>
Date:   Thu Nov 5 14:32:13 2009 -0800

    usrp2 impl working with data transport.
    not up to full potential yet, but working.
    needs major cleanup.
---
 usrp2/host/apps/Makefile.am          |   3 +-
 usrp2/host/include/usrp2/usrp2.h     |   4 +
 usrp2/host/lib/eth_buffer.cc         |   3 -
 usrp2/host/lib/eth_data_transport.cc |   6 +-
 usrp2/host/lib/eth_data_transport.h  |   1 +
 usrp2/host/lib/sbuff.h               |   7 ++
 usrp2/host/lib/usrp2.cc              |  24 +++--
 usrp2/host/lib/usrp2_impl.cc         | 178 +++++++++++++++--------------------
 usrp2/host/lib/usrp2_impl.h          |  44 ++++-----
 9 files changed, 131 insertions(+), 139 deletions(-)

diff --git a/usrp2/host/apps/Makefile.am b/usrp2/host/apps/Makefile.am
index db76601..3b2ba5b 100644
--- a/usrp2/host/apps/Makefile.am
+++ b/usrp2/host/apps/Makefile.am
@@ -25,8 +25,7 @@ AM_CPPFLAGS = \
 
 LDADD = \
        $(USRP2_LA) \
-       $(GRUEL_LA) \
-        $(OMNITHREAD_LA)
+       $(GRUEL_LA)
 
 bin_PROGRAMS = \
        find_usrps \
diff --git a/usrp2/host/include/usrp2/usrp2.h b/usrp2/host/include/usrp2/usrp2.h
index 7a612f9..86ea7e0 100644
--- a/usrp2/host/include/usrp2/usrp2.h
+++ b/usrp2/host/include/usrp2/usrp2.h
@@ -582,6 +582,10 @@ namespace usrp2 {
     class impl;                // implementation details
 
   private:
+
+    std::string d_mac;
+    std::string d_ifc;
+
     // Static function to retrieve or create usrp2 instance
     static sptr find_existing_or_make_new(const std::string &ifc, props *p, 
size_t rx_bufsize);
 
diff --git a/usrp2/host/lib/eth_buffer.cc b/usrp2/host/lib/eth_buffer.cc
index 0bf59d9..2fc4796 100644
--- a/usrp2/host/lib/eth_buffer.cc
+++ b/usrp2/host/lib/eth_buffer.cc
@@ -276,10 +276,7 @@ int
         // aligned.  We'll have to deal with it downstream.
 
         *buff = base;
-
-        hdr->tp_status = TP_STATUS_KERNEL; // mark it free
         inc_head();
-
         return len;
     }
     return -1;
diff --git a/usrp2/host/lib/eth_data_transport.cc 
b/usrp2/host/lib/eth_data_transport.cc
index 7760430..2f1013f 100644
--- a/usrp2/host/lib/eth_data_transport.cc
+++ b/usrp2/host/lib/eth_data_transport.cc
@@ -16,8 +16,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define DEBUG_LOG(x) ::write(2, (x), 1)
-
 #include "eth_data_transport.h"
 #include <gruel/inet.h>
 #include <gruel/realtime.h>
@@ -74,7 +72,9 @@ int usrp2::eth_data_transport::sendv(const iovec *iov, size_t 
iovlen){
     hdr.thdr.flags = 0; // FIXME transport header values?
     hdr.thdr.seqno = d_tx_seqno++;
     hdr.thdr.ack = 0;
-
+    //feed the first iov the header
+    all_iov[0].iov_base = &hdr;
+    all_iov[0].iov_len = sizeof(hdr);
     return d_eth_data->tx_framev(all_iov, all_iov_len);
 }
 
diff --git a/usrp2/host/lib/eth_data_transport.h 
b/usrp2/host/lib/eth_data_transport.h
index cf44896..e524deb 100644
--- a/usrp2/host/lib/eth_data_transport.h
+++ b/usrp2/host/lib/eth_data_transport.h
@@ -46,6 +46,7 @@ namespace usrp2{
         int sendv(const iovec *iov, size_t iovlen);
         sbuff::sptr recv();
         void init();
+        size_t max_frames(){return d_eth_data->max_frames();} //FIXME hate to 
have this here
 };
 
 
diff --git a/usrp2/host/lib/sbuff.h b/usrp2/host/lib/sbuff.h
index 0b95bee..dc5912a 100644
--- a/usrp2/host/lib/sbuff.h
+++ b/usrp2/host/lib/sbuff.h
@@ -26,6 +26,13 @@
 #include <boost/shared_ptr.hpp>
 #include <cstdio>
 
+#define USRP2_IMPL_DEBUG 0
+#if USRP2_IMPL_DEBUG
+#define DEBUG_LOG(x) ::write(2, x, 1)
+#else
+#define DEBUG_LOG(x)
+#endif
+
 namespace usrp2 {
 
     /*******************************************************************
diff --git a/usrp2/host/lib/usrp2.cc b/usrp2/host/lib/usrp2.cc
index 218a2c3..3d2e5aa 100644
--- a/usrp2/host/lib/usrp2.cc
+++ b/usrp2/host/lib/usrp2.cc
@@ -29,6 +29,7 @@
 #include <stdexcept>
 #include <cstdio>
 #include "eth_ctrl_transport.h"
+#include "eth_data_transport.h"
 
 
 //FIXME this is the Nth instance of this function, find it a home
@@ -175,10 +176,15 @@ namespace usrp2 {
   usrp2::usrp2(const std::string &ifc, props *p, size_t rx_bufsize)
   {
     u2_mac_addr_t mac;
-    parse_mac_addr(p->addr, &mac);
-    
+    d_mac = p->addr;
+    d_ifc = ifc;
+    parse_mac_addr(d_mac, &mac);
+    //create transports for data and control
     transport::sptr ctrl_transport(new eth_ctrl_transport(ifc, mac));
-    d_impl = std::auto_ptr<impl>(new usrp2::impl(ifc, p, rx_bufsize, 
ctrl_transport));
+    eth_data_transport *data_transport_p = new eth_data_transport(ifc, mac, 
rx_bufsize);
+    transport::sptr data_transport(data_transport_p);
+    //pass the transports into a new usrp2 impl
+    d_impl = std::auto_ptr<impl>(new usrp2::impl(data_transport, 
ctrl_transport, data_transport_p->max_frames()));
   }
   
   // Public class destructor.  d_impl will auto-delete.
@@ -190,13 +196,13 @@ namespace usrp2 {
   std::string
   usrp2::mac_addr()
   {
-    return d_impl->mac_addr();
+    return d_mac;
   }
 
   std::string
   usrp2::interface_name()
   {
-    return d_impl->interface_name();
+    return d_ifc;
   }
 
   // Receive
@@ -288,13 +294,13 @@ namespace usrp2 {
   unsigned int
   usrp2::rx_overruns()
   {
-    return d_impl->rx_overruns();
+    return 0;//FIXME d_impl->rx_overruns();
   }
   
   unsigned int
   usrp2::rx_missing()
   {
-    return d_impl->rx_missing();
+    return 0;//FIXME d_impl->rx_missing();
   }
 
   // Transmit
@@ -443,7 +449,9 @@ namespace usrp2 {
   bool
   usrp2::burn_mac_addr(const std::string &new_addr)
   {
-    return d_impl->burn_mac_addr(new_addr);
+    u2_mac_addr_t mac;
+    parse_mac_addr(new_addr, &mac);
+    return d_impl->burn_mac_addr(&mac);
   }
 
   bool
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index cdeab7e..4e8a63b 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -40,13 +40,6 @@
 #include <assert.h>
 #include <string.h>
 
-#define USRP2_IMPL_DEBUG 0
-#if USRP2_IMPL_DEBUG
-#define DEBUG_LOG(x) ::write(2, x, 1)
-#else
-#define DEBUG_LOG(x)
-#endif
-
 static const int DEFAULT_RX_SCALE = 1024;
 
 namespace usrp2 {
@@ -129,19 +122,19 @@ namespace usrp2 {
   }
 
 
-  usrp2::impl::impl(const std::string &ifc, props *p, size_t rx_bufsize, 
transport::sptr ctrl_transport)
-    : d_eth_data(new eth_buffer(rx_bufsize)),
-      d_eth_ctrl(new ethernet()),
-      d_pf_data(0), 
-      d_pf_ctrl(0),
-      d_interface_name(ifc),
-      d_rx_seqno(-1),
-      d_tx_seqno(0),
+  usrp2::impl::impl(transport::sptr data_transport, transport::sptr 
ctrl_transport, size_t ring_size)
+    : //d_eth_data(new eth_buffer(rx_bufsize)),
+      //d_eth_ctrl(new ethernet()),
+      //d_pf_data(0), 
+      //d_pf_ctrl(0),
+      //d_interface_name(ifc),
+      //d_rx_seqno(-1),
+      //d_tx_seqno(0),
       d_next_rid(0),
-      d_num_rx_frames(0),
-      d_num_rx_missing(0),
-      d_num_rx_overruns(0),
-      d_num_rx_bytes(0), 
+      //d_num_rx_frames(0),
+      //d_num_rx_missing(0),
+      //d_num_rx_overruns(0),
+      //d_num_rx_bytes(0), 
       d_num_enqueued(0),
       d_enqueued_mutex(),
       d_data_pending_cond(),
@@ -149,19 +142,24 @@ namespace usrp2 {
       d_tx_interp(0),
       d_rx_decim(0),
       d_dont_enqueue(true),
-      d_data_running(false),
-      d_ctrl_transport(ctrl_transport)
+      //d_data_running(false),
+      d_ctrl_transport(ctrl_transport),
+      d_data_transport(data_transport),
+      d_ring_size(ring_size)
   {
     
d_ctrl_transport->set_callback(boost::bind(&usrp2::impl::handle_control_packet, 
this, _1));
     d_ctrl_transport->start();
 
-    if (!d_eth_data->open(ifc, htons(U2_DATA_ETHERTYPE)))
-      throw std::runtime_error("Unable to open/register USRP2 data protocol");
+    
d_data_transport->set_callback(boost::bind(&usrp2::impl::handle_data_packet, 
this, _1));
+    d_data_transport->start();
+
+    //if (!d_eth_data->open(ifc, htons(U2_DATA_ETHERTYPE)))
+    //  throw std::runtime_error("Unable to open/register USRP2 data 
protocol");
 
-    d_addr = p->addr;
+    //d_addr = p->addr;
 
     // Create a packet filter for U2_DATA_ETHERTYPE packets sourced from 
target USRP2
-    u2_mac_addr_t usrp_mac;
+    /*u2_mac_addr_t usrp_mac;
     parse_mac_addr(d_addr, &usrp_mac);
     d_pf_data = pktfilter::make_ethertype_inbound_target(U2_DATA_ETHERTYPE, 
(const unsigned char*)&(usrp_mac.addr));
     if (!d_pf_data || !d_eth_data->attach_pktfilter(d_pf_data))
@@ -170,9 +168,11 @@ namespace usrp2 {
     if (USRP2_IMPL_DEBUG)
       std::cerr << "usrp2 constructor: using USRP2 at " << d_addr << std::endl;
 
-    memset(d_pending_replies, 0, sizeof(d_pending_replies));
+    
 
-    start_data_thread();
+    start_data_thread();*/
+
+    memset(d_pending_replies, 0, sizeof(d_pending_replies));
 
     // In case the USRP2 was left streaming RX
     // FIXME: only one channel right now
@@ -227,24 +227,25 @@ namespace usrp2 {
   usrp2::impl::~impl()
   {
     d_ctrl_transport->stop();
-    //thread cleanup
+    d_data_transport->stop();
+    /*//thread cleanup
     stop_data_thread();
     //socket cleanup
     delete d_pf_data;
     d_eth_data->close();
-    delete d_eth_data;
+    delete d_eth_data;*/
 
-    if (USRP2_IMPL_DEBUG) {
+    /*if (USRP2_IMPL_DEBUG) {
       std::cerr << std::endl
                 << "usrp2 destructor: received " << d_num_rx_frames 
                << " frames, with " << d_num_rx_missing << " lost ("
                << (d_num_rx_frames == 0 ? 0 : 
(int)(100.0*d_num_rx_missing/d_num_rx_frames))
                << "%), totaling " << d_num_rx_bytes
                << " bytes" << std::endl;
-    }
+    }*/
   }
   
-  bool
+  /*bool
   usrp2::impl::parse_mac_addr(const std::string &s, u2_mac_addr_t *p)
   {
     p->addr[0] = 0x00;         // Matt's IAB
@@ -268,20 +269,13 @@ namespace usrp2 {
     default:
       return false;
     }
-  }
+  }*/
   
   void
-  usrp2::impl::init_etf_data_hdrs(u2_eth_packet_t *p, const std::string &dst,
-                            int word0_flags, int chan, uint32_t timestamp)
+  usrp2::impl::init_fx_data_hdrs(u2_fixed_hdr_t *p, int word0_flags, int chan, 
uint32_t timestamp)
   {
-    p->ehdr.ethertype = htons(U2_DATA_ETHERTYPE);
-    parse_mac_addr(dst, &p->ehdr.dst); 
-    memcpy(&p->ehdr.src, d_eth_data->mac(), 6);
-    p->thdr.flags = 0; // FIXME transport header values?
-    p->thdr.seqno = d_tx_seqno++;
-    p->thdr.ack = 0;
-    u2p_set_word0(&p->fixed, word0_flags, chan);
-    u2p_set_timestamp(&p->fixed, timestamp);
+    u2p_set_word0(p, word0_flags, chan);
+    u2p_set_timestamp(p, timestamp);
   }
   
   void
@@ -343,7 +337,7 @@ namespace usrp2 {
   //        Background loop for handling data packets
   // ----------------------------------------------------------------
 
-  void
+ /* void
   usrp2::impl::start_data_thread(){
     d_data_thread = new 
boost::thread(boost::bind(&usrp2::impl::run_data_thread, this));
   }
@@ -382,28 +376,25 @@ namespace usrp2 {
       }
     }
     d_data_running = false;
-  }
+  }*/
   
   //
   // passed to eth_buffer::rx_frames
   //
-  data_handler::result
+  /*data_handler::result
   usrp2::impl::operator()(const void *base, size_t len)
   {
       if (d_dont_enqueue)              // toss packet
         return data_handler::RELEASE;
 
-      return handle_data_packet(base, len);
-  }
+      //return handle_data_packet(base, len);
+  }*/
 
   void
   usrp2::impl::handle_control_packet(sbuff::sptr sb)
-  {
-    void *base = sb->buff();
-    size_t len = sb->len();
-    
+  {    
     // point to beginning of payload (subpackets)
-    unsigned char *p = (unsigned char *)base + sizeof(u2_fixed_hdr_t);
+    unsigned char *p = (unsigned char *)sb->buff() + sizeof(u2_fixed_hdr_t);
     
     // FIXME (p % 4) == 2.  Not good.  Must watch for unaligned loads.
 
@@ -433,60 +424,44 @@ namespace usrp2 {
     DEBUG_LOG("l");
   }
   
-  data_handler::result
-  usrp2::impl::handle_data_packet(const void *base, size_t len)
+  void
+  usrp2::impl::handle_data_packet(sbuff::sptr sb)
   {
-    u2_eth_samples_t *pkt = (u2_eth_samples_t *)base;
-    d_num_rx_frames++;
-    d_num_rx_bytes += len;
-    
-    /* --- FIXME start of fake transport layer handler --- */
-
-    if (d_rx_seqno != -1) {
-      int expected_seqno = (d_rx_seqno + 1) & 0xFF;
-      int seqno = pkt->hdrs.thdr.seqno; 
-      
-      if (seqno != expected_seqno) {
-       ::write(2, "S", 1); // missing sequence number
-       int missing = seqno - expected_seqno;
-       if (missing < 0)
-         missing += 256;
-       
-       d_num_rx_overruns++;
-       d_num_rx_missing += missing;
-      }
-    }
-
-    d_rx_seqno = pkt->hdrs.thdr.seqno;
-
-    /* --- end of fake transport layer handler --- */
+    //d_num_rx_frames++;
+    //d_num_rx_bytes += sb->len();
+    u2_fixed_hdr_t *fixed_hdr = (u2_fixed_hdr_t*)sb->buff();
 
     // FIXME unaligned load!
-    unsigned int chan = u2p_chan(&pkt->hdrs.fixed);
+    unsigned int chan = u2p_chan(fixed_hdr);
+
+    //printf("Recv over eth data %d (%d)\n", sb->len(), chan);
 
     {
       gruel::scoped_lock l(d_channel_rings_mutex);
 
-      if (!d_channel_rings[chan]) {
-       DEBUG_LOG("!");
-       return data_handler::RELEASE;   // discard packet, no channel handler
+      if (!d_channel_rings[chan] or d_dont_enqueue) {
+        DEBUG_LOG("!");
+        return;        // discard packet, no channel handler
       }
       
-      // Strip off ethernet header and transport header and enqueue the rest
       
-      size_t offset = offsetof(u2_eth_samples_t, hdrs.fixed);
-      
-      sbuff::cb_t callback = boost::bind(&eth_buffer::release_frame, 
d_eth_data, (void*)base);
-      if (d_channel_rings[chan]->enqueue(sbuff::make(&pkt->hdrs.fixed, 
len-offset, callback))) {
-       inc_enqueued();
-       DEBUG_LOG("+");
-       return data_handler::KEEP;      // channel ring runner will mark frame 
done
+      if (d_channel_rings[chan]->enqueue(sb)) {
+        inc_enqueued();
+        DEBUG_LOG("+");
       }
       else {
-       DEBUG_LOG("!");
-       return data_handler::RELEASE;   // discard, no room in channel ring
-      }        
-      return data_handler::RELEASE;
+        DEBUG_LOG("!");
+        return;     //discard packet, enqueue failed
+      }
+    }
+
+    // Wait for user API thread(s) to process all enqueued packets.
+    // The channel ring thread that decrements d_num_enqueued to zero 
+    // will signal this thread to continue.
+    if (d_num_enqueued > 0){
+        gruel::scoped_lock l(d_enqueued_mutex);
+        while(d_num_enqueued > 0)
+            d_data_pending_cond.wait(l);
     }
   }
 
@@ -662,7 +637,7 @@ namespace usrp2 {
       success = success && (ntohx(reply.ok) == 1);
       
       if (success)
-       d_channel_rings[channel] = ring_sptr(new 
ring(d_eth_data->max_frames()));
+       d_channel_rings[channel] = ring_sptr(new ring(d_ring_size));
       else
        d_dont_enqueue = true;
 
@@ -996,7 +971,7 @@ namespace usrp2 {
 
     size_t nframes = (nitems + U2_MAX_SAMPLES - 1) / U2_MAX_SAMPLES;
     size_t last_frame = nframes - 1;
-    u2_eth_packet_t    hdrs;
+    u2_fixed_hdr_t     hdrs;
 
     size_t n = 0;
     for (size_t fn = 0; fn < nframes; fn++){
@@ -1018,7 +993,7 @@ namespace usrp2 {
          flags |= U2P_TX_END_OF_BURST;
       }
 
-      init_etf_data_hdrs(&hdrs, d_addr, flags, channel, timestamp);
+      init_fx_data_hdrs(&hdrs, flags, channel, timestamp);
 
       // Avoid short packet by splitting last two packets if reqd
       size_t i;
@@ -1037,7 +1012,7 @@ namespace usrp2 {
       if (total < 64)
        fprintf(stderr, "usrp2::tx_raw: FIXME: short packet: %zd items (%zd 
bytes)\n", i, total);
 
-      if (d_eth_data->tx_framev(iov, 2) != eth_buffer::EB_OK){
+      if (d_data_transport->sendv(iov, 2) != eth_buffer::EB_OK){
        return false;
       }
 
@@ -1112,7 +1087,7 @@ namespace usrp2 {
   // ----------------------------------------------------------------
 
   bool
-  usrp2::impl::burn_mac_addr(const std::string &new_addr)
+  usrp2::impl::burn_mac_addr(u2_mac_addr_t *new_mac)
   {
     op_burn_mac_addr_cmd cmd;
     op_generic_t reply;
@@ -1122,8 +1097,7 @@ namespace usrp2 {
     cmd.op.opcode = OP_BURN_MAC_ADDR;
     cmd.op.len = sizeof(cmd.op);
     cmd.op.rid = d_next_rid++;
-    if (!parse_mac_addr(new_addr, &cmd.op.addr))
-      return false;
+    memcpy(&cmd.op.addr, new_mac, sizeof(u2_mac_addr_t));
 
     pending_reply p(cmd.op.rid, &reply, sizeof(reply));
     if (!transmit_cmd_and_wait(&cmd, sizeof(cmd), &p, 4*DEF_CMD_TIMEOUT))
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index ac26256..ad3f418 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -55,26 +55,26 @@ namespace usrp2 {
                gain_min(0), gain_max(0), gain_step_size(0) {}
   };
 
-  class usrp2::impl : private data_handler
+  class usrp2::impl
   {
     static const size_t NRIDS = 256;
     static const size_t NCHANS = 32;
 
-    eth_buffer    *d_eth_data; // packet ring buffered data frames
+    /*eth_buffer    *d_eth_data;       // packet ring buffered data frames
     ethernet      *d_eth_ctrl;  // unbuffered control frames
     pktfilter     *d_pf_data;
-    pktfilter     *d_pf_ctrl;
+    pktfilter     *d_pf_ctrl;*/
 
-    std::string    d_interface_name;
-    std::string    d_addr;       // FIXME: use u2_mac_addr_t instead
+    /*std::string    d_interface_name;
+    std::string    d_addr;       // FIXME: use u2_mac_addr_t instead*/
     
-    int            d_rx_seqno;
-    int            d_tx_seqno;
+    /*int            d_rx_seqno;
+    int            d_tx_seqno;*/
     int            d_next_rid;
-    unsigned int   d_num_rx_frames; //TODO remove this stuff, its in transport 
data
+    /*unsigned int   d_num_rx_frames; //TODO remove this stuff, its in 
transport data
     unsigned int   d_num_rx_missing;
     unsigned int   d_num_rx_overruns;
-    unsigned int   d_num_rx_bytes;
+    unsigned int   d_num_rx_bytes;*/
 
     unsigned int   d_num_enqueued;
     gruel::mutex   d_enqueued_mutex;
@@ -105,34 +105,36 @@ namespace usrp2 {
         d_data_pending_cond.notify_one();
     }
     
-    static bool parse_mac_addr(const std::string &s, u2_mac_addr_t *p);
-    void init_etf_data_hdrs(u2_eth_packet_t *p, const std::string &dst, int 
word0_flags, int chan, uint32_t timestamp);
+    //static bool parse_mac_addr(const std::string &s, u2_mac_addr_t *p);
+    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);
     bool transmit_cmd_and_wait(void *cmd, size_t len, pending_reply *p, double 
secs=0.0);
     bool transmit_cmd(void *cmd, size_t len);
-    virtual data_handler::result operator()(const void *base, size_t len);
+    //virtual data_handler::result operator()(const void *base, size_t len);
     void handle_control_packet(sbuff::sptr sb);
-    data_handler::result handle_data_packet(const void *base, size_t len);
+    void handle_data_packet(sbuff::sptr sb);
     bool dboard_info();
     bool reset_db();
 
     //data thread stuff
-    volatile bool d_data_running; // TODO: multistate if needed
+   /* volatile bool d_data_running; // TODO: multistate if needed
     boost::thread *d_data_thread;
     void start_data_thread();
     void stop_data_thread();
-    void run_data_thread();
+    void run_data_thread();*/
 
     transport::sptr d_ctrl_transport;
+    transport::sptr d_data_transport;
+    size_t d_ring_size;
 
   public:
-    impl(const std::string &ifc, props *p, size_t rx_bufsize, transport::sptr 
ctrl_transport);
+    impl(transport::sptr data_transport, transport::sptr ctrl_transport, 
size_t ring_size);
     ~impl();
 
-    std::string mac_addr() const { return d_addr; } // FIXME: convert from 
u2_mac_addr_t
-    std::string interface_name() const { return d_interface_name; }
+    //std::string mac_addr() const { return d_addr; } // FIXME: convert from 
u2_mac_addr_t
+    //std::string interface_name() const { return d_interface_name; }
 
     // Rx
 
@@ -156,8 +158,8 @@ namespace usrp2 {
     bool rx_samples(unsigned int channel, rx_sample_handler *handler);
     bool flush_rx_samples(unsigned int channel);
     bool stop_rx_streaming(unsigned int channel);
-    unsigned int rx_overruns() const { return d_num_rx_overruns; }
-    unsigned int rx_missing() const { return d_num_rx_missing; }
+    //unsigned int rx_overruns() const { return d_num_rx_overruns; }
+    //unsigned int rx_missing() const { return d_num_rx_missing; }
 
     // Tx
 
@@ -200,7 +202,7 @@ namespace usrp2 {
 
     // low level
 
-    bool burn_mac_addr(const std::string &new_addr);
+    bool burn_mac_addr(u2_mac_addr_t *new_mac);
     bool sync_to_pps();
     bool sync_every_pps(bool enable);
     std::vector<uint32_t> peek32(uint32_t addr, uint32_t words);



reply via email to

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