]>
Commit | Line | Data |
---|---|---|
3b3161a1 | 1 | #include <pci.h> |
4d898e0b | 2 | #include <pci-bother.h> |
3b3161a1 | 3 | #include <output.h> |
4d898e0b | 4 | #include "net.h" |
3b3161a1 | 5 | |
7a914840 | 6 | static struct nic *_nic = 0x0; |
3e6d6106 | 7 | |
7a914840 JW |
8 | extern struct pci_driver a3c90x_driver; |
9 | ||
99182958 JW |
10 | static char test[1024] = {0}; |
11 | ||
7a914840 | 12 | void eth_poll() |
3b3161a1 | 13 | { |
99182958 JW |
14 | int i; |
15 | static int c; | |
16 | ||
17 | if (!_nic) | |
18 | return; | |
19 | ||
20 | _nic->poll(_nic, 0); | |
21 | ||
31ddf9b3 | 22 | if ((c++) % 30) |
99182958 JW |
23 | return; |
24 | ||
25 | for (i = 0; i < 1024; i++) | |
26 | { | |
27 | switch(i%5) | |
28 | { | |
29 | case 0: test[i] = 'H'; break; | |
30 | case 1: test[i] = 'A'; break; | |
31 | case 2: test[i] = 'R'; break; | |
32 | case 3: test[i] = 'B'; break; | |
33 | case 4: test[i] = 'L'; break; | |
34 | } | |
35 | } | |
36 | outputf("eth_poll: Attempting to tx"); | |
37 | _nic->transmit("\x00\x03\x93\x87\x84\x8C", 0x1337, 1024, test); | |
38 | outputf("eth_poll: tx complete"); | |
3b3161a1 JW |
39 | } |
40 | ||
7a914840 | 41 | int eth_register(struct nic *nic) |
3b3161a1 | 42 | { |
7a914840 JW |
43 | if (_nic) |
44 | return -1; | |
45 | _nic = nic; | |
46 | return 0; | |
3b3161a1 JW |
47 | } |
48 | ||
49 | void eth_init() | |
50 | { | |
7a914840 JW |
51 | if (pci_probe_driver(a3c90x_driver)) |
52 | outputf("found 3c90x, hopefully!"); | |
3b3161a1 | 53 | } |