From 376e22ca3bf25c8d6bb53cd987b245e5b79860f9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 13 Oct 2010 18:38:54 -0700 Subject: usrp2: handle destination port unreachable icmp in fw (kills streaming and update packets) --- firmware/microblaze/lib/net_common.c | 11 ++++++++++- firmware/microblaze/usrp2/memory_map.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'firmware') diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c index 6c9509c92..0efb26639 100644 --- a/firmware/microblaze/lib/net_common.c +++ b/firmware/microblaze/lib/net_common.c @@ -291,8 +291,17 @@ handle_icmp_packet(struct ip_addr src, struct ip_addr dst, { switch (icmp->type){ case ICMP_DUR: // Destinatino Unreachable - //stop_streaming(); //FIXME if (icmp->code == ICMP_DUR_PORT){ // port unreachable + //handle destination port unreachable (the host ctrl+c'd the app): + + //end async update packets per second + sr_tx_ctrl->cyc_per_up = 0; + + //the end continuous streaming command + sr_rx_ctrl->cmd = (1 << 31) | 1; //one sample, asap + sr_rx_ctrl->time_secs = 0; + sr_rx_ctrl->time_ticks = 0; //latch the command + //struct udp_hdr *udp = (struct udp_hdr *)((char *)icmp + 28); //printf("icmp port unr %d\n", udp->dest); putchar('i'); diff --git a/firmware/microblaze/usrp2/memory_map.h b/firmware/microblaze/usrp2/memory_map.h index 41a2820bc..e7f41bc8d 100644 --- a/firmware/microblaze/usrp2/memory_map.h +++ b/firmware/microblaze/usrp2/memory_map.h @@ -463,6 +463,9 @@ typedef struct { typedef struct { volatile uint32_t num_chan; volatile uint32_t clear_state; // clears out state machine, fifos, + volatile uint32_t report_sid; + volatile uint32_t policy; + volatile uint32_t cyc_per_up; } sr_tx_ctrl_t; #define sr_tx_ctrl ((sr_tx_ctrl_t *) _SR_ADDR(SR_TX_CTRL)) -- cgit v1.2.3