Quellcode durchsuchen

eth_ntoa and warnings fixups, memcpy compilation fix

tags/v0.9.3
Marty Connor vor 18 Jahren
Ursprung
Commit
cce8755fb8
1 geänderte Dateien mit 17 neuen und 9 gelöschten Zeilen
  1. 17
    9
      src/drivers/net/pcnet32.c

+ 17
- 9
src/drivers/net/pcnet32.c Datei anzeigen

@@ -39,15 +39,13 @@
39 39
 *    Indent Options: indent -kr -i8
40 40
 ***************************************************************************/
41 41
 
42
-/* to get some global routines like printf */
43 42
 #include "etherboot.h"
44
-/* to get the interface to the body of the program */
45 43
 #include "nic.h"
46
-/* to get the PCI support functions, if this is a PCI NIC */
47 44
 #include <gpxe/pci.h>
48
-/* Include the time functions */
45
+#include <gpxe/ethernet.h>
49 46
 #include "timer.h"
50 47
 #include "mii.h"
48
+
51 49
 /* void hex_dump(const char *data, const unsigned int len); */
52 50
 
53 51
 /* Etherboot Specific definations */
@@ -659,6 +657,7 @@ static void pcnet32_irq(struct nic *nic __unused, irq_action_t action __unused)
659 657
   }
660 658
 }
661 659
 
660
+
662 661
 /**************************************************************************
663 662
 PROBE - Look for an adapter, this routine's visible to the outside
664 663
 You should omit the last argument struct pci_device * for a non-PCI NIC
@@ -668,8 +667,8 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
668 667
 	int i, media;
669 668
 	int fdx, mii, fset, dxsuflo, ltint;
670 669
 	int chip_version;
671
-	char *chipname;
672 670
 	struct pcnet32_access *a = NULL;
671
+	char *chipname;
673 672
 	u8 promaddr[6];
674 673
 	int shared = 1;
675 674
 
@@ -788,7 +787,7 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
788 787
 		ltint = 1;
789 788
 	}
790 789
 
791
-	dprintf(("%s at %hX,", chipname, ioaddr));
790
+	DBG ( "%s at %hX,", chipname, ioaddr );
792 791
 
793 792
 	/* read PROM address */
794 793
 	for (i = 0; i < 6; i++)
@@ -798,9 +797,10 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
798 797
 	for (i = 0; i < ETH_ALEN; i++) {
799 798
 		nic->node_addr[i] = promaddr[i];
800 799
 	}
800
+
801 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 805
 	/* Set to pci bus master */
806 806
 	adjust_pci_device(pci);
@@ -866,7 +866,15 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
866 866
 		printf("No access methods\n");
867 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 879
 	/* detect special T1/E1 WAN card by checking for MAC address */
872 880
 	if (nic->node_addr[0] == 0x00 && nic->node_addr[1] == 0xe0

Laden…
Abbrechen
Speichern