浏览代码

eth_ntoa and warnings fixups, memcpy compilation fix

tags/v0.9.3
Marty Connor 19 年前
父节点
当前提交
cce8755fb8
共有 1 个文件被更改,包括 17 次插入9 次删除
  1. 17
    9
      src/drivers/net/pcnet32.c

+ 17
- 9
src/drivers/net/pcnet32.c 查看文件

39
 *    Indent Options: indent -kr -i8
39
 *    Indent Options: indent -kr -i8
40
 ***************************************************************************/
40
 ***************************************************************************/
41
 
41
 
42
-/* to get some global routines like printf */
43
 #include "etherboot.h"
42
 #include "etherboot.h"
44
-/* to get the interface to the body of the program */
45
 #include "nic.h"
43
 #include "nic.h"
46
-/* to get the PCI support functions, if this is a PCI NIC */
47
 #include <gpxe/pci.h>
44
 #include <gpxe/pci.h>
48
-/* Include the time functions */
45
+#include <gpxe/ethernet.h>
49
 #include "timer.h"
46
 #include "timer.h"
50
 #include "mii.h"
47
 #include "mii.h"
48
+
51
 /* void hex_dump(const char *data, const unsigned int len); */
49
 /* void hex_dump(const char *data, const unsigned int len); */
52
 
50
 
53
 /* Etherboot Specific definations */
51
 /* Etherboot Specific definations */
659
   }
657
   }
660
 }
658
 }
661
 
659
 
660
+
662
 /**************************************************************************
661
 /**************************************************************************
663
 PROBE - Look for an adapter, this routine's visible to the outside
662
 PROBE - Look for an adapter, this routine's visible to the outside
664
 You should omit the last argument struct pci_device * for a non-PCI NIC
663
 You should omit the last argument struct pci_device * for a non-PCI NIC
668
 	int i, media;
667
 	int i, media;
669
 	int fdx, mii, fset, dxsuflo, ltint;
668
 	int fdx, mii, fset, dxsuflo, ltint;
670
 	int chip_version;
669
 	int chip_version;
671
-	char *chipname;
672
 	struct pcnet32_access *a = NULL;
670
 	struct pcnet32_access *a = NULL;
671
+	char *chipname;
673
 	u8 promaddr[6];
672
 	u8 promaddr[6];
674
 	int shared = 1;
673
 	int shared = 1;
675
 
674
 
788
 		ltint = 1;
787
 		ltint = 1;
789
 	}
788
 	}
790
 
789
 
791
-	dprintf(("%s at %hX,", chipname, ioaddr));
790
+	DBG ( "%s at %hX,", chipname, ioaddr );
792
 
791
 
793
 	/* read PROM address */
792
 	/* read PROM address */
794
 	for (i = 0; i < 6; i++)
793
 	for (i = 0; i < 6; i++)
798
 	for (i = 0; i < ETH_ALEN; i++) {
797
 	for (i = 0; i < ETH_ALEN; i++) {
799
 		nic->node_addr[i] = promaddr[i];
798
 		nic->node_addr[i] = promaddr[i];
800
 	}
799
 	}
800
+
801
 	/* Print out some hardware info */
801
 	/* Print out some hardware info */
802
-	printf("%s: %! at ioaddr 0x%hX, ", chipname, nic->node_addr,
803
-	       ioaddr);
802
+	DBG ( "%s: IO Addr 0x%hX, MAC Addr %s\n ", chipname, ioaddr,
803
+	      eth_ntoa ( nic->node_addr ) );
804
 
804
 
805
 	/* Set to pci bus master */
805
 	/* Set to pci bus master */
806
 	adjust_pci_device(pci);
806
 	adjust_pci_device(pci);
866
 		printf("No access methods\n");
866
 		printf("No access methods\n");
867
 		return 0;
867
 		return 0;
868
 	}
868
 	}
869
-	lp->a = *a;
869
+
870
+	//  lp->a = *a;
871
+	//  Causes a loader:
872
+	//     bin/blib.a(pcnet32.o)(.text+0x6b6): In function `pcnet32_probe':
873
+	//     drivers/net/pcnet32.c:871: undefined reference to `memcpy'
874
+	//     make: *** [bin/pcnet32.dsk.tmp] Error 1
875
+	//  So we do:
876
+	memcpy ( &lp->a, a, sizeof ( a ) );
877
+	//   To explicity call memcpy.
870
 
878
 
871
 	/* detect special T1/E1 WAN card by checking for MAC address */
879
 	/* detect special T1/E1 WAN card by checking for MAC address */
872
 	if (nic->node_addr[0] == 0x00 && nic->node_addr[1] == 0xe0
880
 	if (nic->node_addr[0] == 0x00 && nic->node_addr[1] == 0xe0

正在加载...
取消
保存