Lines Matching refs:ahc
128 struct ahc_softc *ahc = pci_get_drvdata(pdev); in ahc_linux_pci_dev_suspend() local
131 if ((rc = ahc_suspend(ahc))) in ahc_linux_pci_dev_suspend()
146 struct ahc_softc *ahc = pci_get_drvdata(pdev); in ahc_linux_pci_dev_resume() local
160 ahc_pci_resume(ahc); in ahc_linux_pci_dev_resume()
162 return (ahc_resume(ahc)); in ahc_linux_pci_dev_resume()
169 struct ahc_softc *ahc = pci_get_drvdata(pdev); in ahc_linux_pci_dev_remove() local
172 if (ahc->platform_data && ahc->platform_data->host) in ahc_linux_pci_dev_remove()
173 scsi_remove_host(ahc->platform_data->host); in ahc_linux_pci_dev_remove()
175 ahc_lock(ahc, &s); in ahc_linux_pci_dev_remove()
176 ahc_intr_enable(ahc, FALSE); in ahc_linux_pci_dev_remove()
177 ahc_unlock(ahc, &s); in ahc_linux_pci_dev_remove()
178 ahc_free(ahc); in ahc_linux_pci_dev_remove()
182 ahc_linux_pci_inherit_flags(struct ahc_softc *ahc) in ahc_linux_pci_inherit_flags() argument
184 struct pci_dev *pdev = ahc->dev_softc, *master_pdev; in ahc_linux_pci_inherit_flags()
191 ahc->flags &= ~AHC_BIOS_ENABLED; in ahc_linux_pci_inherit_flags()
192 ahc->flags |= master->flags & AHC_BIOS_ENABLED; in ahc_linux_pci_inherit_flags()
194 ahc->flags &= ~AHC_PRIMARY_CHANNEL; in ahc_linux_pci_inherit_flags()
195 ahc->flags |= master->flags & AHC_PRIMARY_CHANNEL; in ahc_linux_pci_inherit_flags()
207 struct ahc_softc *ahc; in ahc_linux_pci_dev_probe() local
231 ahc = ahc_alloc(NULL, name); in ahc_linux_pci_dev_probe()
232 if (ahc == NULL) in ahc_linux_pci_dev_probe()
235 ahc_free(ahc); in ahc_linux_pci_dev_probe()
241 && ahc->features & AHC_LARGE_SCBS in ahc_linux_pci_dev_probe()
244 ahc->flags |= AHC_39BIT_ADDRESSING; in ahc_linux_pci_dev_probe()
247 ahc_free(ahc); in ahc_linux_pci_dev_probe()
252 ahc->dev_softc = pci; in ahc_linux_pci_dev_probe()
253 ahc->dev = &pci->dev; in ahc_linux_pci_dev_probe()
254 error = ahc_pci_config(ahc, entry); in ahc_linux_pci_dev_probe()
256 ahc_free(ahc); in ahc_linux_pci_dev_probe()
264 if ((ahc->features & AHC_MULTI_FUNC) && PCI_FUNC(pdev->devfn) != 0) in ahc_linux_pci_dev_probe()
265 ahc_linux_pci_inherit_flags(ahc); in ahc_linux_pci_dev_probe()
267 pci_set_drvdata(pdev, ahc); in ahc_linux_pci_dev_probe()
268 ahc_linux_register_host(ahc, &aic7xxx_driver_template); in ahc_linux_pci_dev_probe()
347 ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, resource_size_t *base) in ahc_linux_pci_reserve_io_region() argument
352 *base = pci_resource_start(ahc->dev_softc, 0); in ahc_linux_pci_reserve_io_region()
361 ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc, in ahc_linux_pci_reserve_mem_region() argument
369 start = pci_resource_start(ahc->dev_softc, 1); in ahc_linux_pci_reserve_mem_region()
387 ahc_pci_map_registers(struct ahc_softc *ahc) in ahc_pci_map_registers() argument
397 command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, 4); in ahc_pci_map_registers()
401 error = ahc_linux_pci_reserve_mem_region(ahc, &base, &maddr); in ahc_pci_map_registers()
403 ahc->platform_data->mem_busaddr = base; in ahc_pci_map_registers()
404 ahc->tag = BUS_SPACE_MEMIO; in ahc_pci_map_registers()
405 ahc->bsh.maddr = maddr; in ahc_pci_map_registers()
406 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, in ahc_pci_map_registers()
413 if (ahc_pci_test_register_access(ahc) != 0) { in ahc_pci_map_registers()
417 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
418 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
419 ahc_get_pci_function(ahc->dev_softc)); in ahc_pci_map_registers()
421 release_mem_region(ahc->platform_data->mem_busaddr, in ahc_pci_map_registers()
423 ahc->bsh.maddr = NULL; in ahc_pci_map_registers()
430 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
431 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
432 ahc_get_pci_function(ahc->dev_softc), in ahc_pci_map_registers()
441 error = ahc_linux_pci_reserve_io_region(ahc, &base); in ahc_pci_map_registers()
443 ahc->tag = BUS_SPACE_PIO; in ahc_pci_map_registers()
444 ahc->bsh.ioport = (u_long)base; in ahc_pci_map_registers()
449 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
450 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
451 ahc_get_pci_function(ahc->dev_softc), in ahc_pci_map_registers()
455 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4); in ahc_pci_map_registers()
460 ahc_pci_map_int(struct ahc_softc *ahc) in ahc_pci_map_int() argument
464 error = request_irq(ahc->dev_softc->irq, ahc_linux_isr, in ahc_pci_map_int()
465 IRQF_SHARED, "aic7xxx", ahc); in ahc_pci_map_int()
467 ahc->platform_data->irq = ahc->dev_softc->irq; in ahc_pci_map_int()