From 7a603cdea3ff53a38878d59411b90103b6d6b2cd Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 27 Jun 2007 12:30:37 +0000 Subject: [PATCH] Support PCI bus/slot configuration options. --- comedi/drivers/amplc_pci230.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index 8c1206fc..3a8e1cb3 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -25,10 +25,15 @@ Driver: amplc_pci230.o Description: Amplicom PCI230, PCI260 Multifunction I/O boards Author: Allan Willcox , Steve D Sharples -Updated: Fri, 30 April 2004 +Updated: Wed, 27 Jun 2007 13:22:57 +0100 Devices: [Amplicon] PCI230 (amplc_pci230), PCI260 Status: works +Configuration options: + [0] - PCI bus of device (optional). + [1] - PCI slot of device (optional). + If bus/slot is not specified, the first available PCI device + will be used. */ /* extra triggered scan functionality, interrupt bug-fix added by Steve Sharples @@ -345,6 +350,13 @@ static int pci230_attach(comedi_device *dev,comedi_devconfig *it) /* Find card */ for(pci_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); pci_dev != NULL ; pci_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) { + if(it->options[0] || it->options[1]){ + /* Match against bus/slot options. */ + if(it->options[0] != pci_dev->bus->number || + it->options[1] != + PCI_SLOT(pci_dev->devfn)) + continue; + } if(pci_dev->vendor != PCI_VENDOR_ID_AMPLICON) continue; for(i=0;i