}
printk("\n");
- ret = comedi_request_irq(link->irq.AssignedIRQ, das16cs_interrupt,
+ ret = comedi_request_irq(
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ,
+#else
+ link->irq,
+#endif
+ das16cs_interrupt,
IRQF_SHARED, "cb_das16_cs", dev);
if (ret < 0) {
return ret;
}
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
dev->irq = link->irq.AssignedIRQ;
+#else
+ dev->irq = link->irq;
+#endif
printk("irq=%u ", dev->irq);
dev->board_ptr = das16cs_probe(dev, link);
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
struct bus_operations *bus;
} local_info_t;
link->priv = local;
/* Initialize the pcmcia_device structure */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
#endif
link->irq.Handler = NULL;
+#endif
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
{
DEBUG(0, "das16cs_pcmcia_detach(0x%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
((local_info_t *) link->priv)->stop = 1;
das16cs_pcmcia_release(link);
}
return -EINVAL;
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
+#endif
+ {
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void das16cs_pcmcia_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
}
*/
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+#endif
+ {
link->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
}
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
/*
Allocate an interrupt line. Note that this does not assign a
handler to the interrupt, unless the 'Handler' member of the
if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0)
goto cs_failed;
}
+#else
+ /* Check an interrupt line has been allocated. */
+ if (!link->irq)
+ goto cs_failed;
+#endif
/*
This actually configures the PCMCIA socket -- setting up
the I/O windows and the interrupt mapping, and putting the
if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
goto cs_failed;
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "cb_das16_cs");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %u", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
+
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
struct bus_operations *bus;
} local_info_t;
local->link = link;
link->priv = local;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
#endif
link->irq.Handler = NULL;
+#endif
/*
General socket configuration defaults can go here. In this
DEBUG(0, "das08_pcmcia_detach(0x%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
((local_info_t *) link->priv)->stop = 1;
das08_pcmcia_release(link);
}
return -ENODEV;
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
+#endif
+ {
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void das08_pcmcia_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
}
*/
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+#endif
+ {
link->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
}
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
if (link->conf.Attributes & CONF_ENABLE_IRQ) {
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestIRQ;
if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0)
goto cs_failed;
}
+#else
+ /* Check an interrupt line has been allocated. */
+ if (!link->irq)
+ goto cs_failed;
+#endif
/*
This actually configures the PCMCIA socket -- setting up
if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
goto cs_failed;
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "pcm-das08");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %u", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
return -EIO;
iobase = link->io.BasePort1;
#ifdef incomplete
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
+#else
+ irq = link->irq;
+#endif
#endif
break;
default:
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
struct bus_operations *bus;
} local_info_t;
local->link = link;
link->priv = local;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
#endif
link->irq.Handler = NULL;
+#endif
/*
General socket configuration defaults can go here. In this
DEBUG(0, "dio700_cs_detach(0x%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
((local_info_t *) link->priv)->stop = 1;
dio700_release(link);
}
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
+#endif
+ {
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void dio700_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
win_req_t req;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+#endif
+ {
link->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
}
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
/*
Allocate an interrupt line. Note that this does not assign a
handler to the interrupt, unless the 'Handler' member of the
if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0) {
goto cs_failed;
}
+#else
+ /* Check an interrupt line has been allocated. */
+ if (!link->irq)
+ goto cs_failed;
+#endif
/*
This actually configures the PCMCIA socket -- setting up
goto cs_failed;
}
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "ni_daq_700");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
return -EIO;
iobase = link->io.BasePort1;
#ifdef incomplete
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
+#else
+ irq = link->irq;
+#endif
#endif
break;
default:
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
struct bus_operations *bus;
} local_info_t;
local->link = link;
link->priv = local;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
#endif
link->irq.Handler = NULL;
+#endif
/*
General socket configuration defaults can go here. In this
DEBUG(0, "dio24_cs_detach(0x%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
((local_info_t *) link->priv)->stop = 1;
dio24_release(link);
}
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
+#endif
+ {
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void dio24_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
win_req_t req;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+#endif
+ {
link->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
}
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
/*
Allocate an interrupt line. Note that this does not assign a
handler to the interrupt, unless the 'Handler' member of the
if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0) {
goto cs_failed;
}
+#else
+ /* Check an interrupt line has been allocated. */
+ if (!link->irq)
+ goto cs_failed;
+#endif
/*
This actually configures the PCMCIA socket -- setting up
goto cs_failed;
}
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "ni_daq_dio24");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (!link)
return -EIO;
iobase = link->io.BasePort1;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
+#else
+ irq = link->irq;
+#endif
break;
default:
printk("bug! couldn't determine board type\n");
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
struct bus_operations *bus;
} local_info_t;
local->link = link;
link->priv = local;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_PULSE_ID;
#endif
link->irq.Handler = NULL;
+#endif
/*
General socket configuration defaults can go here. In this
the release() function is called, that will trigger a proper
detach().
*/
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
((local_info_t *) link->priv)->stop = 1;
labpc_release(link);
}
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+#else
+ p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
+#endif
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void labpc_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
win_req_t req;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
}
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
link->conf.Attributes |= CONF_ENABLE_IRQ;
+#else
+ link->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
+#endif
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
}
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
/*
Allocate an interrupt line. Note that this does not assign a
handler to the interrupt, unless the 'Handler' member of the
if ((last_ret = pcmcia_request_irq(link, &link->irq))) {
goto cs_failed;
}
+#else
+ /* Check an interrupt line has been allocated. */
+ if (!link->irq)
+ goto cs_failed;
+#endif
/*
This actually configures the PCMCIA socket -- setting up
goto cs_failed;
}
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "daqcard-1200");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
static struct pcmcia_device *cur_dev = NULL;
static const dev_info_t dev_info = "ni_mio_cs";
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
static dev_node_t dev_node = {
"ni_mio_cs",
COMEDI_MAJOR, 0,
NULL
};
+#endif
static int cs_attach(struct pcmcia_device *link)
{
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->io.NumPorts1 = 16;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
+#endif
#endif
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
{
DPRINTK("cs_detach(link=%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
cs_release(link);
}
}
link->irq.IRQInfo1 = parse.cftable_entry.irq.IRQInfo1;
link->irq.IRQInfo2 = parse.cftable_entry.irq.IRQInfo2;
#endif
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
ret = pcmcia_request_irq(link, &link->irq);
if (ret) {
printk("pcmcia_request_irq() returned error: %i\n", ret);
}
//printk("RequestIRQ 0x%02x\n",ret);
+#else
+ if (!link->irq)
+ dev_info(&link->dev, "no IRQ available\n");
+#endif
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->conf.ConfigIndex = 1;
ret = pcmcia_request_configuration(link, &link->conf);
//printk("RequestConfiguration %d\n",ret);
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
link->dev_node = &dev_node;
+#endif
}
static int mio_cs_attach(comedi_device * dev, comedi_devconfig * it)
dev->driver = &driver_ni_mio_cs;
dev->iobase = link->io.BasePort1;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
+#else
+ irq = link->irq;
+#endif
printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %u, ",
dev->minor, dev->driver->driver_name, dev->iobase, irq);
typedef struct local_info_t {
struct pcmcia_device *link;
+#ifdef COMEDI_HAVE_DS_DEV_NODE_T
dev_node_t node;
+#endif
int stop;
int table_index;
char board_name[32];
local->link = link;
link->priv = local;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.Handler = daqp_interrupt;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
link->irq.Instance = local;
+#endif
#endif
/*
DEBUG(0, "daqp_cs_detach(0x%p)\n", link);
- if (link->dev_node) {
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
+ if (link->dev_node)
+#endif
+ {
dev->stop = 1;
daqp_cs_release(link);
}
return -ENODEV;
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
+#endif
+ {
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
static void daqp_cs_config(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
local_info_t *dev = link->priv;
+#endif
int last_ret;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
link->conf.ConfigIndex = cfg->index;
/* Do we need to allocate an interrupt? */
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
+#endif
+ {
link->conf.Attributes |= CONF_ENABLE_IRQ;
+ }
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
handler to the interrupt, unless the 'Handler' member of the
irq structure is initialized.
*/
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
if (link->conf.Attributes & CONF_ENABLE_IRQ)
+#endif
+ {
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestIRQ;
#endif
- if ((last_ret = pcmcia_request_irq(link, &link->irq))) {
+#ifdef COMEDI_HAVE_CS_IRQ_REQ_T
+ last_ret = pcmcia_request_irq(link, &link->irq);
+#else
+ last_ret = pcmcia_request_irq(link, daqp_interrupt);
+#endif
+ if (last_ret)
goto cs_failed;
- }
+ }
/*
This actually configures the PCMCIA socket -- setting up
goto cs_failed;
}
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev.
sprintf(dev->node.dev_name, "quatech_daqp_cs");
dev->node.major = dev->node.minor = 0;
link->dev_node = &dev->node;
+#endif
/* Finally, report what we've done */
+#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
dev->node.dev_name, link->conf.ConfigIndex);
+#else
+ dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
+#endif
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %u", link->irq.AssignedIRQ);
+ printk(", irq %u",
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
+ link->irq.AssignedIRQ
+#else
+ link->irq
+#endif
+ );
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
AC_DEFINE([CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE],[true],[Define if Linux kernel source has pcmcia_loop_tuple function])
fi
+COMEDI_CHECK_DS_DEV_NODE_T([$LINUX_SRC_DIR],
+ [HAVE_DS_DEV_NODE_T="yes"], [HAVE_DS_DEV_NODE_T="no"])
+if test "$HAVE_DS_DEV_NODE_T" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_DS_DEV_NODE_T],[true],[Define if Linux kernel source has dev_node_t in pcmcia/ds.h (removed in 2.6.35)])
+fi
+
+COMEDI_CHECK_CS_IRQ_REQ_T([$LINUX_SRC_DIR],
+ [HAVE_CS_IRQ_REQ_T="yes"], [HAVE_CS_IRQ_REQ_T="no"])
+if test "$HAVE_CS_IRQ_REQ_T" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T],[true],[Define if Linux kernel source has irq_req_t in pcmcia/cs.h (removed in 2.6.35)])
+fi
+
AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_USB],[HAVE_USB="yes"],[HAVE_USB="yes"],[HAVE_USB="no"])
AM_CONDITIONAL([CONFIG_USB],[test "$HAVE_USB" = "yes"])
AC_ARG_ENABLE([usb],[ --disable-usb Disable support for USB devices],
fi
])
+# COMEDI_CHECK_DS_DEV_NODE_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the dev_node_t type
+# in pcmcia/ds.h.
+AC_DEFUN([COMEDI_CHECK_DS_DEV_NODE_T],
+[
+ AC_MSG_CHECKING([$1 for dev_node_t in pcmcia/ds.h (removed in 2.6.35)])
+ if [grep -q dev_node_t "$1/include/pcmcia/ds.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_CS_IRQ_REQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the irq_req_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_IRQ_REQ_T],
+[
+ AC_MSG_CHECKING([$1 for irq_req_t in pcmcia/cs.h (removed in 2.6.35)])
+ if [grep -q irq_req_t "$1/include/pcmcia/cs.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
# COMEDI_CHECK_HAVE_MUTEX_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------
#