-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdriver.c
More file actions
34 lines (29 loc) · 692 Bytes
/
Copy pathdriver.c
File metadata and controls
34 lines (29 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "console.h"
#include "pci.h"
#include "driver.h"
#include "ne2000.h"
struct driver *drivers[] = {
&ne2000_driver,
NULL,
};
int driver_init()
{
int i, j;
struct pci_dev *pci_device;
struct driver *driver;
for (i = 0; i < pci_devs.idx; i++) {
pci_device = &pci_devs.devs[i];
for (j = 0; drivers[j]; j++) {
driver = drivers[j];
if (!driver->inited && driver->init) {
if (driver->init(driver) < 0) {
continue;
}
}
if (driver->probe(pci_device) == 0) {
driver->attach(pci_device);
}
}
}
return 0;
}