Description: Driver for the Adlink PCI-7296 96 ch. digital io board
Devices: [ADLink] PCI-7296 (pci7296)
Author: Jon Grierson <jd@renko.co.uk>
-Updated: 2.8.2006
+Updated: Mon, 14 Apr 2008 15:05:56 +0100
Status: testing
Configuration Options:
- none
+ [0] - PCI bus of device (optional)
+ [1] - PCI slot of device (optional)
+ If bus/slot is not specified, the first supported
+ PCI device found will be used.
*/
#include <linux/comedidev.h>
{
struct pci_dev *pcidev;
comedi_subdevice *s;
+ int bus, slot;
+ int ret;
printk("comedi: attempt to attach...\n");
printk("comedi%d: adl_pci7432: board=%s\n", dev->minor,
thisboard->name);
dev->board_name = thisboard->name;
+ bus = it->options[0];
+ slot = it->options[1];
if (alloc_private(dev, sizeof(adl_pci7296_private)) < 0)
return -ENOMEM;
if (pcidev->vendor == PCI_VENDOR_ID_ADLINK &&
pcidev->device == PCI_DEVICE_ID_PCI7296) {
+ if (bus || slot) {
+ /* requested particular bus/slot */
+ if (pcidev->bus->number != bus
+ || PCI_SLOT(pcidev->devfn) != slot) {
+ continue;
+ }
+ }
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7296") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
(unsigned long)(dev->iobase));
s = dev->subdevices + 1;
- subdev_8255_init(dev, s, NULL,
+ ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT2A));
+ if (ret < 0)
+ return ret;
s = dev->subdevices + 2;
- subdev_8255_init(dev, s, NULL,
+ ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT3A));
+ if (ret < 0)
+ return ret;
s = dev->subdevices + 3;
- subdev_8255_init(dev, s, NULL,
+ ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT4A));
+ if (ret < 0)
+ return ret;
+
+ printk("attached\n");
- break;
+ return 1;
}
}
- printk("attached\n");
-
- return 1;
+ printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
+ dev->minor, bus, slot);
+ return -EIO;
}
static int adl_pci7296_detach(comedi_device * dev)
Devices: [ADLink] PCI-7432 (pci7432)
Author: Michel Lachaine <mike@mikelachaine.ca>
Status: experimental
+Updated: Mon, 14 Apr 2008 15:08:14 +0100
Configuration Options:
- none
+ [0] - PCI bus of device (optional)
+ [1] - PCI slot of device (optional)
+ If bus/slot is not specified, the first supported
+ PCI device found will be used.
*/
#include <linux/comedidev.h>
{
struct pci_dev *pcidev;
comedi_subdevice *s;
+ int bus, slot;
printk("comedi: attempt to attach...\n");
printk("comedi%d: adl_pci7432: board=%s\n", dev->minor,
thisboard->name);
dev->board_name = thisboard->name;
+ bus = it->options[0];
+ slot = it->options[1];
if (alloc_private(dev, sizeof(adl_pci7432_private)) < 0)
return -ENOMEM;
if (pcidev->vendor == PCI_VENDOR_ID_ADLINK &&
pcidev->device == PCI_DEVICE_ID_PCI7432) {
+ if (bus || slot) {
+ /* requested particular bus/slot */
+ if (pcidev->bus->number != bus
+ || PCI_SLOT(pcidev->devfn) != slot) {
+ continue;
+ }
+ }
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7432") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
s->range_table = &range_digital;
s->insn_bits = adl_pci7432_do_insn_bits;
- break;
+ printk("comedi: attached\n");
+
+ return 1;
}
}
- printk("comedi: attached\n");
-
- return 1;
+ printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
+ dev->minor, bus, slot);
+ return -EIO;
}
static int adl_pci7432_detach(comedi_device * dev)
Devices: [ADLink] PCI-8164 (pci8164)
Author: Michel Lachaine <mike@mikelachaine.ca>
Status: experimental
+Updated: Mon, 14 Apr 2008 15:10:32 +0100
Configuration Options:
- none
+ [0] - PCI bus of device (optional)
+ [1] - PCI slot of device (optional)
+ If bus/slot is not specified, the first supported
+ PCI device found will be used.
*/
#include <linux/comedidev.h>
{
struct pci_dev *pcidev;
comedi_subdevice *s;
+ int bus, slot;
printk("comedi: attempt to attach...\n");
printk("comedi%d: adl_pci8164: board=%s\n", dev->minor,
thisboard->name);
dev->board_name = thisboard->name;
+ bus = it->options[0];
+ slot = it->options[1];
if (alloc_private(dev, sizeof(adl_pci8164_private)) < 0)
return -ENOMEM;
if (pcidev->vendor == PCI_VENDOR_ID_ADLINK &&
pcidev->device == PCI_DEVICE_ID_PCI8164) {
+ if (bus || slot) {
+ /* requested particular bus/slot */
+ if (pcidev->bus->number != bus
+ || PCI_SLOT(pcidev->devfn) != slot) {
+ continue;
+ }
+ }
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci8164") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
s->insn_read = adl_pci8164_insn_read_buf1;
s->insn_write = adl_pci8164_insn_write_buf1;
- break;
+ printk("comedi: attached\n");
+
+ return 1;
}
}
- printk("comedi: attached\n");
-
- return 1;
+ printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
+ dev->minor, bus, slot);
+ return -EIO;
}
static int adl_pci8164_detach(comedi_device * dev)
Description: IOTech DAQBoard/2000
Author: Anders Blomdell <anders.blomdell@control.lth.se>
Status: works
+Updated: Mon, 14 Apr 2008 15:28:52 +0100
Devices: [IOTech] DAQBoard/2000 (daqboard2000)
Much of the functionality of this driver was determined from reading
in the comedi_nonfree_firmware tarball.
Configuration options:
- none
+ [0] - PCI bus of device (optional)
+ [1] - PCI slot of device (optional)
+ If bus/slot is not specified, the first supported
+ PCI device found will be used.
*/
/*
This card was obviously never intended to leave the Windows world,
struct pci_dev *card = NULL;
void *aux_data;
unsigned int aux_len;
+ int bus, slot;
printk("comedi%d: daqboard2000:", dev->minor);
+ bus = it->options[0];
+ slot = it->options[1];
+
result = alloc_private(dev, sizeof(daqboard2000_private));
if (result < 0) {
return -ENOMEM;
}
- /* FIXME: we should handle multiple cards, have to make David decide
- how, so we will be consistent among all PCI card drivers... */
- card = pci_get_device(0x1616, 0x0409, NULL);
+ for (card = pci_get_device(0x1616, 0x0409, NULL);
+ card != NULL;
+ card = pci_get_device(0x1616, 0x0409, card)) {
+ if (bus || slot) {
+ /* requested particular bus/slot */
+ if (card->bus->number != bus ||
+ PCI_SLOT(card->devfn) != slot) {
+ continue;
+ }
+ }
+ }
if (!card) {
- printk(" no daqboard2000 found\n");
+ if (bus || slot)
+ printk(" no daqboard2000 found at bus/slot: %d/%d\n",
+ bus, slot);
+ else
+ printk(" no daqboard2000 found\n");
return -EIO;
} else {
u32 id;
Author: ds
Devices: [Data Translation] DT3001 (dt3000), DT3001-PGL, DT3002, DT3003,
DT3003-PGL, DT3004, DT3005, DT3004-200
+Updated: Mon, 14 Apr 2008 15:41:24 +0100
Status: works
+Configuration Options:
+ [0] - PCI bus of device (optional)
+ [1] - PCI slot of device (optional)
+ If bus/slot is not specified, the first supported
+ PCI device found will be used.
+
There is code to support AI commands, but it may not work.
AO commands are not supported.
return i;
}
-static int dt_pci_probe(comedi_device * dev);
+static int dt_pci_probe(comedi_device * dev, int bus, int slot);
static int dt3000_attach(comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
+ int bus, slot;
int ret = 0;
printk("dt3000:");
+ bus = it->options[0];
+ slot = it->options[1];
if ((ret = alloc_private(dev, sizeof(dt3k_private))) < 0)
return ret;
- ret = dt_pci_probe(dev);
+ ret = dt_pci_probe(dev, bus, slot);
if (ret < 0)
return ret;
if (ret == 0) {
static struct pci_dev *dt_pci_find_device(struct pci_dev *from, int *board);
static int setup_pci(comedi_device * dev);
-static int dt_pci_probe(comedi_device * dev)
+static int dt_pci_probe(comedi_device * dev, int bus, int slot)
{
int board;
int ret;
+ struct pci_dev *pcidev;
+
+ pcidev = NULL;
+ while ((pcidev = dt_pci_find_device(pcidev, &board)) != NULL) {
+ if ((bus == 0 && slot == 0) ||
+ (pcidev->bus->number == bus &&
+ PCI_SLOT(pcidev->devfn == slot))) {
+ break;
+ }
+ }
+ devpriv->pci_dev = pcidev;
- devpriv->pci_dev = dt_pci_find_device(NULL, &board);
if (board >= 0)
dev->board_ptr = dt3k_boardtypes + board;