summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c14
-rw-r--r--firmware/microblaze/usrp2/memory_map.h9
-rw-r--r--firmware/microblaze/usrp2p/memory_map.h9
-rw-r--r--host/lib/usrp/usrp2/fw_common.h1
4 files changed, 28 insertions, 5 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 9c1873e1c..06f94e108 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -141,15 +141,22 @@ static void print_ip_addr(const void *t){
printf("%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
}
+void handle_udp_err0_packet(
+ struct socket_address src, struct socket_address dst,
+ unsigned char *payload, int payload_len
+){
+ sr_udp_sm->err0_port = src.port;
+}
+
void handle_udp_data_packet(
struct socket_address src, struct socket_address dst,
unsigned char *payload, int payload_len
){
- //its a tiny payload, load the fast-path variables
fp_mac_addr_src = *ethernet_mac_addr();
arp_cache_lookup_mac(&src.addr, &fp_mac_addr_dst);
fp_socket_src = dst;
fp_socket_dst = src;
+ sr_udp_sm->dsp0_port = src.port;
printf("Storing for fast path:\n");
printf(" source mac addr: ");
print_mac_addr(fp_mac_addr_src.addr); newline();
@@ -163,7 +170,7 @@ void handle_udp_data_packet(
printf(" destination udp port: %d\n", fp_socket_dst.port);
newline();
- //setup network and vrt
+ //setup network
setup_network();
// kick off the state machine
@@ -478,7 +485,7 @@ static void setup_network(void){
//setup the udp header machine
sr_udp_sm->udp_hdr.src_port = fp_socket_src.port;
- sr_udp_sm->udp_hdr.dst_port = fp_socket_dst.port;
+ sr_udp_sm->udp_hdr.dst_port = UDP_SM_INS_UDP_PORT;
sr_udp_sm->udp_hdr.length = UDP_SM_INS_UDP_LEN;
sr_udp_sm->udp_hdr.checksum = UDP_SM_LAST_WORD; // zero UDP checksum
}
@@ -521,6 +528,7 @@ main(void)
//2) register callbacks for udp ports we service
register_udp_listener(USRP2_UDP_CTRL_PORT, handle_udp_ctrl_packet);
register_udp_listener(USRP2_UDP_DATA_PORT, handle_udp_data_packet);
+ register_udp_listener(USRP2_UDP_ERR0_PORT, handle_udp_err0_packet);
register_udp_listener(USRP2_UDP_UPDATE_PORT, handle_udp_fw_update_packet);
//3) setup ethernet hardware to bring the link up
diff --git a/firmware/microblaze/usrp2/memory_map.h b/firmware/microblaze/usrp2/memory_map.h
index eac0c217f..2b91063b2 100644
--- a/firmware/microblaze/usrp2/memory_map.h
+++ b/firmware/microblaze/usrp2/memory_map.h
@@ -435,11 +435,18 @@ typedef struct {
uint32_t length;
uint32_t checksum; //word 22
} udp_hdr;
- volatile uint32_t _pad[32-23];
+ volatile uint32_t _pad[2];
+ volatile uint32_t dsp0_port;
+ volatile uint32_t err0_port;
+ volatile uint32_t dsp1_port;
+ volatile uint32_t err1_port;
} sr_udp_sm_t;
// control bits (all expect UDP_SM_LAST_WORD are mutually exclusive)
+// Insert a UDP dest port from the table
+#define UDP_SM_INS_UDP_PORT (1 << 20)
+
// This is the last word of the header
#define UDP_SM_LAST_WORD (1 << 19)
diff --git a/firmware/microblaze/usrp2p/memory_map.h b/firmware/microblaze/usrp2p/memory_map.h
index 3b2dc0057..140ab0675 100644
--- a/firmware/microblaze/usrp2p/memory_map.h
+++ b/firmware/microblaze/usrp2p/memory_map.h
@@ -462,11 +462,18 @@ typedef struct {
uint32_t length;
uint32_t checksum; //word 22
} udp_hdr;
- volatile uint32_t _pad[32-23];
+ volatile uint32_t _pad[2];
+ volatile uint32_t dsp0_port;
+ volatile uint32_t err0_port;
+ volatile uint32_t dsp1_port;
+ volatile uint32_t err1_port;
} sr_udp_sm_t;
// control bits (all expect UDP_SM_LAST_WORD are mutually exclusive)
+// Insert a UDP dest port from the table
+#define UDP_SM_INS_UDP_PORT (1 << 20)
+
// This is the last word of the header
#define UDP_SM_LAST_WORD (1 << 19)
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h
index a9c39e650..a26f56e8b 100644
--- a/host/lib/usrp/usrp2/fw_common.h
+++ b/host/lib/usrp/usrp2/fw_common.h
@@ -43,6 +43,7 @@ extern "C" {
// Dynamic and/or private ports: 49152-65535
#define USRP2_UDP_CTRL_PORT 49152
#define USRP2_UDP_DATA_PORT 49153
+#define USRP2_UDP_ERR0_PORT 49154
////////////////////////////////////////////////////////////////////////
// I2C addresses