From 07de916b7646c78d4ad5ba9104d52343e993d198 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 23 Nov 2010 18:09:51 -0800 Subject: 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 --- firmware/microblaze/lib/net_common.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'firmware/microblaze/lib/net_common.c') 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 #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; -- cgit v1.2.3