Lines Matching refs:ahd
80 struct ahd_softc *ahd = dev_get_drvdata(dev); in ahd_linux_pci_dev_suspend() local
83 if ((rc = ahd_suspend(ahd))) in ahd_linux_pci_dev_suspend()
86 ahd_pci_suspend(ahd); in ahd_linux_pci_dev_suspend()
94 struct ahd_softc *ahd = dev_get_drvdata(dev); in ahd_linux_pci_dev_resume() local
96 ahd_pci_resume(ahd); in ahd_linux_pci_dev_resume()
98 ahd_resume(ahd); in ahd_linux_pci_dev_resume()
106 struct ahd_softc *ahd = pci_get_drvdata(pdev); in ahd_linux_pci_dev_remove() local
109 if (ahd->platform_data && ahd->platform_data->host) in ahd_linux_pci_dev_remove()
110 scsi_remove_host(ahd->platform_data->host); in ahd_linux_pci_dev_remove()
112 ahd_lock(ahd, &s); in ahd_linux_pci_dev_remove()
113 ahd_intr_enable(ahd, FALSE); in ahd_linux_pci_dev_remove()
114 ahd_unlock(ahd, &s); in ahd_linux_pci_dev_remove()
115 ahd_free(ahd); in ahd_linux_pci_dev_remove()
119 ahd_linux_pci_inherit_flags(struct ahd_softc *ahd) in ahd_linux_pci_inherit_flags() argument
121 struct pci_dev *pdev = ahd->dev_softc, *master_pdev; in ahd_linux_pci_inherit_flags()
128 ahd->flags &= ~AHD_BIOS_ENABLED; in ahd_linux_pci_inherit_flags()
129 ahd->flags |= master->flags & AHD_BIOS_ENABLED; in ahd_linux_pci_inherit_flags()
140 struct ahd_softc *ahd; in ahd_linux_pci_dev_probe() local
164 ahd = ahd_alloc(NULL, name); in ahd_linux_pci_dev_probe()
165 if (ahd == NULL) in ahd_linux_pci_dev_probe()
168 ahd_free(ahd); in ahd_linux_pci_dev_probe()
178 ahd->flags |= AHD_64BIT_ADDRESSING; in ahd_linux_pci_dev_probe()
181 ahd->flags |= AHD_39BIT_ADDRESSING; in ahd_linux_pci_dev_probe()
187 ahd->dev_softc = pci; in ahd_linux_pci_dev_probe()
188 error = ahd_pci_config(ahd, entry); in ahd_linux_pci_dev_probe()
190 ahd_free(ahd); in ahd_linux_pci_dev_probe()
198 if ((ahd->features & AHD_MULTI_FUNC) && PCI_FUNC(pdev->devfn) != 0) in ahd_linux_pci_dev_probe()
199 ahd_linux_pci_inherit_flags(ahd); in ahd_linux_pci_dev_probe()
201 pci_set_drvdata(pdev, ahd); in ahd_linux_pci_dev_probe()
203 ahd_linux_register_host(ahd, &aic79xx_driver_template); in ahd_linux_pci_dev_probe()
232 ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, resource_size_t *base, in ahd_linux_pci_reserve_io_regions() argument
235 *base = pci_resource_start(ahd->dev_softc, 0); in ahd_linux_pci_reserve_io_regions()
241 *base2 = pci_resource_start(ahd->dev_softc, 3); in ahd_linux_pci_reserve_io_regions()
254 ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd, in ahd_linux_pci_reserve_mem_region() argument
266 if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) != 0) in ahd_linux_pci_reserve_mem_region()
269 start = pci_resource_start(ahd->dev_softc, 1); in ahd_linux_pci_reserve_mem_region()
290 ahd_pci_map_registers(struct ahd_softc *ahd) in ahd_pci_map_registers() argument
300 command = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, 4); in ahd_pci_map_registers()
304 error = ahd_linux_pci_reserve_mem_region(ahd, &base, &maddr); in ahd_pci_map_registers()
306 ahd->platform_data->mem_busaddr = base; in ahd_pci_map_registers()
307 ahd->tags[0] = BUS_SPACE_MEMIO; in ahd_pci_map_registers()
308 ahd->bshs[0].maddr = maddr; in ahd_pci_map_registers()
309 ahd->tags[1] = BUS_SPACE_MEMIO; in ahd_pci_map_registers()
310 ahd->bshs[1].maddr = maddr + 0x100; in ahd_pci_map_registers()
311 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, in ahd_pci_map_registers()
314 if (ahd_pci_test_register_access(ahd) != 0) { in ahd_pci_map_registers()
318 ahd_get_pci_bus(ahd->dev_softc), in ahd_pci_map_registers()
319 ahd_get_pci_slot(ahd->dev_softc), in ahd_pci_map_registers()
320 ahd_get_pci_function(ahd->dev_softc)); in ahd_pci_map_registers()
322 release_mem_region(ahd->platform_data->mem_busaddr, in ahd_pci_map_registers()
324 ahd->bshs[0].maddr = NULL; in ahd_pci_map_registers()
331 ahd_get_pci_bus(ahd->dev_softc), in ahd_pci_map_registers()
332 ahd_get_pci_slot(ahd->dev_softc), in ahd_pci_map_registers()
333 ahd_get_pci_function(ahd->dev_softc), in ahd_pci_map_registers()
340 error = ahd_linux_pci_reserve_io_regions(ahd, &base, &base2); in ahd_pci_map_registers()
342 ahd->tags[0] = BUS_SPACE_PIO; in ahd_pci_map_registers()
343 ahd->tags[1] = BUS_SPACE_PIO; in ahd_pci_map_registers()
344 ahd->bshs[0].ioport = (u_long)base; in ahd_pci_map_registers()
345 ahd->bshs[1].ioport = (u_long)base2; in ahd_pci_map_registers()
350 ahd_get_pci_bus(ahd->dev_softc), in ahd_pci_map_registers()
351 ahd_get_pci_slot(ahd->dev_softc), in ahd_pci_map_registers()
352 ahd_get_pci_function(ahd->dev_softc), in ahd_pci_map_registers()
357 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, command, 4); in ahd_pci_map_registers()
362 ahd_pci_map_int(struct ahd_softc *ahd) in ahd_pci_map_int() argument
366 error = request_irq(ahd->dev_softc->irq, ahd_linux_isr, in ahd_pci_map_int()
367 IRQF_SHARED, "aic79xx", ahd); in ahd_pci_map_int()
369 ahd->platform_data->irq = ahd->dev_softc->irq; in ahd_pci_map_int()
375 ahd_power_state_change(struct ahd_softc *ahd, ahd_power_state new_state) in ahd_power_state_change() argument
377 pci_set_power_state(ahd->dev_softc, new_state); in ahd_power_state_change()