@@ -46,7 +46,7 @@
#include <asm/io.h>
#include "davinci_emac.h"
-unsigned int emac_dbg = 0;
+unsigned int emac_dbg = 1;
#define debug_emac(fmt,args...) if (emac_dbg) printf(fmt,##args)
#ifdef EMAC_HW_RAM_ADDR
@@ -699,12 +699,34 @@ static int davinci_eth_rcv_packet (struct eth_device
*dev)
volatile emac_desc *rx_curr_desc;
volatile emac_desc *curr_desc;
volatile emac_desc *tail_desc;
- int status, ret = -1;
-
+ int status, ret = -1, i;
+
davinci_invalidate_rx_descs();
rx_curr_desc = emac_rx_active_head;
status = rx_curr_desc->pkt_flag_len;
+ unsigned long tmp_status = rx_curr_desc->pkt_flag_len;
+ unsigned long tmp_macstatus, tmp_maccontrol, tmp_macintmaskset;
+ tmp_macstatus = readl(&adap_emac->MACSTATUS);
+ tmp_maccontrol = readl(&adap_emac->MACCONTROL);
+ tmp_macintmaskset = readl(&adap_emac->MACINTMASKSET);
+ printf("Receive Status: %ul\n",tmp_status);
+ printf("MACSTATUS = %ul, MACCONTROL = %ul\n", tmp_macstatus,
tmp_maccontrol);
+ if(rx_curr_desc != NULL) {
+ printf("Rx active head: %p\n",rx_curr_desc);
+ printf("Buffer length: %d\n",rx_curr_desc->buff_off_len &
0xffff);
+ printf("Packet length: %d\n",rx_curr_desc->pkt_flag_len &
0xffff);
+ struct ethernet_hdr *tmp_pkt = (struct ethernet_hdr
*)((uchar *) rx_curr_desc->buffer);
+ printf("Dest Node\n");
+ for(i=0;i<6;i++)
+ printf("%u ",tmp_pkt->et_dest[i]);
+ printf("\n");
+ printf("Src Node\n");
+ for(i=0;i<6;i++)
+ printf("%u ",tmp_pkt->et_src[i]);
+ printf("\n");
+ printf("ProtLen: %d\n",tmp_pkt->et_protlen);
+ }
if ((rx_curr_desc) && ((status & EMAC_CPPI_OWNERSHIP_BIT) == 0)) {
if (status & EMAC_CPPI_RX_ERROR_FRAME) {
/* Error in packet - discard it and requeue desc */
@@ -19,10 +19,10 @@
#include <asm/cache.h>
#include <asm/byteorder.h> /* for nton* / ntoh* stuff */
-#define DEBUG_LL_STATE 0 /* Link local state machine changes */
-#define DEBUG_DEV_PKT 0 /* Packets or info directed to the
device */
-#define DEBUG_NET_PKT 0 /* Packets on info on the network
at large */
-#define DEBUG_INT_STATE 0 /* Internal network state changes */
+#define DEBUG_LL_STATE 1 /* Link local state machine changes */
+#define DEBUG_DEV_PKT 1 /* Packets or info directed to the
device */
+#define DEBUG_NET_PKT 1 /* Packets on info on the network
at large */