diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-23 18:09:51 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-12-11 18:43:10 -0800 |
commit | 07de916b7646c78d4ad5ba9104d52343e993d198 (patch) | |
tree | 405a679edfadec9d98103e8c2d5b9bb531841096 /firmware/microblaze/lib/net_common.c | |
parent | 95499e2e132b1c619704b6fbc452e661633b3233 (diff) | |
download | uhd-07de916b7646c78d4ad5ba9104d52343e993d198.tar.gz uhd-07de916b7646c78d4ad5ba9104d52343e993d198.tar.bz2 uhd-07de916b7646c78d4ad5ba9104d52343e993d198.zip |
packet_router: added sregs for ip addr and ports
the pkt control now programs the inspector with port and ip addr
set the eth mac to pass all unicast
added easy debug flag to net common
Diffstat (limited to 'firmware/microblaze/lib/net_common.c')
-rw-r--r-- | firmware/microblaze/lib/net_common.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c index 9804ae4c5..947f41dae 100644 --- a/firmware/microblaze/lib/net_common.c +++ b/firmware/microblaze/lib/net_common.c @@ -37,6 +37,8 @@ #include <string.h> #include "pkt_ctrl.h" +static const bool debug = false; + static const eth_mac_addr_t BCAST_MAC_ADDR = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}; // ------------------------------------------------------------------------ @@ -159,7 +161,7 @@ send_pkt(eth_mac_addr_t dst, int ethertype, total_len = 60; pkt_ctrl_commit_outgoing_buffer(total_len/4); - //printf("sent %d bytes\n", total_len); + if (debug) printf("sent %d bytes\n", (int)total_len); } unsigned int CHKSUM(unsigned int x, unsigned int *chksum) @@ -388,9 +390,9 @@ handle_arp_packet(struct arp_eth_ipv4 *p, size_t size) void handle_eth_packet(uint32_t *p, size_t nlines) { - //static size_t bcount = 0; - //printf("===> %d\n", bcount++); - //print_buffer(p, nlines); + static size_t bcount = 0; + if (debug) printf("===> %d\n", (int)bcount++); + if (debug) print_buffer(p, nlines); padded_eth_hdr_t *eth_hdr = (padded_eth_hdr_t *)p; |