Lines Matching refs:ahc
127 struct ahc_softc *ahc = dev_get_drvdata(dev); in ahc_linux_pci_dev_suspend() local
129 return ahc_suspend(ahc); in ahc_linux_pci_dev_suspend()
135 struct ahc_softc *ahc = dev_get_drvdata(dev); in ahc_linux_pci_dev_resume() local
137 ahc_pci_resume(ahc); in ahc_linux_pci_dev_resume()
139 return (ahc_resume(ahc)); in ahc_linux_pci_dev_resume()
145 struct ahc_softc *ahc = pci_get_drvdata(pdev); in ahc_linux_pci_dev_remove() local
148 if (ahc->platform_data && ahc->platform_data->host) in ahc_linux_pci_dev_remove()
149 scsi_remove_host(ahc->platform_data->host); in ahc_linux_pci_dev_remove()
151 ahc_lock(ahc, &s); in ahc_linux_pci_dev_remove()
152 ahc_intr_enable(ahc, FALSE); in ahc_linux_pci_dev_remove()
153 ahc_unlock(ahc, &s); in ahc_linux_pci_dev_remove()
154 ahc_free(ahc); in ahc_linux_pci_dev_remove()
158 ahc_linux_pci_inherit_flags(struct ahc_softc *ahc) in ahc_linux_pci_inherit_flags() argument
160 struct pci_dev *pdev = ahc->dev_softc, *master_pdev; in ahc_linux_pci_inherit_flags()
167 ahc->flags &= ~AHC_BIOS_ENABLED; in ahc_linux_pci_inherit_flags()
168 ahc->flags |= master->flags & AHC_BIOS_ENABLED; in ahc_linux_pci_inherit_flags()
170 ahc->flags &= ~AHC_PRIMARY_CHANNEL; in ahc_linux_pci_inherit_flags()
171 ahc->flags |= master->flags & AHC_PRIMARY_CHANNEL; in ahc_linux_pci_inherit_flags()
183 struct ahc_softc *ahc; in ahc_linux_pci_dev_probe() local
207 ahc = ahc_alloc(NULL, name); in ahc_linux_pci_dev_probe()
208 if (ahc == NULL) in ahc_linux_pci_dev_probe()
211 ahc_free(ahc); in ahc_linux_pci_dev_probe()
217 && ahc->features & AHC_LARGE_SCBS in ahc_linux_pci_dev_probe()
220 ahc->flags |= AHC_39BIT_ADDRESSING; in ahc_linux_pci_dev_probe()
223 ahc_free(ahc); in ahc_linux_pci_dev_probe()
228 ahc->dev_softc = pci; in ahc_linux_pci_dev_probe()
229 ahc->dev = &pci->dev; in ahc_linux_pci_dev_probe()
230 error = ahc_pci_config(ahc, entry); in ahc_linux_pci_dev_probe()
232 ahc_free(ahc); in ahc_linux_pci_dev_probe()
240 if ((ahc->features & AHC_MULTI_FUNC) && PCI_FUNC(pdev->devfn) != 0) in ahc_linux_pci_dev_probe()
241 ahc_linux_pci_inherit_flags(ahc); in ahc_linux_pci_dev_probe()
243 pci_set_drvdata(pdev, ahc); in ahc_linux_pci_dev_probe()
244 return ahc_linux_register_host(ahc, &aic7xxx_driver_template); in ahc_linux_pci_dev_probe()
322 ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, resource_size_t *base) in ahc_linux_pci_reserve_io_region() argument
327 *base = pci_resource_start(ahc->dev_softc, 0); in ahc_linux_pci_reserve_io_region()
336 ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc, in ahc_linux_pci_reserve_mem_region() argument
344 start = pci_resource_start(ahc->dev_softc, 1); in ahc_linux_pci_reserve_mem_region()
362 ahc_pci_map_registers(struct ahc_softc *ahc) in ahc_pci_map_registers() argument
372 command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, 4); in ahc_pci_map_registers()
376 error = ahc_linux_pci_reserve_mem_region(ahc, &base, &maddr); in ahc_pci_map_registers()
378 ahc->platform_data->mem_busaddr = base; in ahc_pci_map_registers()
379 ahc->tag = BUS_SPACE_MEMIO; in ahc_pci_map_registers()
380 ahc->bsh.maddr = maddr; in ahc_pci_map_registers()
381 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, in ahc_pci_map_registers()
388 if (ahc_pci_test_register_access(ahc) != 0) { in ahc_pci_map_registers()
392 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
393 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
394 ahc_get_pci_function(ahc->dev_softc)); in ahc_pci_map_registers()
396 release_mem_region(ahc->platform_data->mem_busaddr, in ahc_pci_map_registers()
398 ahc->bsh.maddr = NULL; in ahc_pci_map_registers()
405 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
406 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
407 ahc_get_pci_function(ahc->dev_softc), in ahc_pci_map_registers()
416 error = ahc_linux_pci_reserve_io_region(ahc, &base); in ahc_pci_map_registers()
418 ahc->tag = BUS_SPACE_PIO; in ahc_pci_map_registers()
419 ahc->bsh.ioport = (u_long)base; in ahc_pci_map_registers()
424 ahc_get_pci_bus(ahc->dev_softc), in ahc_pci_map_registers()
425 ahc_get_pci_slot(ahc->dev_softc), in ahc_pci_map_registers()
426 ahc_get_pci_function(ahc->dev_softc), in ahc_pci_map_registers()
430 ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4); in ahc_pci_map_registers()
435 ahc_pci_map_int(struct ahc_softc *ahc) in ahc_pci_map_int() argument
439 error = request_irq(ahc->dev_softc->irq, ahc_linux_isr, in ahc_pci_map_int()
440 IRQF_SHARED, "aic7xxx", ahc); in ahc_pci_map_int()
442 ahc->platform_data->irq = ahc->dev_softc->irq; in ahc_pci_map_int()