Browse Source

Hack together far enough to support ne2k-pci.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
31fe5b9415
1 changed files with 13 additions and 13 deletions
  1. 13
    13
      src/drivers/net/ns8390.c

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

26
 **************************************************************************/
26
 **************************************************************************/
27
 
27
 
28
 #warning "ns8390.c is a horrendous mess and needs to be tidied up"
28
 #warning "ns8390.c is a horrendous mess and needs to be tidied up"
29
-#if 0
29
+#if 1
30
 
30
 
31
 
31
 
32
 #include "etherboot.h"
32
 #include "etherboot.h"
607
   }
607
   }
608
 }
608
 }
609
 
609
 
610
+static struct nic_operations ns8390_operations;
611
+static struct nic_operations ns8390_operations = {
612
+	.connect	= dummy_connect,
613
+	.poll		= ns8390_poll,
614
+	.transmit	= ns8390_transmit,
615
+	.irq		= ns8390_irq,
616
+};
617
+
610
 /**************************************************************************
618
 /**************************************************************************
611
 ETH_PROBE - Look for an adapter
619
 ETH_PROBE - Look for an adapter
612
 **************************************************************************/
620
 **************************************************************************/
613
 #ifdef	INCLUDE_NS8390
621
 #ifdef	INCLUDE_NS8390
614
-static int eth_probe (struct dev *dev, struct pci_device *pci)
622
+static int eth_probe (struct nic *nic, struct pci_device *pci)
615
 #else
623
 #else
616
 static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
624
 static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
617
 #endif
625
 #endif
618
 {
626
 {
619
-	struct nic *nic = (struct nic *)dev;
620
 	int i;
627
 	int i;
621
 #ifdef INCLUDE_NS8390
628
 #ifdef INCLUDE_NS8390
622
 	unsigned short pci_probe_addrs[] = { pci->ioaddr, 0 };
629
 	unsigned short pci_probe_addrs[] = { pci->ioaddr, 0 };
938
         if (eth_vendor != VENDOR_3COM)
945
         if (eth_vendor != VENDOR_3COM)
939
 		eth_rmem = eth_bmem;
946
 		eth_rmem = eth_bmem;
940
 	ns8390_reset(nic);
947
 	ns8390_reset(nic);
941
-static struct nic_operations ns8390_operations;
942
-static struct nic_operations ns8390_operations = {
943
-	.connect	= dummy_connect,
944
-	.poll		= ns8390_poll,
945
-	.transmit	= ns8390_transmit,
946
-	.irq		= ns8390_irq,
947
-	.disable	= ns8390_disable,
948
-};
949
 	nic->nic_op	= &ns8390_operations;
948
 	nic->nic_op	= &ns8390_operations;
950
 
949
 
951
         /* Based on PnP ISA map */
950
         /* Based on PnP ISA map */
1010
 PCI_ROM(0x1106, 0x0926, "via86c926",    "Via 86c926"),
1009
 PCI_ROM(0x1106, 0x0926, "via86c926",    "Via 86c926"),
1011
 };
1010
 };
1012
 
1011
 
1013
-PCI_DRIVER ( nepci_driver, "NE2000/PCI", nepci_nics, PCI_NO_CLASS );
1012
+PCI_DRIVER ( nepci_driver, nepci_nics, PCI_NO_CLASS );
1014
 
1013
 
1015
-BOOT_DRIVER ( "NE2000/PCI", nepci_probe );
1014
+DRIVER ( "NE2000/PCI", nic_driver, pci_driver, nepci_driver,
1015
+	 nepci_probe, ns8390_disable );
1016
 
1016
 
1017
 #endif /* INCLUDE_NS8390 */
1017
 #endif /* INCLUDE_NS8390 */
1018
 
1018
 

Loading…
Cancel
Save