aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib/net_common.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-22 13:54:48 -0800
committerJosh Blum <josh@joshknows.com>2010-12-11 18:43:09 -0800
commit95499e2e132b1c619704b6fbc452e661633b3233 (patch)
tree963a1e67d8a4cd2c24547272a812ba762cfb0e77 /firmware/microblaze/lib/net_common.c
parent6004410a7b73a52d95b8f5f0cf0fa969bef4e910 (diff)
downloaduhd-95499e2e132b1c619704b6fbc452e661633b3233.tar.gz
uhd-95499e2e132b1c619704b6fbc452e661633b3233.tar.bz2
uhd-95499e2e132b1c619704b6fbc452e661633b3233.zip
packet_router: dont register mac, also reorganized some tidbits
Diffstat (limited to 'firmware/microblaze/lib/net_common.c')
-rw-r--r--firmware/microblaze/lib/net_common.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c
index e9b633b13..9804ae4c5 100644
--- a/firmware/microblaze/lib/net_common.c
+++ b/firmware/microblaze/lib/net_common.c
@@ -162,7 +162,15 @@ send_pkt(eth_mac_addr_t dst, int ethertype,
//printf("sent %d bytes\n", total_len);
}
-unsigned int
+unsigned int CHKSUM(unsigned int x, unsigned int *chksum)
+{
+ *chksum += x;
+ *chksum = (*chksum & 0xffff) + (*chksum>>16);
+ *chksum = (*chksum & 0xffff) + (*chksum>>16);
+ return x;
+}
+
+static unsigned int
chksum_buffer(unsigned short *buf, int nshorts, unsigned int initial_chksum)
{
unsigned int chksum = initial_chksum;
@@ -172,7 +180,6 @@ chksum_buffer(unsigned short *buf, int nshorts, unsigned int initial_chksum)
return chksum;
}
-
void
send_ip_pkt(struct ip_addr dst, int protocol,
const void *buf0, size_t len0,