Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: fdomain: Resurrect driver - PCI support

Future Domain TMC-3260/AHA-2920A PCI card support.

Tested on Adaptec AHA-2920A PCI card.

Signed-off-by: Ondrej Zary <linux@zary.sk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Ondrej Zary and committed by
Martin K. Petersen
68046d50 ebeb4665

+86
+17
drivers/scsi/Kconfig
··· 645 645 tristate 646 646 depends on SCSI 647 647 648 + config SCSI_FDOMAIN_PCI 649 + tristate "Future Domain TMC-3260/AHA-2920A PCI SCSI support" 650 + depends on PCI && SCSI 651 + select SCSI_FDOMAIN 652 + help 653 + This is support for Future Domain's PCI SCSI host adapters (TMC-3260) 654 + and other adapters with PCI bus based on the Future Domain chipsets 655 + (Adaptec AHA-2920A). 656 + 657 + NOTE: Newer Adaptec AHA-2920C boards use the Adaptec AIC-7850 chip 658 + and should use the aic7xxx driver ("Adaptec AIC7xxx chipset SCSI 659 + controller support"). This Future Domain driver works with the older 660 + Adaptec AHA-2920A boards with a Future Domain chip on them. 661 + 662 + To compile this driver as a module, choose M here: the 663 + module will be called fdomain_pci. 664 + 648 665 config SCSI_GDTH 649 666 tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support" 650 667 depends on PCI && SCSI
+1
drivers/scsi/Makefile
··· 77 77 obj-$(CONFIG_SCSI_ISCI) += isci/ 78 78 obj-$(CONFIG_SCSI_IPS) += ips.o 79 79 obj-$(CONFIG_SCSI_FDOMAIN) += fdomain.o 80 + obj-$(CONFIG_SCSI_FDOMAIN_PCI) += fdomain_pci.o 80 81 obj-$(CONFIG_SCSI_GENERIC_NCR5380) += g_NCR5380.o 81 82 obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o 82 83 obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
+68
drivers/scsi/fdomain_pci.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/module.h> 4 + #include <linux/pci.h> 5 + #include "fdomain.h" 6 + 7 + static int fdomain_pci_probe(struct pci_dev *pdev, 8 + const struct pci_device_id *d) 9 + { 10 + int err; 11 + struct Scsi_Host *sh; 12 + 13 + err = pci_enable_device(pdev); 14 + if (err) 15 + goto fail; 16 + 17 + err = pci_request_regions(pdev, "fdomain_pci"); 18 + if (err) 19 + goto disable_device; 20 + 21 + err = -ENODEV; 22 + if (pci_resource_len(pdev, 0) == 0) 23 + goto release_region; 24 + 25 + sh = fdomain_create(pci_resource_start(pdev, 0), pdev->irq, 7, 26 + &pdev->dev); 27 + if (!sh) 28 + goto release_region; 29 + 30 + pci_set_drvdata(pdev, sh); 31 + return 0; 32 + 33 + release_region: 34 + pci_release_regions(pdev); 35 + disable_device: 36 + pci_disable_device(pdev); 37 + fail: 38 + return err; 39 + } 40 + 41 + static void fdomain_pci_remove(struct pci_dev *pdev) 42 + { 43 + struct Scsi_Host *sh = pci_get_drvdata(pdev); 44 + 45 + fdomain_destroy(sh); 46 + pci_release_regions(pdev); 47 + pci_disable_device(pdev); 48 + } 49 + 50 + static struct pci_device_id fdomain_pci_table[] = { 51 + { PCI_DEVICE(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70) }, 52 + {} 53 + }; 54 + MODULE_DEVICE_TABLE(pci, fdomain_pci_table); 55 + 56 + static struct pci_driver fdomain_pci_driver = { 57 + .name = "fdomain_pci", 58 + .id_table = fdomain_pci_table, 59 + .probe = fdomain_pci_probe, 60 + .remove = fdomain_pci_remove, 61 + .driver.pm = FDOMAIN_PM_OPS, 62 + }; 63 + 64 + module_pci_driver(fdomain_pci_driver); 65 + 66 + MODULE_AUTHOR("Ondrej Zary, Rickard E. Faith"); 67 + MODULE_DESCRIPTION("Future Domain TMC-3260 PCI SCSI driver"); 68 + MODULE_LICENSE("GPL");