Lines Matching refs:dev

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