summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-23 09:57:33 -0800
committerJosh Blum <josh@joshknows.com>2010-11-23 09:57:33 -0800
commitd35b7327710f08f96f2cfb93bcc28f14515ea9bb (patch)
tree0cfe31630905570c776a45746fcb3e2011d3dabd /firmware/microblaze
parent6741de7b4545bb33d22cc6508e121023dd1a7a8c (diff)
parent768af46dc01d036999cb60ff16df4215d014c906 (diff)
downloaduhd-d35b7327710f08f96f2cfb93bcc28f14515ea9bb.tar.gz
uhd-d35b7327710f08f96f2cfb93bcc28f14515ea9bb.tar.bz2
uhd-d35b7327710f08f96f2cfb93bcc28f14515ea9bb.zip
Merge branch 'flow_ctrl' into next
Diffstat (limited to 'firmware/microblaze')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c2
-rw-r--r--firmware/microblaze/lib/net_common.c11
-rw-r--r--firmware/microblaze/lib/pic.c2
-rw-r--r--firmware/microblaze/usrp2/memory_map.h4
-rw-r--r--firmware/microblaze/usrp2p/memory_map.h4
-rw-r--r--firmware/microblaze/usrp2p/udp_fw_update.c4
6 files changed, 22 insertions, 5 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index c7163b6bf..9c1873e1c 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -396,7 +396,7 @@ eth_pkt_inspector(dbsm_t *sm, int bufno)
// In the future, a hardware state machine will do this...
if ( //warning! magic numbers approaching....
(((buff + ((2 + 14 + 20)/sizeof(uint32_t)))[0] & 0xffff) == USRP2_UDP_DATA_PORT) &&
- ((buff + ((2 + 14 + 20 + 8)/sizeof(uint32_t)))[0] != USRP2_INVALID_VRT_HEADER)
+ ((buff + ((2 + 14 + 20 + 8)/sizeof(uint32_t)))[1] != USRP2_INVALID_VRT_HEADER)
) return false;
//test if its an ip recovery packet
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c
index beaaa5948..6305408d6 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; //no samples now
+ 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/lib/pic.c b/firmware/microblaze/lib/pic.c
index e89d2b755..226da5f85 100644
--- a/firmware/microblaze/lib/pic.c
+++ b/firmware/microblaze/lib/pic.c
@@ -44,7 +44,7 @@ pic_init(void)
// uP is level triggered
pic_regs->mask = ~0; // mask all interrupts
- pic_regs->edge_enable = PIC_ONETIME_INT;
+ pic_regs->edge_enable = PIC_ONETIME_INT | PIC_UNDERRUN_INT | PIC_OVERRUN_INT | PIC_PPS_INT;
pic_regs->polarity = ~0 & ~PIC_PHY_INT; // rising edge
pic_regs->pending = ~0; // clear all pending ints
}
diff --git a/firmware/microblaze/usrp2/memory_map.h b/firmware/microblaze/usrp2/memory_map.h
index 41a2820bc..eac0c217f 100644
--- a/firmware/microblaze/usrp2/memory_map.h
+++ b/firmware/microblaze/usrp2/memory_map.h
@@ -463,6 +463,10 @@ 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;
+ volatile uint32_t packets_per_up;
} sr_tx_ctrl_t;
#define sr_tx_ctrl ((sr_tx_ctrl_t *) _SR_ADDR(SR_TX_CTRL))
diff --git a/firmware/microblaze/usrp2p/memory_map.h b/firmware/microblaze/usrp2p/memory_map.h
index 8d0d0c365..3b2dc0057 100644
--- a/firmware/microblaze/usrp2p/memory_map.h
+++ b/firmware/microblaze/usrp2p/memory_map.h
@@ -490,6 +490,10 @@ 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;
+ volatile uint32_t packets_per_up;
} sr_tx_ctrl_t;
#define sr_tx_ctrl ((sr_tx_ctrl_t *) _SR_ADDR(SR_TX_CTRL))
diff --git a/firmware/microblaze/usrp2p/udp_fw_update.c b/firmware/microblaze/usrp2p/udp_fw_update.c
index 55c206b1b..ead08ad2c 100644
--- a/firmware/microblaze/usrp2p/udp_fw_update.c
+++ b/firmware/microblaze/usrp2p/udp_fw_update.c
@@ -38,13 +38,13 @@ void handle_udp_fw_update_packet(struct socket_address src, struct socket_addres
usrp2_fw_update_id_t update_data_in_id = update_data_in->id;
//ensure that the protocol versions match
- if (payload_len >= sizeof(uint32_t) && update_data_in->proto_ver != USRP2_FW_COMPAT_NUM){
+/* if (payload_len >= sizeof(uint32_t) && update_data_in->proto_ver != USRP2_FW_COMPAT_NUM){
printf("!Error in update packet handler: Expected compatibility number %d, but got %d\n",
USRP2_FW_COMPAT_NUM, update_data_in->proto_ver
);
update_data_in_id = USRP2_FW_UPDATE_ID_OHAI_LOL; //so we can respond
}
-
+*/
//ensure that this is not a short packet
if (payload_len < sizeof(usrp2_fw_update_data_t)){
printf("!Error in update packet handler: Expected payload length %d, but got %d\n",