add additional debug messages

This commit is contained in:
Stefan Lankes 2011-09-14 23:41:34 -07:00
parent 28429af30b
commit bf28c95b75

View file

@ -227,6 +227,7 @@ static err_t rckemacif_output(struct netif* netif, struct pbuf* p)
rckemacif->tx_write_offset = 1;
packets = CLINE_PACKETS(p->tot_len + 2);
LWIP_DEBUGF(NETIF_DEBUG, ("TX packets: %d\n", packets));
read_offset = read_emac(rckemacif->num_emac, EMAC_TX_CONTROL+EMAC_TX_BUFFER_READ_OFFSET, rckemacif->core);
#if 1
@ -317,7 +318,7 @@ again:
*((int*)RCCE_fool_write_combine_buffer) = 1;
/* set new write offset */
//LWIP_DEBUGF(NETIF_DEBUG, ("Update tx write offset: %d (read offset %d)\n", rckemacif->tx_write_offset, read_offset));
LWIP_DEBUGF(NETIF_DEBUG, ("Update tx write offset: %d (read offset %d)\n", rckemacif->tx_write_offset, read_offset));
write_emac(rckemacif->num_emac, EMAC_TX_CONTROL+EMAC_TX_BUFFER_WRITE_OFFSET, rckemacif->core, rckemacif->tx_write_offset);
#if ETH_PAD_SIZE
@ -335,7 +336,7 @@ static void rckemacif_input(struct netif* netif, struct pbuf* p)
err_t err;
/* points to packet payload, which starts with an Ethernet header */
ethhdr = p->payload;
ethhdr = (struct eth_hdr *) p->payload;
switch (htons(ethhdr->type)) {
/* IP or ARP packet? */
@ -364,7 +365,7 @@ static void rckemacif_rx_handler(struct netif* netif, unsigned int write_offset)
unsigned short read_offset = rckemacif->rx_read_offset;
volatile void *addr = NULL;
uint16_t i, length = 0;
struct pbuf *p;
struct pbuf *p = NULL;
struct pbuf* q;
if (write_offset > rckemacif->rx_buffer_max) {
@ -476,7 +477,6 @@ out:
#if ETH_PAD_SIZE
pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
#endif
rckemacif_input(netif, p);
LINK_STATS_INC(link.recv);
} else {
LWIP_DEBUGF(NETIF_DEBUG, ("rckemacif_rx_inthandler: not enough memory!\n"));
@ -490,6 +490,11 @@ rxDone:
write_emac(rckemacif->num_emac, EMAC_RX_CONTROL + EMAC_RX_BUFFER_READ_OFFSET, rckemacif->core, read_offset);
rckemacif->rx_read_offset = read_offset;
if (p) {
rckemacif_input(netif, p);
p = NULL;
}
if (read_offset != write_offset)
goto again;
}