Lines Matching refs:dev

14 static int pci_probe(struct dev *dev, const char *type_name)
26 struct pci_probe_state *state = &dev->state.pci;
28 if (dev->how_probe == PROBE_FIRST) {
30 state->dev.driver = 0;
31 state->dev.bus = 0;
32 state->dev.devfn = 0;
33 dev->index = -1;
36 if ((dev->how_probe != PROBE_AWAKE) && state->advance) {
37 find_pci(dev->type, &state->dev);
38 dev->index = -1;
42 if (state->dev.driver == 0)
47 if (state->dev.romaddr != ((unsigned long) rom.rom_segment << 4)) {
51 if (dev->how_probe != PROBE_AWAKE) {
52 dev->type_index++;
54 dev->devid.bus_type = PCI_BUS_TYPE;
55 dev->devid.vendor_id = htons(state->dev.vendor);
56 dev->devid.device_id = htons(state->dev.dev_id);
57 /* FIXME how do I handle dev->index + PROBE_AGAIN?? */
59 printf("[%s]", state->dev.name);
60 if (state->dev.driver->probe(dev, &state->dev)) {
61 state->advance = (dev->index == -1);
71 static int isa_probe(struct dev *dev, const char *type_name)
78 struct isa_probe_state *state = &dev->state.isa;
80 if (dev->how_probe == PROBE_FIRST) {
83 dev->index = -1;
87 if ((dev->how_probe != PROBE_AWAKE) && state->advance) {
89 dev->index = -1;
96 if (state->driver->type != dev->type)
99 if (dev->how_probe != PROBE_AWAKE) {
100 dev->type_index++;
103 dev->devid.bus_type = ISA_BUS_TYPE;
104 /* FIXME how do I handle dev->index + PROBE_AGAIN?? */
106 if (state->driver->probe(dev, state->driver->ioaddrs)) {
107 state->advance = (dev->index == -1);
122 int probe(struct dev *dev)
129 if ((dev->type >= 0) &&
130 (dev->type < sizeof(driver_name)/sizeof(driver_name[0]))) {
131 type_name = driver_name[dev->type];
133 if (dev->how_probe == PROBE_FIRST) {
134 dev->to_probe = PROBE_PCI;
135 memset(&dev->state, 0, sizeof(dev->state));
137 if (dev->to_probe == PROBE_PCI) {
138 dev->how_probe = pci_probe(dev, type_name);
139 if (dev->how_probe == PROBE_FAILED) {
140 dev->to_probe = PROBE_ISA;
143 if (dev->to_probe == PROBE_ISA) {
144 dev->how_probe = isa_probe(dev, type_name);
145 if (dev->how_probe == PROBE_FAILED) {
146 dev->to_probe = PROBE_NONE;
149 if ((dev->to_probe != PROBE_PCI) &&
150 (dev->to_probe != PROBE_ISA)) {
151 dev->how_probe = PROBE_FAILED;
156 return dev->how_probe;
159 void disable(struct dev *dev)
161 if (dev->disable) {
162 dev->disable(dev);
163 dev->disable = 0;