summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-17 13:45:57 -0800
committerJosh Blum <josh@joshknows.com>2010-12-17 13:45:57 -0800
commit0e66165d43d896bbc263dcf3481b94450d7de89f (patch)
treec6ab3365d456a9c359003f87846a55938ca8d800 /firmware/microblaze/apps
parent72c7a0c9f0e41afe9713465eaa6ff2f189122753 (diff)
downloaduhd-0e66165d43d896bbc263dcf3481b94450d7de89f.tar.gz
uhd-0e66165d43d896bbc263dcf3481b94450d7de89f.tar.bz2
uhd-0e66165d43d896bbc263dcf3481b94450d7de89f.zip
udp_ports: set the source and destination ports
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 06f94e108..4f331718f 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -141,14 +141,18 @@ 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(
+static 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;
+ sr_udp_sm->err0_port = (((uint32_t)dst.port) << 16) | src.port;
+ printf("Storing for async error path:\n");
+ printf(" source udp port: %d\n", dst.port);
+ printf(" destination udp port: %d\n", src.port);
+ newline();
}
-void handle_udp_data_packet(
+static void handle_udp_data_packet(
struct socket_address src, struct socket_address dst,
unsigned char *payload, int payload_len
){
@@ -156,7 +160,7 @@ void handle_udp_data_packet(
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;
+ sr_udp_sm->dsp0_port = (((uint32_t)dst.port) << 16) | src.port;
printf("Storing for fast path:\n");
printf(" source mac addr: ");
print_mac_addr(fp_mac_addr_src.addr); newline();
@@ -208,7 +212,7 @@ void get_spi_readback_data(void) {
spi_register_callback(0);
}
-void handle_udp_ctrl_packet(
+static void handle_udp_ctrl_packet(
struct socket_address src, struct socket_address dst,
unsigned char *payload, int payload_len
){
@@ -484,8 +488,8 @@ static void setup_network(void){
sr_udp_sm->ip_hdr.checksum = UDP_SM_INS_IP_HDR_CHKSUM | (chksum & 0xffff);
//setup the udp header machine
- sr_udp_sm->udp_hdr.src_port = fp_socket_src.port;
- sr_udp_sm->udp_hdr.dst_port = UDP_SM_INS_UDP_PORT;
+ sr_udp_sm->udp_hdr.src_port = UDP_SM_INS_UDP_SRC_PORT;
+ sr_udp_sm->udp_hdr.dst_port = UDP_SM_INS_UDP_DST_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
}