47 #define ID(x) ID_C(x, PCI_CLASS_STORAGE_SCSI)
49 static const struct pci_device_id ahc_linux_pci_id_table[] = {
128 struct ahc_softc *ahc = pci_get_drvdata(pdev);
131 if ((rc = ahc_suspend(ahc)))
144 ahc_linux_pci_dev_resume(
struct pci_dev *pdev)
146 struct ahc_softc *ahc = pci_get_drvdata(pdev);
154 "failed to enable device after resume (%d)\n", rc);
162 return (ahc_resume(ahc));
167 ahc_linux_pci_dev_remove(
struct pci_dev *pdev)
169 struct ahc_softc *ahc = pci_get_drvdata(pdev);
182 ahc_linux_pci_inherit_flags(
struct ahc_softc *ahc)
189 struct ahc_softc *master = pci_get_drvdata(master_pdev);
206 const uint64_t mask_39bit = 0x7FFFFFFFFFULL;
224 sprintf(buf,
"ahc_pci:%d:%d:%d",
225 ahc_get_pci_bus(pci),
226 ahc_get_pci_slot(pci),
227 ahc_get_pci_function(pci));
265 ahc_linux_pci_inherit_flags(ahc);
267 pci_set_drvdata(pdev, ahc);
281 pci_read_config_byte(pci, reg, &retval);
287 pci_read_config_word(pci, reg, &retval);
293 pci_read_config_dword(pci, reg, &retval);
297 panic(
"ahc_pci_read_config: Read size too big");
308 pci_write_config_byte(pci, reg, value);
311 pci_write_config_word(pci, reg, value);
314 pci_write_config_dword(pci, reg, value);
317 panic(
"ahc_pci_write_config: Write size too big");
323 static struct pci_driver aic7xxx_pci_driver = {
325 .probe = ahc_linux_pci_dev_probe,
327 .suspend = ahc_linux_pci_dev_suspend,
328 .resume = ahc_linux_pci_dev_resume,
330 .remove = ahc_linux_pci_dev_remove,
331 .id_table = ahc_linux_pci_id_table
337 return pci_register_driver(&aic7xxx_pci_driver);
361 ahc_linux_pci_reserve_mem_region(
struct ahc_softc *ahc,
376 if (*maddr ==
NULL) {
401 error = ahc_linux_pci_reserve_mem_region(ahc, &base, &maddr);
415 printk(
"aic7xxx: PCI Device %d:%d:%d "
416 "failed memory mapped test. Using PIO.\n",
428 printk(
"aic7xxx: PCI%d:%d:%d MEM region 0x%llx "
429 "unavailable. Cannot memory map device.\n",
433 (
unsigned long long)base);
441 error = ahc_linux_pci_reserve_io_region(ahc, &base);
447 printk(
"aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] "
448 "unavailable. Cannot map device.\n",
452 (
unsigned long long)base);