]>
Commit | Line | Data |
---|---|---|
3b3161a1 JW |
1 | #include <pci.h> |
2 | #include <output.h> | |
3e6d6106 | 3 | #include "net.h" |
3b3161a1 JW |
4 | |
5 | static int found = 0, _bus, _dev, _fn; | |
6 | ||
3e6d6106 JP |
7 | struct nic nic; |
8 | ||
e9d467b3 | 9 | static int bother_3c905(pci_dev_t *dev, void *nutrinus) |
3b3161a1 JW |
10 | { |
11 | if (dev->vid == 0x10B7 || dev->did == 0x9200) | |
12 | { | |
13 | outputf("Found a 3c905 to bother"); | |
14 | ||
15 | _bus = dev->bus; | |
16 | _dev = dev->dev; | |
17 | _fn = dev->fn; | |
18 | found = 1; | |
19 | ||
20 | return 1; | |
21 | } | |
22 | return 0; | |
23 | } | |
24 | ||
25 | void eth_poll() | |
26 | { | |
27 | if (!found) | |
28 | return; | |
29 | ||
30 | pci_write16(_bus, _dev, _fn, 0x04, 0xFF); | |
31 | ||
32 | pci_write16(_bus, _dev, _fn, 0x04, 0x00); | |
33 | } | |
34 | ||
35 | void eth_init() | |
36 | { | |
e9d467b3 | 37 | pci_probe(bother_3c905, 0x0); |
3b3161a1 | 38 | } |