ソースを参照

[davicom] Use iPXE debugging infrastructure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14年前
コミット
24403fba6e
1個のファイルの変更6行の追加25行の削除
  1. 6
    25
      src/drivers/net/davicom.c

+ 6
- 25
src/drivers/net/davicom.c ファイルの表示

48
 #include <ipxe/pci.h>
48
 #include <ipxe/pci.h>
49
 #include <ipxe/ethernet.h>
49
 #include <ipxe/ethernet.h>
50
 
50
 
51
-#undef DAVICOM_DEBUG
52
-#undef DAVICOM_DEBUG_WHERE
53
-
54
 #define TX_TIME_OUT       2*TICKS_PER_SEC
51
 #define TX_TIME_OUT       2*TICKS_PER_SEC
55
 
52
 
56
 /* Register offsets for davicom device */
53
 /* Register offsets for davicom device */
163
 			   unsigned int s, const char *p);
160
 			   unsigned int s, const char *p);
164
 static int davicom_poll(struct nic *nic, int retrieve);
161
 static int davicom_poll(struct nic *nic, int retrieve);
165
 static void davicom_disable(struct nic *nic);
162
 static void davicom_disable(struct nic *nic);
166
-#ifdef	DAVICOM_DEBUG
167
-static void davicom_more(void);
168
-#endif /* DAVICOM_DEBUG */
169
 static void davicom_wait(unsigned int nticks);
163
 static void davicom_wait(unsigned int nticks);
170
 static int phy_read(int);
164
 static int phy_read(int);
171
 static void phy_write(int, u16);
165
 static void phy_write(int, u16);
179
 /*********************************************************************/
173
 /*********************************************************************/
180
 static inline void whereami(const char *str)
174
 static inline void whereami(const char *str)
181
 {
175
 {
182
-  printf("%s\n", str);
176
+  DBGP("%s\n", str);
183
   /* sleep(2); */
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
 static void davicom_wait(unsigned int nticks)
180
 static void davicom_wait(unsigned int nticks)
198
 {
181
 {
199
   unsigned int to = currticks() + nticks;
182
   unsigned int to = currticks() + nticks;
519
     /* wait */ ;
502
     /* wait */ ;
520
 
503
 
521
   if (currticks() >= to) {
504
   if (currticks() >= to) {
522
-    printf ("TX Setup Timeout!\n");
505
+    DBG ("TX Setup Timeout!\n");
523
   }
506
   }
524
   /* Point to next TX descriptor */
507
   /* Point to next TX descriptor */
525
  TxPtr = (++TxPtr >= NTXD) ? 0:TxPtr;	/* Sten 10/9 */
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
   /* enable RX */
514
   /* enable RX */
534
   outl(inl(ioaddr + CSR6) | 0x00000002, ioaddr + CSR6);
515
   outl(inl(ioaddr + CSR6) | 0x00000002, ioaddr + CSR6);
570
     /* wait */ ;
551
     /* wait */ ;
571
 
552
 
572
   if (currticks() >= to) {
553
   if (currticks() >= to) {
573
-    printf ("TX Timeout!\n");
554
+    DBG ("TX Timeout!\n");
574
   }
555
   }
575
  
556
  
576
   /* Point to next TX descriptor */
557
   /* Point to next TX descriptor */

読み込み中…
キャンセル
保存