Lines Matching refs:ahd

81 	struct ahd_softc *ahd = pci_get_drvdata(pdev);  in ahd_linux_pci_dev_suspend()  local
84 if ((rc = ahd_suspend(ahd))) in ahd_linux_pci_dev_suspend()
87 ahd_pci_suspend(ahd); in ahd_linux_pci_dev_suspend()
101 struct ahd_softc *ahd = pci_get_drvdata(pdev); in ahd_linux_pci_dev_resume() local
115 ahd_pci_resume(ahd); in ahd_linux_pci_dev_resume()
117 ahd_resume(ahd); in ahd_linux_pci_dev_resume()
126 struct ahd_softc *ahd = pci_get_drvdata(pdev); in ahd_linux_pci_dev_remove() local
129 if (ahd->platform_data && ahd->platform_data->host) in ahd_linux_pci_dev_remove()
130 scsi_remove_host(ahd->platform_data->host); in ahd_linux_pci_dev_remove()
132 ahd_lock(ahd, &s); in ahd_linux_pci_dev_remove()
133 ahd_intr_enable(ahd, FALSE); in ahd_linux_pci_dev_remove()
134 ahd_unlock(ahd, &s); in ahd_linux_pci_dev_remove()
135 ahd_free(ahd); in ahd_linux_pci_dev_remove()
139 ahd_linux_pci_inherit_flags(struct ahd_softc *ahd) in ahd_linux_pci_inherit_flags() argument
141 struct pci_dev *pdev = ahd->dev_softc, *master_pdev; in ahd_linux_pci_inherit_flags()
148 ahd->flags &= ~AHD_BIOS_ENABLED; in ahd_linux_pci_inherit_flags()
149 ahd->flags |= master->flags & AHD_BIOS_ENABLED; in ahd_linux_pci_inherit_flags()
160 struct ahd_softc *ahd; in ahd_linux_pci_dev_probe() local
184 ahd = ahd_alloc(NULL, name); in ahd_linux_pci_dev_probe()
185 if (ahd == NULL) in ahd_linux_pci_dev_probe()
188 ahd_free(ahd); in ahd_linux_pci_dev_probe()
198 ahd->flags |= AHD_64BIT_ADDRESSING; in ahd_linux_pci_dev_probe()
201 ahd->flags |= AHD_39BIT_ADDRESSING; in ahd_linux_pci_dev_probe()
207 ahd->dev_softc = pci; in ahd_linux_pci_dev_probe()
208 error = ahd_pci_config(ahd, entry); in ahd_linux_pci_dev_probe()
210 ahd_free(ahd); in ahd_linux_pci_dev_probe()
218 if ((ahd->features & AHD_MULTI_FUNC) && PCI_FUNC(pdev->devfn) != 0) in ahd_linux_pci_dev_probe()
219 ahd_linux_pci_inherit_flags(ahd); in ahd_linux_pci_dev_probe()
221 pci_set_drvdata(pdev, ahd); in ahd_linux_pci_dev_probe()
223 ahd_linux_register_host(ahd, &aic79xx_driver_template); in ahd_linux_pci_dev_probe()
251 ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, resource_size_t *base, in ahd_linux_pci_reserve_io_regions() argument
254 *base = pci_resource_start(ahd->dev_softc, 0); in ahd_linux_pci_reserve_io_regions()
260 *base2 = pci_resource_start(ahd->dev_softc, 3); in ahd_linux_pci_reserve_io_regions()
273 ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd, in ahd_linux_pci_reserve_mem_region() argument
285 if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) != 0) in ahd_linux_pci_reserve_mem_region()
288 start = pci_resource_start(ahd->dev_softc, 1); in ahd_linux_pci_reserve_mem_region()
309 ahd_pci_map_registers(struct ahd_softc *ahd) in ahd_pci_map_registers() argument
319 command = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, 4); in ahd_pci_map_registers()
323 error = ahd_linux_pci_reserve_mem_region(ahd, &base, &maddr); in ahd_pci_map_registers()
325 ahd->platform_data->mem_busaddr = base; in ahd_pci_map_registers()
326 ahd->tags[0] = BUS_SPACE_MEMIO; in ahd_pci_map_registers()
327 ahd->bshs[0].maddr = maddr; in ahd_pci_map_registers()
328 ahd->tags[1] = BUS_SPACE_MEMIO; in ahd_pci_map_registers()
329 ahd->bshs[1].maddr = maddr + 0x100; in ahd_pci_map_registers()
330 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, in ahd_pci_map_registers()
333 if (ahd_pci_test_register_access(ahd) != 0) { in ahd_pci_map_registers()
337 ahd_get_pci_bus(ahd->dev_softc), in ahd_pci_map_registers()
338 ahd_get_pci_slot(ahd->dev_softc), in ahd_pci_map_registers()
339 ahd_get_pci_function(ahd->dev_softc)); in ahd_pci_map_registers()
341 release_mem_region(ahd->platform_data->mem_busaddr, in ahd_pci_map_registers()
343 ahd->bshs[0].maddr = NULL; 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()
359 error = ahd_linux_pci_reserve_io_regions(ahd, &base, &base2); in ahd_pci_map_registers()
361 ahd->tags[0] = BUS_SPACE_PIO; in ahd_pci_map_registers()
362 ahd->tags[1] = BUS_SPACE_PIO; in ahd_pci_map_registers()
363 ahd->bshs[0].ioport = (u_long)base; in ahd_pci_map_registers()
364 ahd->bshs[1].ioport = (u_long)base2; in ahd_pci_map_registers()
369 ahd_get_pci_bus(ahd->dev_softc), in ahd_pci_map_registers()
370 ahd_get_pci_slot(ahd->dev_softc), in ahd_pci_map_registers()
371 ahd_get_pci_function(ahd->dev_softc), in ahd_pci_map_registers()
376 ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, command, 4); in ahd_pci_map_registers()
381 ahd_pci_map_int(struct ahd_softc *ahd) in ahd_pci_map_int() argument
385 error = request_irq(ahd->dev_softc->irq, ahd_linux_isr, in ahd_pci_map_int()
386 IRQF_SHARED, "aic79xx", ahd); in ahd_pci_map_int()
388 ahd->platform_data->irq = ahd->dev_softc->irq; in ahd_pci_map_int()
394 ahd_power_state_change(struct ahd_softc *ahd, ahd_power_state new_state) in ahd_power_state_change() argument
396 pci_set_power_state(ahd->dev_softc, new_state); in ahd_power_state_change()