浏览代码

compilation warnings cleanup

tags/v0.9.3
Marty Connor 18 年前
父节点
当前提交
859cc71158
共有 2 个文件被更改,包括 24 次插入27 次删除
  1. 17
    22
      src/drivers/net/sundance.c
  2. 7
    5
      src/drivers/net/tg3.c

+ 17
- 22
src/drivers/net/sundance.c 查看文件

@@ -65,14 +65,6 @@ struct mii_if_info {
65 65
 	unsigned int full_duplex:1;	/* is full duplex? */
66 66
 };
67 67
 
68
-//#define EDEBUG
69
-#ifdef EDEBUG
70
-#define dprintf(x) printf x
71
-#else
72
-#define dprintf(x)
73
-#endif
74
-
75
-
76 68
 /* Set the mtu */
77 69
 static int mtu = 1514;
78 70
 
@@ -319,10 +311,10 @@ static void check_duplex(struct nic *nic)
319 311
 	duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
320 312
 	if (sdc->mii_if.full_duplex != duplex) {
321 313
 		sdc->mii_if.full_duplex = duplex;
322
-		dprintf(("%s: Setting %s-duplex based on MII #%d "
314
+		DBG ("%s: Setting %s-duplex based on MII #%d "
323 315
 			 "negotiated capability %4.4x.\n", sdc->nic_name,
324 316
 			 duplex ? "full" : "half", sdc->phys[0],
325
-			 negotiated));
317
+			 negotiated );
326 318
 		outw(inw(BASE + MACCtrl0) | duplex ? 0x20 : 0,
327 319
 		     BASE + MACCtrl0);
328 320
 	}
@@ -424,11 +416,11 @@ static void sundance_reset(struct nic *nic)
424 416
 	txb[4] = nic->node_addr[4];
425 417
 	txb[5] = nic->node_addr[5];
426 418
 
427
-	dprintf(("%s: Done sundance_reset, status: Rx %hX Tx %hX "
428
-		 "MAC Control %hX, %hX %hX\n",
429
-		 sdc->nic_name, (int) inl(BASE + RxStatus),
430
-		 (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
431
-		 (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0)));
419
+	DBG ( "%s: Done sundance_reset, status: Rx %hX Tx %hX "
420
+	      "MAC Control %hX, %hX %hX\n",
421
+	      sdc->nic_name, (int) inl(BASE + RxStatus),
422
+	      (int) inw(BASE + TxStatus), (int) inl(BASE + MACCtrl0),
423
+	      (int) inw(BASE + MACCtrl1), (int) inw(BASE + MACCtrl0) );
432 424
 }
433 425
 
434 426
 /**************************************************************************
@@ -477,7 +469,7 @@ static int sundance_poll(struct nic *nic, int retreive)
477 469
 	pkt_len = frame_status & 0x1fff;
478 470
 
479 471
 	if (frame_status & 0x001f4000) {
480
-		dprintf(("Polling frame_status error\n"));	/* Do we really care about this */
472
+		DBG ( "Polling frame_status error\n" );	/* Do we really care about this */
481 473
 	} else {
482 474
 		if (pkt_len < rx_copybreak) {
483 475
 			/* FIXME: What should happen Will this ever occur */
@@ -615,9 +607,12 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
615 607
 	sdc->mtu = mtu;
616 608
 
617 609
 	pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
618
-	dprintf(("Device revision id: %hx\n", sdc->pci_rev_id));
610
+
611
+	DBG ( "Device revision id: %hx\n", sdc->pci_rev_id );
612
+
619 613
 	/* Print out some hardware info */
620
-	printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
614
+	DBG ( "%s: %s at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
615
+
621 616
 	sdc->mii_preamble_required = 0;
622 617
 	if (1) {
623 618
 		int phy, phy_idx = 0;
@@ -631,8 +626,8 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
631 626
 				    mdio_read(nic, phy, MII_ADVERTISE);
632 627
 				if ((mii_status & 0x0040) == 0)
633 628
 					sdc->mii_preamble_required++;
634
-				dprintf
635
-				    (("%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising));
629
+				DBG 
630
+				    ( "%s: MII PHY found at address %d, status " "%hX advertising %hX\n", sdc->nic_name, phy, mii_status, sdc->mii_if.advertising );
636 631
 			}
637 632
 		}
638 633
 		sdc->mii_preamble_required--;
@@ -695,9 +690,9 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
695 690
 	}
696 691
 
697 692
 	/* Reset the chip to erase previous misconfiguration */
698
-	dprintf(("ASIC Control is %x.\n", inl(BASE + ASICCtrl)));
693
+	DBG ( "ASIC Control is %#lx\n", inl(BASE + ASICCtrl) );
699 694
 	outw(0x007f, BASE + ASICCtrl + 2);
700
-	dprintf(("ASIC Control is now %x.\n", inl(BASE + ASICCtrl)));
695
+	DBG ( "ASIC Control is now %#lx.\n", inl(BASE + ASICCtrl) );
701 696
 
702 697
 	sundance_reset(nic);
703 698
 	if (sdc->an_enable) {

+ 7
- 5
src/drivers/net/tg3.c 查看文件

@@ -15,6 +15,7 @@
15 15
 #include "etherboot.h"
16 16
 #include "nic.h"
17 17
 #include <gpxe/pci.h>
18
+#include <gpxe/ethernet.h>
18 19
 #include "timer.h"
19 20
 #include "string.h"
20 21
 #include "tg3.h"
@@ -1465,8 +1466,8 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, uint32_t enable_bit
1465 1466
 	}
1466 1467
 
1467 1468
 	if (i == MAX_WAIT_CNT) {
1468
-		printf("tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
1469
-		       ofs, enable_bit);
1469
+		printf( "tg3_stop_block timed out, ofs=%#lx enable_bit=%3lx\n",
1470
+		       ofs, enable_bit );
1470 1471
 		return -ENODEV;
1471 1472
 	}
1472 1473
 
@@ -1651,8 +1652,8 @@ static int tg3_restart_fw(struct tg3 *tp, uint32_t state)
1651 1652
 	}
1652 1653
 	if (i >= 100000 &&
1653 1654
 		    !(tp->tg3_flags2 & TG3_FLG2_SUN_5704)) {
1654
-		printf("Firmware will not restart magic=%x\n",
1655
-			val);
1655
+		printf ( "Firmware will not restart magic=%#lx\n",
1656
+			val );
1656 1657
 		return -ENODEV;
1657 1658
 	}
1658 1659
 	if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
@@ -3311,7 +3312,8 @@ static int tg3_probe ( struct nic *nic, struct pci_device *pdev ) {
3311 3312
 		printf("Could not obtain valid ethernet address, aborting.\n");
3312 3313
 		goto err_out_iounmap;
3313 3314
 	}
3314
-	printf("Ethernet addr: %!\n", nic->node_addr);
3315
+
3316
+	DBG ( "Ethernet addr: %s\n", eth_ntoa ( nic->node_addr ) );
3315 3317
 
3316 3318
 	tg3_setup_dma(tp);
3317 3319
 

正在加载...
取消
保存