Browse Source

compilation warnings cleanup

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
859cc71158
2 changed files with 24 additions and 27 deletions
  1. 17
    22
      src/drivers/net/sundance.c
  2. 7
    5
      src/drivers/net/tg3.c

+ 17
- 22
src/drivers/net/sundance.c View File

65
 	unsigned int full_duplex:1;	/* is full duplex? */
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
 /* Set the mtu */
68
 /* Set the mtu */
77
 static int mtu = 1514;
69
 static int mtu = 1514;
78
 
70
 
319
 	duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
311
 	duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
320
 	if (sdc->mii_if.full_duplex != duplex) {
312
 	if (sdc->mii_if.full_duplex != duplex) {
321
 		sdc->mii_if.full_duplex = duplex;
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
 			 "negotiated capability %4.4x.\n", sdc->nic_name,
315
 			 "negotiated capability %4.4x.\n", sdc->nic_name,
324
 			 duplex ? "full" : "half", sdc->phys[0],
316
 			 duplex ? "full" : "half", sdc->phys[0],
325
-			 negotiated));
317
+			 negotiated );
326
 		outw(inw(BASE + MACCtrl0) | duplex ? 0x20 : 0,
318
 		outw(inw(BASE + MACCtrl0) | duplex ? 0x20 : 0,
327
 		     BASE + MACCtrl0);
319
 		     BASE + MACCtrl0);
328
 	}
320
 	}
424
 	txb[4] = nic->node_addr[4];
416
 	txb[4] = nic->node_addr[4];
425
 	txb[5] = nic->node_addr[5];
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
 	pkt_len = frame_status & 0x1fff;
469
 	pkt_len = frame_status & 0x1fff;
478
 
470
 
479
 	if (frame_status & 0x001f4000) {
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
 	} else {
473
 	} else {
482
 		if (pkt_len < rx_copybreak) {
474
 		if (pkt_len < rx_copybreak) {
483
 			/* FIXME: What should happen Will this ever occur */
475
 			/* FIXME: What should happen Will this ever occur */
615
 	sdc->mtu = mtu;
607
 	sdc->mtu = mtu;
616
 
608
 
617
 	pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
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
 	/* Print out some hardware info */
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
 	sdc->mii_preamble_required = 0;
616
 	sdc->mii_preamble_required = 0;
622
 	if (1) {
617
 	if (1) {
623
 		int phy, phy_idx = 0;
618
 		int phy, phy_idx = 0;
631
 				    mdio_read(nic, phy, MII_ADVERTISE);
626
 				    mdio_read(nic, phy, MII_ADVERTISE);
632
 				if ((mii_status & 0x0040) == 0)
627
 				if ((mii_status & 0x0040) == 0)
633
 					sdc->mii_preamble_required++;
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
 		sdc->mii_preamble_required--;
633
 		sdc->mii_preamble_required--;
695
 	}
690
 	}
696
 
691
 
697
 	/* Reset the chip to erase previous misconfiguration */
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
 	outw(0x007f, BASE + ASICCtrl + 2);
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
 	sundance_reset(nic);
697
 	sundance_reset(nic);
703
 	if (sdc->an_enable) {
698
 	if (sdc->an_enable) {

+ 7
- 5
src/drivers/net/tg3.c View File

15
 #include "etherboot.h"
15
 #include "etherboot.h"
16
 #include "nic.h"
16
 #include "nic.h"
17
 #include <gpxe/pci.h>
17
 #include <gpxe/pci.h>
18
+#include <gpxe/ethernet.h>
18
 #include "timer.h"
19
 #include "timer.h"
19
 #include "string.h"
20
 #include "string.h"
20
 #include "tg3.h"
21
 #include "tg3.h"
1465
 	}
1466
 	}
1466
 
1467
 
1467
 	if (i == MAX_WAIT_CNT) {
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
 		return -ENODEV;
1471
 		return -ENODEV;
1471
 	}
1472
 	}
1472
 
1473
 
1651
 	}
1652
 	}
1652
 	if (i >= 100000 &&
1653
 	if (i >= 100000 &&
1653
 		    !(tp->tg3_flags2 & TG3_FLG2_SUN_5704)) {
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
 		return -ENODEV;
1657
 		return -ENODEV;
1657
 	}
1658
 	}
1658
 	if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
1659
 	if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
3311
 		printf("Could not obtain valid ethernet address, aborting.\n");
3312
 		printf("Could not obtain valid ethernet address, aborting.\n");
3312
 		goto err_out_iounmap;
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
 	tg3_setup_dma(tp);
3318
 	tg3_setup_dma(tp);
3317
 
3319
 

Loading…
Cancel
Save