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