]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Actually invoke the 3c90x driver load routine.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 2 Oct 2008 23:52:36 +0000 (19:52 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 2 Oct 2008 23:52:36 +0000 (19:52 -0400)
net/3c90x.c
net/net.c
net/net.h

index 711b69de7f6308466c4581f7786740037c472405..f678aaf21a377f6d8e6a4a580ec5ba9c6c299295 100644 (file)
@@ -42,6 +42,7 @@
 #include <timer.h>
 #include <io.h>
 #include <pci.h>
+#include <pci-bother.h>
 #include <minilib.h>
 #include <output.h>
 
@@ -251,6 +252,7 @@ static struct
     RXD                        ReceiveUPD;
     }
     INF_3C90X;
+static struct nic nic;
 
 
 /*** a3c90x_internal_IssueCommand: sends a command to the 3c90x card
@@ -713,6 +715,7 @@ static int a3c90x_probe(struct pci_dev * pci, void * data)
 /*
     adjust_pci_dev(pci);
 */
+    pci_bother_add(pci);
     nic.ioaddr = ioaddr & ~3;
     nic.irqno = 0;
 
index 18eaddf2dc625729b5af87d7d9ee55c339d93cb9..575b5e446f827209fdb9662a403382d2cdade348 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -3,26 +3,26 @@
 #include <output.h>
 #include "net.h"
 
-struct nic nic;
+static struct nic *_nic = 0x0;
 
-static int bother_3c905(pci_dev_t *dev, void *nutrinus)
+extern struct pci_driver a3c90x_driver;
+
+void eth_poll()
 {
-       if (dev->vid == 0x10B7 || dev->did == 0x9200)
-       {
-               outputf("Found a 3c905 to bother");
-               
-               pci_bother_add(dev);
-               return 1;
-       }
-       return 0;
+       if (_nic)
+               _nic->poll(_nic, 0);
 }
 
-void eth_poll()
+int eth_register(struct nic *nic)
 {
-       /* ... */
+       if (_nic)
+               return -1;
+       _nic = nic;
+       return 0;
 }
 
 void eth_init()
 {
-       pci_probe(bother_3c905, 0x0);
+       if (pci_probe_driver(a3c90x_driver))
+               outputf("found 3c90x, hopefully!");
 }
index 01505abe227e7b5b003750db44d42650e0f09406..c665216622e4047ae7e2c5e32b54316e4c1f4f28 100644 (file)
--- a/net/net.h
+++ b/net/net.h
@@ -5,7 +5,6 @@
 
 extern void eth_init();
 extern void eth_poll();
-
-extern struct nic nic;
+extern int eth_register(struct nic *nic);
 
 #endif
This page took 0.03238 seconds and 4 git commands to generate.