Browse Source

[davicom] Use iPXE debugging infrastructure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
24403fba6e
1 changed files with 6 additions and 25 deletions
  1. 6
    25
      src/drivers/net/davicom.c

+ 6
- 25
src/drivers/net/davicom.c View File

@@ -48,9 +48,6 @@ FILE_LICENCE ( GPL_ANY );
48 48
 #include <ipxe/pci.h>
49 49
 #include <ipxe/ethernet.h>
50 50
 
51
-#undef DAVICOM_DEBUG
52
-#undef DAVICOM_DEBUG_WHERE
53
-
54 51
 #define TX_TIME_OUT       2*TICKS_PER_SEC
55 52
 
56 53
 /* Register offsets for davicom device */
@@ -163,9 +160,6 @@ static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
163 160
 			   unsigned int s, const char *p);
164 161
 static int davicom_poll(struct nic *nic, int retrieve);
165 162
 static void davicom_disable(struct nic *nic);
166
-#ifdef	DAVICOM_DEBUG
167
-static void davicom_more(void);
168
-#endif /* DAVICOM_DEBUG */
169 163
 static void davicom_wait(unsigned int nticks);
170 164
 static int phy_read(int);
171 165
 static void phy_write(int, u16);
@@ -179,21 +173,10 @@ static void davicom_media_chk(struct nic *);
179 173
 /*********************************************************************/
180 174
 static inline void whereami(const char *str)
181 175
 {
182
-  printf("%s\n", str);
176
+  DBGP("%s\n", str);
183 177
   /* sleep(2); */
184 178
 }
185 179
 
186
-#ifdef	DAVICOM_DEBUG
187
-static void davicom_more()
188
-{
189
-  printf("\n\n-- more --");
190
-  while (!iskey())
191
-    /* wait */;
192
-  getchar();
193
-  printf("\n\n");
194
-}
195
-#endif /* DAVICOM_DEBUG */
196
-
197 180
 static void davicom_wait(unsigned int nticks)
198 181
 {
199 182
   unsigned int to = currticks() + nticks;
@@ -519,16 +502,14 @@ static void davicom_reset(struct nic *nic)
519 502
     /* wait */ ;
520 503
 
521 504
   if (currticks() >= to) {
522
-    printf ("TX Setup Timeout!\n");
505
+    DBG ("TX Setup Timeout!\n");
523 506
   }
524 507
   /* Point to next TX descriptor */
525 508
  TxPtr = (++TxPtr >= NTXD) ? 0:TxPtr;	/* Sten 10/9 */
526 509
 
527
-#ifdef DAVICOM_DEBUG
528
-  printf("txd.status = %X\n", txd.status);
529
-  printf("ticks = %d\n", currticks() - (to - TX_TIME_OUT));
530
-  davicom_more();
531
-#endif
510
+  DBG("txd.status = %lX\n", txd[TxPtr].status);
511
+  DBG("ticks = %ld\n", currticks() - (to - TX_TIME_OUT));
512
+  DBG_MORE();
532 513
 
533 514
   /* enable RX */
534 515
   outl(inl(ioaddr + CSR6) | 0x00000002, ioaddr + CSR6);
@@ -570,7 +551,7 @@ static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
570 551
     /* wait */ ;
571 552
 
572 553
   if (currticks() >= to) {
573
-    printf ("TX Timeout!\n");
554
+    DBG ("TX Timeout!\n");
574 555
   }
575 556
  
576 557
   /* Point to next TX descriptor */

Loading…
Cancel
Save