Lines Matching +full:pci +full:- +full:based
2 * Linux driver attachment glue for PCI based controllers.
4 * Copyright (c) 2000-2001 Adaptec Inc.
18 * 3. Neither the names of the above-listed copyright holders nor the names
50 /* aic7850 based controllers */
52 /* aic7860 based controllers */
58 /* aic7870 based controllers */
65 /* aic7880 based controllers */
75 /* aic7890 based controllers */
83 /* aic7890 based controllers */
91 /* aic7892 based controllers */
101 /* aic7899 based controllers */
122 MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
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()
160 struct pci_dev *pdev = ahc->dev_softc, *master_pdev; in ahc_linux_pci_inherit_flags()
161 unsigned int master_devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); in ahc_linux_pci_inherit_flags()
163 master_pdev = pci_get_slot(pdev->bus, master_devfn); 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()
184 ahc_dev_softc_t pci; in ahc_linux_pci_dev_probe() local
188 struct device *dev = &pdev->dev; in ahc_linux_pci_dev_probe()
190 pci = pdev; in ahc_linux_pci_dev_probe()
191 entry = ahc_find_pci_device(pci); in ahc_linux_pci_dev_probe()
193 return (-ENODEV); in ahc_linux_pci_dev_probe()
201 ahc_get_pci_bus(pci), in ahc_linux_pci_dev_probe()
202 ahc_get_pci_slot(pci), in ahc_linux_pci_dev_probe()
203 ahc_get_pci_function(pci)); in ahc_linux_pci_dev_probe()
206 return (-ENOMEM); in ahc_linux_pci_dev_probe()
209 return (-ENOMEM); in ahc_linux_pci_dev_probe()
212 return (-ENODEV); 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()
225 return (-ENODEV); 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()
233 return (-error); in ahc_linux_pci_dev_probe()
237 * Second Function PCI devices need to inherit some in ahc_linux_pci_dev_probe()
240 if ((ahc->features & AHC_MULTI_FUNC) && PCI_FUNC(pdev->devfn) != 0) in ahc_linux_pci_dev_probe()
247 /******************************* PCI Routines *********************************/
249 ahc_pci_read_config(ahc_dev_softc_t pci, int reg, int width) in ahc_pci_read_config() argument
256 pci_read_config_byte(pci, reg, &retval); in ahc_pci_read_config()
262 pci_read_config_word(pci, reg, &retval); in ahc_pci_read_config()
268 pci_read_config_dword(pci, reg, &retval); in ahc_pci_read_config()
279 ahc_pci_write_config(ahc_dev_softc_t pci, int reg, uint32_t value, int width) in ahc_pci_write_config() argument
283 pci_write_config_byte(pci, reg, value); in ahc_pci_write_config()
286 pci_write_config_word(pci, reg, value); in ahc_pci_write_config()
289 pci_write_config_dword(pci, reg, value); in ahc_pci_write_config()
327 *base = pci_resource_start(ahc->dev_softc, 0); in ahc_linux_pci_reserve_io_region()
344 start = pci_resource_start(ahc->dev_softc, 1); in ahc_linux_pci_reserve_mem_region()
372 command = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, 4); 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()
390 printk("aic7xxx: PCI Device %d:%d:%d " 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()
403 printk("aic7xxx: PCI%d:%d:%d MEM region 0x%llx " 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()
418 ahc->tag = BUS_SPACE_PIO; in ahc_pci_map_registers()
419 ahc->bsh.ioport = (u_long)base; in ahc_pci_map_registers()
422 printk("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] " 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()
439 error = request_irq(ahc->dev_softc->irq, ahc_linux_isr, in ahc_pci_map_int()
442 ahc->platform_data->irq = ahc->dev_softc->irq; in ahc_pci_map_int()
444 return (-error); in ahc_pci_map_int()