Lines Matching defs:ahd
48 "ahd",
53 DRIVER_MODULE(ahd, pci, ahd_pci_driver, 0, 0);
54 MODULE_DEPEND(ahd_pci, ahd, 1, 1, 1);
74 struct ahd_softc *ahd;
91 ahd = ahd_alloc(dev, name);
92 if (ahd == NULL)
95 ahd_set_unit(ahd, device_get_unit(dev));
102 ahd->flags |= AHD_39BIT_ADDRESSING;
105 error = aic_dma_tag_create(ahd, /*parent*/bus_get_dma_tag(dev),
107 (ahd->flags & AHD_39BIT_ADDRESSING)
116 &ahd->parent_dmat);
121 ahd_free(ahd);
124 ahd->dev_softc = dev;
125 error = ahd_pci_config(ahd, entry);
127 ahd_free(ahd);
131 ahd_sysctl(ahd);
132 ahd_attach(ahd);
137 ahd_pci_map_registers(struct ahd_softc *ahd)
152 if (resource_int_value(device_get_name(ahd->dev_softc),
153 device_get_unit(ahd->dev_softc),
156 device_printf(ahd->dev_softc,
161 if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) == 0
165 regs = bus_alloc_resource_any(ahd->dev_softc, regs_type,
170 ahd->tags[0] = rman_get_bustag(regs);
171 ahd->bshs[0] = rman_get_bushandle(regs);
172 ahd->tags[1] = ahd->tags[0];
173 error = bus_space_subregion(ahd->tags[0], ahd->bshs[0],
176 &ahd->bshs[1]);
182 || ahd_pci_test_register_access(ahd) != 0) {
183 device_printf(ahd->dev_softc,
186 aic_get_pci_bus(ahd->dev_softc),
187 aic_get_pci_slot(ahd->dev_softc),
188 aic_get_pci_function(ahd->dev_softc));
189 bus_release_resource(ahd->dev_softc, regs_type,
192 AHD_CORRECTABLE_ERROR(ahd);
199 regs = bus_alloc_resource_any(ahd->dev_softc, regs_type,
202 device_printf(ahd->dev_softc,
204 AHD_UNCORRECTABLE_ERROR(ahd);
207 ahd->tags[0] = rman_get_bustag(regs);
208 ahd->bshs[0] = rman_get_bushandle(regs);
212 regs2 = bus_alloc_resource_any(ahd->dev_softc, regs_type,
215 device_printf(ahd->dev_softc,
217 AHD_UNCORRECTABLE_ERROR(ahd);
220 ahd->tags[1] = rman_get_bustag(regs2);
221 ahd->bshs[1] = rman_get_bushandle(regs2);
222 ahd->platform_data->regs_res_type[1] = regs_type;
223 ahd->platform_data->regs_res_id[1] = regs_id2;
224 ahd->platform_data->regs[1] = regs2;
226 ahd->platform_data->regs_res_type[0] = regs_type;
227 ahd->platform_data->regs_res_id[0] = regs_id;
228 ahd->platform_data->regs[0] = regs;
233 ahd_pci_map_int(struct ahd_softc *ahd)
238 ahd->platform_data->irq =
239 bus_alloc_resource_any(ahd->dev_softc, SYS_RES_IRQ, &zero,
241 if (ahd->platform_data->irq == NULL)
243 ahd->platform_data->irq_res_type = SYS_RES_IRQ;
244 return (ahd_map_int(ahd));