soc/software/libnet: add debug defines on microudp
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 7 Dec 2015 11:03:36 +0000 (12:03 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 7 Dec 2015 11:03:36 +0000 (12:03 +0100)
litex/soc/software/libnet/microudp.c

index 1f0191fb731b3c56db0620485acb1b08b4edde71..100bd6f949044d247b71ac896c30aefce1f3109d 100644 (file)
@@ -9,6 +9,9 @@
 
 #include <net/microudp.h>
 
+//#define DEBUG_MICROUDP_TX
+//#define DEBUG_MICROUDP_TX
+
 #define ETHERTYPE_ARP 0x0806
 #define ETHERTYPE_IP  0x0800
 
@@ -132,6 +135,15 @@ static void send_packet(void)
        txbuffer->raw[txlen+3] = (crc & 0xff000000) >> 24;
        txlen += 4;
 #endif
+
+#ifdef DEBUG_MICROUDP_TX
+       int j;
+       printf(">>>> txlen : %d\n", txlen);
+       for(j=0;j<txlen;j++)
+               printf("%02x",txbuffer->raw[j]);
+       printf("\n");
+#endif
+
        ethmac_sram_reader_slot_write(txslot);
        ethmac_sram_reader_length_write(txlen);
        while(!(ethmac_sram_reader_ready_read()));
@@ -357,6 +369,14 @@ static void process_frame(void)
 {
        flush_cpu_dcache();
 
+#ifdef DEBUG_MICROUDP_RX
+       int j;
+       printf("<<< rxlen : %d\n", rxlen);
+       for(j=0;j<rxlen;j++)
+               printf("%02x", rxbuffer->raw[j]);
+       printf("\n");
+#endif
+
 #ifndef HW_PREAMBLE_CRC
        int i;
        for(i=0;i<7;i++)