aboutsummaryrefslogtreecommitdiffstats
path: root/host/apps/omap_debug
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-09-21 19:59:02 +0000
committerPhilip Balister <philip@opensdr.com>2010-09-21 19:59:02 +0000
commit943bfa271c97b36dcba74f1d65220e6f66f50c7f (patch)
treeb2fe6a33ff87a5c4d40a93ff96719c364c5f70a6 /host/apps/omap_debug
parent380889798a9a9b5319e708743c5bb216405f77f4 (diff)
downloaduhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.tar.gz
uhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.tar.bz2
uhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.zip
Use the ring buffer sizes read from the kernel.
Diffstat (limited to 'host/apps/omap_debug')
-rw-r--r--host/apps/omap_debug/usrp-e-mm-loopback.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/apps/omap_debug/usrp-e-mm-loopback.c b/host/apps/omap_debug/usrp-e-mm-loopback.c
index 81bdb410a..053f60b60 100644
--- a/host/apps/omap_debug/usrp-e-mm-loopback.c
+++ b/host/apps/omap_debug/usrp-e-mm-loopback.c
@@ -27,6 +27,7 @@ struct pkt (*rx_buf)[200];
struct pkt (*tx_buf)[200];
static int fp;
+static struct usrp_e_ring_buffer_size_t rb_size;
static int calc_checksum(struct pkt *p)
{
@@ -110,7 +111,7 @@ static void *read_thread(void *threadid)
(*rxi)[rb_read].flags = RB_KERNEL;
rb_read++;
- if (rb_read == 100)
+ if (rb_read == rb_size.num_rx_frames)
rb_read = 0;
bytes_transfered += cnt;
@@ -177,7 +178,7 @@ static void *write_thread(void *threadid)
(*txi)[rb_write].flags = RB_USER;
rb_write++;
- if (rb_write == 100)
+ if (rb_write == rb_size.num_tx_frames)
rb_write = 0;
// cnt = write(fp, tx_data, p->len * 2 + 12);
@@ -195,7 +196,6 @@ int main(int argc, char *argv[])
struct sched_param s = {
.sched_priority = 1
};
- struct usrp_e_ring_buffer_size_t rb_size;
int ret, map_size, page_size;
void *rb;