diff options
-rw-r--r-- | host/apps/omap_debug/usrp-e-crc-rw.c | 3 | ||||
-rw-r--r-- | host/apps/omap_debug/usrp-e-rw.c | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/host/apps/omap_debug/usrp-e-crc-rw.c b/host/apps/omap_debug/usrp-e-crc-rw.c index cd95761a2..e1d9bf0db 100644 --- a/host/apps/omap_debug/usrp-e-crc-rw.c +++ b/host/apps/omap_debug/usrp-e-crc-rw.c @@ -211,12 +211,13 @@ int main(int argc, char *argv[]) write = 1; } + printf("About to open /dev/usrp_e0"); fp = open("/dev/usrp_e0", O_RDWR); printf("fp = %d\n", fp); sleep(1); // in case the kernel threads need time to start. FIXME if so - sched_setscheduler(0, SCHED_RR, &s); +// sched_setscheduler(0, SCHED_RR, &s); if (read) { if (pthread_create(&rx, NULL, read_thread, (void *) t)) { diff --git a/host/apps/omap_debug/usrp-e-rw.c b/host/apps/omap_debug/usrp-e-rw.c index 7fba8cd2a..1b12fa889 100644 --- a/host/apps/omap_debug/usrp-e-rw.c +++ b/host/apps/omap_debug/usrp-e-rw.c @@ -35,7 +35,7 @@ static int calc_checksum(struct pkt *p) static void *read_thread(void *threadid) { - int cnt, prev_seq_num; + int cnt, prev_seq_num, pkt_count; struct usrp_transfer_frame *rx_data; struct pkt *p; @@ -50,6 +50,7 @@ static void *read_thread(void *threadid) printf("sizeof rx data = %d\n", sizeof(struct usrp_transfer_frame) + sizeof(struct pkt)); prev_seq_num = 0; + pkt_count = 0; while (1) { @@ -60,14 +61,17 @@ static void *read_thread(void *threadid) // printf("Packet received, flags = %X, len = %d\n", rx_data->flags, rx_data->len); // printf("p->seq_num = %d\n", p->seq_num); + + pkt_count++; + if (p->seq_num != prev_seq_num + 1) - printf("Sequence number fail, current = %X, previous = %X\n", - p->seq_num, prev_seq_num); + printf("Sequence number fail, current = %X, previous = %X, pkt_count = %d\n", + p->seq_num, prev_seq_num, pkt_count); prev_seq_num = p->seq_num; if (calc_checksum(p) != p->checksum) - printf("Checksum fail packet = %X, expected = %X\n", - calc_checksum(p), p->checksum); + printf("Checksum fail packet = %X, expected = %X, pkt_count = %d\n", + calc_checksum(p), p->checksum, pkt_count); printf("."); fflush(stdout); @@ -108,7 +112,7 @@ static void *write_thread(void *threadid) cnt = write(fp, tx_data, 2048); if (cnt < 0) printf("Error returned from write: %d\n", cnt); - // sleep(1); + sleep(1); } } |