#include <linux/delay.h>
#include <linux/pci.h>
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
if (!link)
return -EIO;
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
dev->iobase = link->io.BasePort1;
+#else
+ dev->iobase = link->resource[0]->start;
+#endif
printk("I/O base=0x%04lx ", dev->iobase);
printk("fingerprint:\n");
*/
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static dev_info_t dev_info = "cb_das16_cs";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "cb_das16_cs";
+#else
+static const char devname[] = "cb_das16_cs";
+#endif
typedef struct local_info_t {
struct pcmcia_device *link;
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
/* This reserves IO space but doesn't actually enable it */
return pcmcia_request_io(p_dev, &p_dev->io);
}
+#else
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ return pcmcia_request_io(p_dev);
+ }
+#endif
return 0;
}
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
if (pcmcia_request_io(link, &link->io))
goto next_entry;
}
+#else
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link))
+ goto next_entry;
+ }
+#endif
/* If we got this far, we're cool! */
break;
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
printk("\n");
return;
.id_table = das16cs_id_table,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include "das08.h"
// pcmcia includes
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
printk(" no pcmcia cards found\n");
return -EIO;
}
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
iobase = link->io.BasePort1;
+#else
+ iobase = link->resource[0]->start;
+#endif
} else {
printk(" bug! board does not have PCMCIA bustype\n");
return -EINVAL;
*/
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static const dev_info_t dev_info = "pcm-das08";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "pcm-das08";
+#else
+static const char devname[] = "pcm-das08";
+#endif
typedef struct local_info_t {
struct pcmcia_device *link;
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
/* This reserves IO space but doesn't actually enable it */
return pcmcia_request_io(p_dev, &p_dev->io);
}
+#else
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ return pcmcia_request_io(p_dev);
+ }
+#endif
return 0;
}
#endif
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
if (pcmcia_request_io(link, &link->io) != 0)
goto next_entry;
}
+#else
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link) != 0)
+ goto next_entry;
+ }
+#endif
/* If we got this far, we're cool! */
break;
link->irq
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
printk("\n");
return;
.id_table = das08_cs_id_table,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include <linux/ioport.h>
#include <linux/version.h>
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
link = pcmcia_cur_dev; /* XXX hack */
if (!link)
return -EIO;
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
iobase = link->io.BasePort1;
+#else
+ iobase = link->resource[0]->start;
+#endif
#ifdef incomplete
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
*/
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static const dev_info_t dev_info = "ni_daq_700";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "ni_daq_700";
+#else
+static const char devname[] = "ni_daq_700";
+#endif
typedef struct local_info_t {
struct pcmcia_device *link;
void *priv_data)
{
win_req_t *req = priv_data;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
if (cfg->index == 0)
return -ENODEV;
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
return -ENODEV;
}
+#else
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(p_dev) != 0)
+ return -ENODEV;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
cistpl_mem_t *mem =
req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
+#endif
+ if (pcmcia_map_mem_page(p_dev, p_dev->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
return -ENODEV;
}
/* If we got this far, we're cool! */
cisparse_t parse;
int last_fn;
u_char buf[64];
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
cistpl_cftable_entry_t dflt = { 0 };
#endif
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
if (pcmcia_request_io(link, &link->io) != 0)
goto next_entry;
}
+#else
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link) != 0)
+ goto next_entry;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
cistpl_mem_t *mem =
req.AccessSpeed = 0;
if (pcmcia_request_window(&link, &req, &link->win))
goto next_entry;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(link->win, &map))
+#endif
+ if (pcmcia_map_mem_page(link->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
goto next_entry;
}
/* If we got this far, we're cool! */
link->irq
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
if (link->win)
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
.id_table = dio700_cs_ids,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include "8255.h"
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
link = pcmcia_cur_dev; /* XXX hack */
if (!link)
return -EIO;
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
iobase = link->io.BasePort1;
+#else
+ iobase = link->resource[0]->start;
+#endif
#ifdef incomplete
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
*/
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static const dev_info_t dev_info = "ni_daq_dio24";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "ni_daq_dio24";
+#else
+static const char devname[] = "ni_daq_dio24";
+#endif
typedef struct local_info_t {
struct pcmcia_device *link;
void *priv_data)
{
win_req_t *req = priv_data;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
if (cfg->index == 0)
return -ENODEV;
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
return -ENODEV;
}
+#else
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(p_dev) != 0)
+ return -ENODEV;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
cistpl_mem_t *mem =
req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
+#endif
+ if (pcmcia_map_mem_page(p_dev, p_dev->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
return -ENODEV;
}
/* If we got this far, we're cool! */
cisparse_t parse;
int last_fn;
u_char buf[64];
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
cistpl_cftable_entry_t dflt = { 0 };
#endif
}
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
if (pcmcia_request_io(link, &link->io) != 0)
goto next_entry;
}
+#else
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link) != 0)
+ goto next_entry;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
cistpl_mem_t *mem =
req.AccessSpeed = 0;
if (pcmcia_request_window(&link, &req, &link->win))
goto next_entry;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(link->win, &map))
+#endif
+ if (pcmcia_map_mem_page(link->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
goto next_entry;
}
/* If we got this far, we're cool! */
link->irq
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
if (link->win)
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
.id_table = dio24_cs_ids,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include "comedi_fc.h"
#include "ni_labpc.h"
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
link = pcmcia_cur_dev; /* XXX hack */
if (!link)
return -EIO;
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
iobase = link->io.BasePort1;
+#else
+ iobase = link->resource[0]->start;
+#endif
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
#else
*/
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static const dev_info_t dev_info = "daqcard-1200";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "daqcard-1200";
+#else
+static const char devname[] = "daqcard-1200";
+#endif
typedef struct local_info_t {
struct pcmcia_device *link;
void *priv_data)
{
win_req_t *req = priv_data;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
if (cfg->index == 0)
return -ENODEV;
#endif
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
return -ENODEV;
}
+#else
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(p_dev) != 0)
+ return -ENODEV;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
cistpl_mem_t *mem =
req->AccessSpeed = 0;
if (pcmcia_request_window(p_dev, req, &p_dev->win))
return -ENODEV;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
+#endif
+ if (pcmcia_map_mem_page(p_dev, p_dev->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
return -ENODEV;
}
/* If we got this far, we're cool! */
cisparse_t parse;
int last_fn;
u_char buf[64];
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
memreq_t map;
+#endif
cistpl_cftable_entry_t dflt = { 0 };
#endif
#endif
/* IO window settings */
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
if (pcmcia_request_io(link, &link->io))
goto next_entry;
}
+#else
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link))
+ goto next_entry;
+ }
+#endif
if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) {
cistpl_mem_t *mem =
link->win = (window_handle_t) link;
if (pcmcia_request_window(&link, &req, &link->win))
goto next_entry;
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
map.Page = 0;
map.CardOffset = mem->win[0].card_addr;
- if (pcmcia_map_mem_page(link->win, &map))
+#endif
+ if (pcmcia_map_mem_page(link->win,
+#ifdef CONFIG_COMEDI_HAVE_CS_MEMREQ_T
+ &map
+#else
+ mem->win[0].card_addr
+#endif
+ ))
goto next_entry;
}
/* If we got this far, we're cool! */
link->irq
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
if (link->win)
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
.id_table = labpc_cs_ids,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include "ni_stc.h"
#include "8255.h"
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
static void cs_detach(struct pcmcia_device *);
static struct pcmcia_device *cur_dev = NULL;
-static const dev_info_t dev_info = "ni_mio_cs";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "ni_mio_cs";
+#else
+static const char devname[] = "ni_mio_cs";
+#endif
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
static dev_node_t dev_node = {
"ni_mio_cs",
#endif
static int cs_attach(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->io.NumPorts1 = 16;
+#else
+ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
+ link->resource[0]->end = 16;
+#endif
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
{
int base, ret;
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = cfg->io.win[0].len;
p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
p_dev->io.NumPorts2 = 0;
+#else
+ p_dev->resource[0]->end = cfg->io.win[0].len;
+ p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
+#endif
for (base = 0x000; base < 0x400; base += 0x20) {
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.BasePort1 = base;
ret = pcmcia_request_io(p_dev, &p_dev->io);
+#else
+ p_dev->resource[0]->start = base;
+ ret = pcmcia_request_io(p_dev);
+#endif
if (!ret)
return 0;
}
link->io.IOAddrLines = 5;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
link->io.IOAddrLines =
parse.cftable_entry.io.flags & CISTPL_IO_LINES_MASK;
link->io.NumPorts2 = 0;
+#else
+ link->resource[0]->end = parse.cftable_entry.io.win[0].len;
+ link->io_lines =
+ parse.cftable_entry.io.flags & CISTPL_IO_LINES_MASK;
+#endif
{
int base;
for (base = 0x000; base < 0x400; base += 0x20) {
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.BasePort1 = base;
ret = pcmcia_request_io(link, &link->io);
+#else
+ link->resource[0]->start = base;
+ ret = pcmcia_request_io(link);
+#endif
//printk("RequestIO 0x%02x\n",ret);
if (!ret)
break;
}
}
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
link->irq.IRQInfo1 = parse.cftable_entry.irq.IRQInfo1;
link->irq.IRQInfo2 = parse.cftable_entry.irq.IRQInfo2;
#endif
+#endif
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
ret = pcmcia_request_irq(link, &link->irq);
if (ret) {
return -EIO;
dev->driver = &driver_ni_mio_cs;
+#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
dev->iobase = link->io.BasePort1;
+#else
+ dev->iobase = link->resource[0]->start;
+#endif
#ifdef CONFIG_COMEDI_HAVE_CS_IRQ_REQ_T
irq = link->irq.AssignedIRQ;
.id_table = ni_mio_cs_ids,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
#include <linux/version.h>
#include <linux/semaphore.h>
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
+#endif
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
}
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
dev->iobase = local->link->io.BasePort1;
+#else
+ dev->iobase = local->link->resource[0]->start;
+#endif
if ((ret = alloc_subdevices(dev, 4)) < 0)
return ret;
static void daqp_cs_detach(struct pcmcia_device *);
/*
- The dev_info variable is the "key" that is used to match up this
+ The devname variable is the "key" that is used to match up this
device driver with appropriate cards, through the card configuration
database.
*/
-static const dev_info_t dev_info = "quatech_daqp_cs";
+#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
+static const dev_info_t devname = "quatech_daqp_cs";
+#else
+static const char devname[] = "quatech_daqp_cs";
+#endif
/*======================================================================
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
}
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
/* This reserves IO space but doesn't actually enable it */
return pcmcia_request_io(p_dev, &p_dev->io);
+#else
+ /* IO window settings */
+ p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+ p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ p_dev->resource[0]->start = io->win[0].base;
+ p_dev->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ p_dev->resource[1]->start = io->win[1].base;
+ p_dev->resource[1]->end = io->win[1].len;
+ }
+ }
+
+ /* This reserves IO space but doesn't actually enable it */
+ return pcmcia_request_io(p_dev);
+#endif
}
#endif
link->conf.Attributes |= CONF_ENABLE_IRQ;
}
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
/* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
/* This reserves IO space but doesn't actually enable it */
if (pcmcia_request_io(link, &link->io))
goto next_entry;
+#else
+ /* IO window settings */
+ link->resource[0]->end = link->resource[1]->end = 0;
+ if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
+ cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+ link->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ link->resource[0]->flags |=
+ pcmcia_io_cfg_data_width(io->flags);
+ link->resource[0]->start = io->win[0].base;
+ link->resource[0]->end = io->win[0].len;
+ if (io->nwin > 1) {
+ link->resource[1]->flags = p_dev->resource[0]->flags;
+ link->resource[1]->start = io->win[1].base;
+ link->resource[1]->end = io->win[1].len;
+ }
+ }
+
+ /* This reserves IO space but doesn't actually enable it */
+ if (pcmcia_request_io(link))
+ goto next_entry;
+#endif
/* If we got this far, we're cool! */
break;
link->irq
#endif
);
+#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1 + link->io.NumPorts1 - 1);
if (link->io.NumPorts2)
printk(" & 0x%04x-0x%04x", link->io.BasePort2,
link->io.BasePort2 + link->io.NumPorts2 - 1);
+#else
+ if (link->resource[0])
+ printk(", io %pR", link->resource[0]);
+ if (link->resource[1])
+ printk(" & %pR", link->resource[1]);
+#endif
printk("\n");
return;
.id_table = daqp_cs_id_table,
.owner = THIS_MODULE,
.drv = {
- .name = dev_info,
+ .name = devname,
},
};
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
+COMEDI_CHECK_CS_IO_REQ_T([$LINUX_SRC_DIR],
+ [HAVE_CS_IO_REQ_T="yes"], [HAVE_CS_IO_REQ_T="no"])
+if test "$HAVE_CS_IO_REQ_T" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_CS_IO_REQ_T],[true],[Define if Linux kernel source has io_req_t in pcmcia/cs.h (removed in 2.6.36)])
+fi
+
+COMEDI_CHECK_CS_MEMREQ_T([$LINUX_SRC_DIR],
+ [HAVE_CS_MEMREQ_T="yes"], [HAVE_CS_MEMREQ_T="no"])
+if test "$HAVE_CS_MEMREQ_T" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_CS_MEMREQ_T],[true],[Define if Linux kernel source has memreq_t in pcmcia/cs.h (removed in 2.6.36)])
+fi
+
+COMEDI_CHECK_HAVE_CS_TYPES_H([$LINUX_SRC_DIR],
+ [HAVE_CS_TYPES_H="yes"], [HAVE_CS_TYPES_H="no"])
+if test "$HAVE_CS_TYPES_H" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_CS_TYPES_H],[true],[Define if Linux kernel source has pcmcia/cs_types.h (removed in 2.6.36)])
+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_CS_IO_REQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the io_req_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_IO_REQ_T],
+[
+ AC_MSG_CHECKING([$1 for io_req_t in pcmcia/cs.h (removed in 2.6.36)])
+ if [grep -q io_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_CS_MEMREQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the memreq_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_MEMREQ_T],
+[
+ AC_MSG_CHECKING([$1 for memreq_t in pcmcia/cs.h (removed in 2.6.36)])
+ if [grep -q memreq_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_CS_TYPES_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel has <pcmcia/cs_types.h> file.
+AC_DEFUN([COMEDI_CHECK_HAVE_CS_TYPES_H],
+[
+ AC_MSG_CHECKING([$1 for include/pcmcia/cs_types.h (removed in 2.6.36)])
+ if test -f "$1/include/pcmcia/cs_types.h"; 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])
# -------------------------------------------------------------
#