]> Joshua Wise's Git repositories - netwatch.git/blobdiff - net/net.c
Fix 'i r retard' bug in timer
[netwatch.git] / net / net.c
index 488f52b1f1be5c072559a69376d5c1348c94cee7..13c16f24d97fd831b981c536df0d14dc52c784e7 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -3,24 +3,51 @@
 #include <output.h>
 #include "net.h"
 
-static int bother_3c905(pci_dev_t *dev, void *nutrinus)
+static struct nic *_nic = 0x0;
+
+extern struct pci_driver a3c90x_driver;
+
+static char test[1024] = {0};
+
+void eth_poll()
 {
-       if (dev->vid == 0x10B7 || dev->did == 0x9200)
+       int i;
+       static int c;
+       
+       if (!_nic)
+               return;
+
+       _nic->poll(_nic, 0);
+       
+       if ((c++) % 60)
+               return;
+       
+       for (i = 0; i < 1024; i++)
        {
-               outputf("Found a 3c905 to bother");
-               
-               pci_bother_add(dev);
-               return 1;
+               switch(i%5)
+               {
+               case 0: test[i] = 'H'; break;
+               case 1: test[i] = 'A'; break;
+               case 2: test[i] = 'R'; break;
+               case 3: test[i] = 'B'; break;
+               case 4: test[i] = 'L'; break;
+               }
        }
-       return 0;
+       outputf("eth_poll: Attempting to tx");
+       _nic->transmit("\x00\x03\x93\x87\x84\x8C", 0x1337, 1024, test);
+       outputf("eth_poll: tx complete");
 }
 
-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!");
 }
This page took 0.027479 seconds and 4 git commands to generate.