From: Joshua Wise Date: Thu, 2 Oct 2008 23:52:36 +0000 (-0400) Subject: Actually invoke the 3c90x driver load routine. X-Git-Url: http://git.joshuawise.com/netwatch.git/commitdiff_plain/7a914840b833dba82398623bbde04a1744627398?ds=sidebyside;hp=--cc Actually invoke the 3c90x driver load routine. --- 7a914840b833dba82398623bbde04a1744627398 diff --git a/net/3c90x.c b/net/3c90x.c index 711b69d..f678aaf 100644 --- a/net/3c90x.c +++ b/net/3c90x.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -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; diff --git a/net/net.c b/net/net.c index 18eaddf..575b5e4 100644 --- a/net/net.c +++ b/net/net.c @@ -3,26 +3,26 @@ #include #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!"); } diff --git a/net/net.h b/net/net.h index 01505ab..c665216 100644 --- 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