Browse Source

eth_ntoa and warnings fixups

tags/v0.9.3
Marty Connor 18 years ago
parent
commit
d86c080024
1 changed files with 17 additions and 13 deletions
  1. 17
    13
      src/drivers/net/ns8390.c

+ 17
- 13
src/drivers/net/ns8390.c View File

32
 #include "etherboot.h"
32
 #include "etherboot.h"
33
 #include "nic.h"
33
 #include "nic.h"
34
 #include "ns8390.h"
34
 #include "ns8390.h"
35
+#include <gpxe/ethernet.h>
35
 #ifdef	INCLUDE_NS8390
36
 #ifdef	INCLUDE_NS8390
36
 #include <gpxe/pci.h>
37
 #include <gpxe/pci.h>
37
 #else
38
 #else
588
 NS8390_DISABLE - Turn off adapter
589
 NS8390_DISABLE - Turn off adapter
589
 **************************************************************************/
590
 **************************************************************************/
590
 static void ns8390_disable ( struct nic *nic ) {
591
 static void ns8390_disable ( struct nic *nic ) {
591
-	/* reset and disable merge */
592
 	ns8390_reset(nic);
592
 	ns8390_reset(nic);
593
 }
593
 }
594
 
594
 
687
 	for (i=0; i<ETH_ALEN; i++) {
687
 	for (i=0; i<ETH_ALEN; i++) {
688
 		nic->node_addr[i] = inb(i+eth_asic_base+WD_LAR);
688
 		nic->node_addr[i] = inb(i+eth_asic_base+WD_LAR);
689
 	}
689
 	}
690
-	printf("\n%s base %#hx", brd->name, eth_asic_base);
690
+	DBG ( "\n%s base %4.4x", brd->name, eth_asic_base );
691
 	if (eth_flags & FLAG_790) {
691
 	if (eth_flags & FLAG_790) {
692
 #ifdef	WD_790_PIO
692
 #ifdef	WD_790_PIO
693
-		printf(", PIO mode, addr %!\n", nic->node_addr);
693
+		DBG ( ", PIO mode, addr %s\n", eth_ntoa ( nic->node_addr ) );
694
 		eth_bmem = 0;
694
 		eth_bmem = 0;
695
 		eth_flags |= FLAG_PIO;		/* force PIO mode */
695
 		eth_flags |= FLAG_PIO;		/* force PIO mode */
696
 		outb(0, eth_asic_base+WD_MSR);
696
 		outb(0, eth_asic_base+WD_MSR);
697
 #else
697
 #else
698
-		printf(", memory %#x, addr %!\n", eth_bmem, nic->node_addr);
698
+		DBG ( ", Memory %x, MAC Addr %s\n", eth_bmem, eth_ntoa ( nic->node_addr) );
699
+
699
 		outb(WD_MSR_MENB, eth_asic_base+WD_MSR);
700
 		outb(WD_MSR_MENB, eth_asic_base+WD_MSR);
700
 		outb((inb(eth_asic_base+0x04) |
701
 		outb((inb(eth_asic_base+0x04) |
701
 			0x80), eth_asic_base+0x04);
702
 			0x80), eth_asic_base+0x04);
706
 			~0x80), eth_asic_base+0x04);
707
 			~0x80), eth_asic_base+0x04);
707
 #endif
708
 #endif
708
 	} else {
709
 	} else {
709
-		printf(", memory %#x, addr %!\n", eth_bmem, nic->node_addr);
710
+
711
+		DBG (", Memory %x, MAC Addr %s\n", eth_bmem, eth_ntoa ( nic->node_addr) );
712
+
710
 		outb(((unsigned)(eth_bmem >> 13) & 0x3F) | 0x40, eth_asic_base+WD_MSR);
713
 		outb(((unsigned)(eth_bmem >> 13) & 0x3F) | 0x40, eth_asic_base+WD_MSR);
711
 	}
714
 	}
712
 	if (eth_flags & FLAG_16BIT) {
715
 	if (eth_flags & FLAG_16BIT) {
818
 
821
 
819
                 outb(_3COM_CR_EALO | _3COM_CR_XSEL, eth_asic_base + _3COM_CR);
822
                 outb(_3COM_CR_EALO | _3COM_CR_XSEL, eth_asic_base + _3COM_CR);
820
 		nic->ioaddr = eth_nic_base;
823
 		nic->ioaddr = eth_nic_base;
821
-                printf("\n3Com 3c503 base %#hx, ", eth_nic_base);
824
+                DBG ( "\n3Com 3c503 base %4.4x, ", eth_nic_base );
822
                 if (eth_flags & FLAG_PIO)
825
                 if (eth_flags & FLAG_PIO)
823
-			printf("PIO mode");
826
+			DBG ( "PIO mode" );
824
                 else
827
                 else
825
-			printf("memory %#x", eth_bmem);
828
+			DBG ( "memory %4.4x", eth_bmem );
826
                 for (i=0; i<ETH_ALEN; i++) {
829
                 for (i=0; i<ETH_ALEN; i++) {
827
                         nic->node_addr[i] = inb(eth_nic_base+i);
830
                         nic->node_addr[i] = inb(eth_nic_base+i);
828
                 }
831
                 }
829
-                printf(", %s, addr %!\n", nic->flags ? "AUI" : "internal xcvr",
830
-			nic->node_addr);
832
+                DBG ( ", %s, MAC Addr %s\n", nic->flags ? "AUI" : "internal xcvr",
833
+		      eth_ntoa ( nic->node_addr ) );
834
+
831
                 outb(_3COM_CR_XSEL, eth_asic_base + _3COM_CR);
835
                 outb(_3COM_CR_XSEL, eth_asic_base + _3COM_CR);
832
         /*
836
         /*
833
          * Initialize GA configuration register. Set bank and enable shared
837
          * Initialize GA configuration register. Set bank and enable shared
923
 			nic->node_addr[i] = romdata[i + ((eth_flags & FLAG_16BIT) ? i : 0)];
927
 			nic->node_addr[i] = romdata[i + ((eth_flags & FLAG_16BIT) ? i : 0)];
924
 		}
928
 		}
925
 		nic->ioaddr = eth_nic_base;
929
 		nic->ioaddr = eth_nic_base;
926
-		printf("\nNE%c000 base %#hx, addr %!\n",
927
-			(eth_flags & FLAG_16BIT) ? '2' : '1', eth_nic_base,
928
-			nic->node_addr);
930
+		DBG ( "\nNE%c000 base %4.4x, MAC Addr %s\n",
931
+		      (eth_flags & FLAG_16BIT) ? '2' : '1', eth_nic_base,
932
+		      eth_ntoa ( nic->node_addr ) );
929
 	}
933
 	}
930
 }
934
 }
931
 #endif
935
 #endif

Loading…
Cancel
Save