X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/7a914840b833dba82398623bbde04a1744627398..c25f3f39d2a544a91a8a96ea90bda1dc1d77b76a:/net/net.c diff --git a/net/net.c b/net/net.c index 575b5e4..01b4521 100644 --- a/net/net.c +++ b/net/net.c @@ -7,10 +7,33 @@ static struct nic *_nic = 0x0; extern struct pci_driver a3c90x_driver; +static char test[1024] = {0}; + void eth_poll() { - if (_nic) - _nic->poll(_nic, 0); + int i; + static int c; + + if (!_nic) + return; + + _nic->poll(_nic, 0); + + if ((c++) % 30) + return; + + for (i = 0; i < 1024; i++) + { + 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; + } + } + _nic->transmit("\x00\x03\x93\x87\x84\x8C", 0x1337, 1024, test); } int eth_register(struct nic *nic) @@ -23,6 +46,7 @@ int eth_register(struct nic *nic) void eth_init() { - if (pci_probe_driver(a3c90x_driver)) - outputf("found 3c90x, hopefully!"); + /* Required for DMA to work. :( */ + smram_tseg_set_state(SMRAM_TSEG_OPEN); + pci_probe_driver(a3c90x_driver); }