]> Joshua Wise's Git repositories - netwatch.git/blobdiff - net/net.c
Add the mechanism by which we bother PCI, generically.
[netwatch.git] / net / net.c
index b89abe2d2b0f56206aa4446121de9099a28d8a0c..488f52b1f1be5c072559a69376d5c1348c94cee7 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1,8 +1,7 @@
 #include <pci.h>
+#include <pci-bother.h>
 #include <output.h>
-#include "3c905.h"
-
-static int found = 0, _bus, _dev, _fn;
+#include "net.h"
 
 static int bother_3c905(pci_dev_t *dev, void *nutrinus)
 {
@@ -10,11 +9,7 @@ static int bother_3c905(pci_dev_t *dev, void *nutrinus)
        {
                outputf("Found a 3c905 to bother");
                
-               _bus = dev->bus;
-               _dev = dev->dev;
-               _fn = dev->fn;
-               found = 1;
-               
+               pci_bother_add(dev);
                return 1;
        }
        return 0;
@@ -22,12 +17,7 @@ static int bother_3c905(pci_dev_t *dev, void *nutrinus)
 
 void eth_poll()
 {
-       if (!found)
-               return;
-               
-       pci_write16(_bus, _dev, _fn, 0x04, 0xFF);
-       
-       pci_write16(_bus, _dev, _fn, 0x04, 0x00);
+       /* ... */
 }
 
 void eth_init()
This page took 0.021593 seconds and 4 git commands to generate.