This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

consistend debug printing in packages\io\eth\current\src\net\eth_drv.c


Hello,

debug printing (#ifdef CYGDBG_IO_ETH_DRIVERS_DEBUG) is not consistenf for rx and tx
For RX (in eth_drv_recv()) the sg_list[i] is printed with i starting from 0.
But for TX (in eth_drv_send()) the sg_list[i] is printed with i starting from 1. This because i (actually sg_len) is incremented before the debug printing instead of after it.


In attachment my patch.

Kind regards,
Juergen

--- F:\version_ecos\packages\io\eth\current\src\net\eth_drv.c	2006-02-03 13:10:36.000000000 +-0200
+++ F:\ecos_ronetix\packages\io\eth\current\src\net\eth_drv.c	2008-06-02 14:36:21.000000000 +-0200
@@ -689,23 +689,23 @@
         for (m = m0; m ; m = m->m_next) {
             data = mtod(m, u_char *);
             len = m->m_len;
             total_len += len;
             sg_list[sg_len].buf = (CYG_ADDRESS)data;
             sg_list[sg_len].len = len;
-            if ( len )
-                sg_len++;
 #ifdef CYGDBG_IO_ETH_DRIVERS_DEBUG
             if (cyg_io_eth_net_debug) {
                 START_CONSOLE();
                 diag_printf("xmit %d bytes at %p sg[%d]\n", len, data, sg_len);
                 if ( cyg_io_eth_net_debug > 1)
                     diag_dump_buf(data, len);
                 END_CONSOLE();
             }
 #endif
+            if ( len )
+                sg_len++;
             if (m->m_next && (MAX_ETH_DRV_SG <= sg_len)) {
 #ifdef CYGPKG_IO_ETH_DRIVERS_WARN_NO_MBUFS
                 int needed = 0;
                 struct mbuf *m1;
                 for (m1 = m0; m1 ; m1 = m1->m_next) needed++;
                 START_CONSOLE();

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]