PCMCIA support broke again with 2.6.36(-rc) kernel, so add more uqly hacks.
authorIan Abbott <abbotti@mev.co.uk>
Fri, 8 Oct 2010 14:32:24 +0000 (14:32 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Fri, 8 Oct 2010 14:32:24 +0000 (14:32 +0000)
comedi/drivers/cb_das16_cs.c
comedi/drivers/das08_cs.c
comedi/drivers/ni_daq_700.c
comedi/drivers/ni_daq_dio24.c
comedi/drivers/ni_labpc_cs.c
comedi/drivers/ni_mio_cs.c
comedi/drivers/quatech_daqp_cs.c
configure.ac
m4/as-linux.m4

index bd27585f6423109e7b9a3fca33a2a75b95a9bca8..e75616d62fa7b11c39010ee615dd5dfed48df3b5 100644 (file)
@@ -35,7 +35,9 @@ Status: experimental
 #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>
@@ -184,7 +186,11 @@ static int das16cs_attach(comedi_device * dev, comedi_devconfig * it)
        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");
@@ -694,12 +700,16 @@ static void das16cs_pcmcia_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 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;
@@ -790,6 +800,7 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
        }
 
        /* 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;
@@ -809,6 +820,25 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
                /* 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;
 }
@@ -902,6 +932,7 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
                }
 
                /* 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;
@@ -922,6 +953,26 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
                        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;
@@ -988,12 +1039,19 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
 #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;
@@ -1047,7 +1105,7 @@ struct pcmcia_driver das16cs_driver = {
        .id_table = das16cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index 9f8110b7ba92d7a1e55bff73d503f00fb8239aa1..66d2d5aec325a177c484acd8719913f7da0e752c 100644 (file)
@@ -48,7 +48,9 @@ Command support does not exist, but could be added for this board.
 #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>
@@ -87,7 +89,11 @@ static int das08_cs_attach(comedi_device * dev, comedi_devconfig * it)
                        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;
@@ -150,12 +156,16 @@ static void das08_pcmcia_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 = "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;
@@ -272,6 +282,7 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
        }
 
        /* 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;
@@ -291,6 +302,25 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
                /* 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
@@ -383,6 +413,7 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
                }
 
                /* 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;
@@ -403,6 +434,26 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
                        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;
@@ -464,12 +515,19 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
                        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;
@@ -542,7 +600,7 @@ struct pcmcia_driver das08_cs_driver = {
        .id_table = das08_cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index 9e2d9fcccf7ad92631f6705565ba2b65096a48e9..07b7420bf3b7126498c7839cb7b2d6b424e5cc1d 100644 (file)
@@ -46,7 +46,9 @@ IRQ is assigned but not used.
 #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>
@@ -370,7 +372,11 @@ static int dio700_attach(comedi_device * dev, comedi_devconfig * it)
                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;
@@ -475,12 +481,16 @@ static void dio700_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 = "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;
@@ -590,7 +600,9 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
                                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;
@@ -610,6 +622,7 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
        }
 
        /* 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;
@@ -630,6 +643,26 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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 =
@@ -643,9 +676,17 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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! */
@@ -665,7 +706,9 @@ static void dio700_config(struct pcmcia_device *link)
        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
 
@@ -749,6 +792,7 @@ static void dio700_config(struct pcmcia_device *link)
                }
 
                /* 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;
@@ -769,6 +813,26 @@ static void dio700_config(struct pcmcia_device *link)
                        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 =
@@ -782,9 +846,17 @@ static void dio700_config(struct pcmcia_device *link)
                        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! */
@@ -854,12 +926,19 @@ static void dio700_config(struct pcmcia_device *link)
                        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);
@@ -931,7 +1010,7 @@ struct pcmcia_driver dio700_cs_driver = {
        .id_table = dio700_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index ca7b37bcb48d445a54864f17ebb76f7de67d1014..d8a53922747805f9c653fbae70fbea1b71e6adda 100644 (file)
@@ -47,7 +47,9 @@ the PCMCIA interface.
 
 #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>
@@ -127,7 +129,11 @@ static int dio24_attach(comedi_device * dev, comedi_devconfig * it)
                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;
@@ -232,12 +238,16 @@ static void dio24_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 = "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;
@@ -347,7 +357,9 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
                                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;
@@ -367,6 +379,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
        }
 
        /* 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;
@@ -387,6 +400,26 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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 =
@@ -400,9 +433,17 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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! */
@@ -422,7 +463,9 @@ static void dio24_config(struct pcmcia_device *link)
        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
 
@@ -506,6 +549,7 @@ static void dio24_config(struct pcmcia_device *link)
                }
 
                /* 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;
@@ -526,6 +570,26 @@ static void dio24_config(struct pcmcia_device *link)
                        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 =
@@ -539,9 +603,17 @@ static void dio24_config(struct pcmcia_device *link)
                        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! */
@@ -611,12 +683,19 @@ static void dio24_config(struct pcmcia_device *link)
                        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);
@@ -687,7 +766,7 @@ struct pcmcia_driver dio24_cs_driver = {
        .id_table = dio24_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index 1740e3e2a5c8dd5d0ad937ce61e8c8fd58aa7de6..ddb4954bdd1034b4d83bac5ddb07e4159740789b 100644 (file)
@@ -72,7 +72,9 @@ NI manuals:
 #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>
@@ -143,7 +145,11 @@ static int labpc_attach(comedi_device * dev, comedi_devconfig * it)
                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
@@ -211,12 +217,16 @@ static void labpc_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 = "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;
@@ -327,7 +337,9 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
                                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;
@@ -347,6 +359,7 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
 #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;
@@ -367,6 +380,26 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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 =
@@ -380,9 +413,17 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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! */
@@ -402,7 +443,9 @@ static void labpc_config(struct pcmcia_device *link)
        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
 
@@ -484,6 +527,7 @@ static void labpc_config(struct pcmcia_device *link)
 #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;
@@ -500,6 +544,26 @@ static void labpc_config(struct pcmcia_device *link)
                        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 =
@@ -514,9 +578,17 @@ static void labpc_config(struct pcmcia_device *link)
                        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! */
@@ -586,12 +658,19 @@ static void labpc_config(struct pcmcia_device *link)
                        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);
@@ -661,7 +740,7 @@ struct pcmcia_driver labpc_cs_driver = {
        .id_table = labpc_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index e1c567a373677d39abf598b532e148bb8a95203a..78d2e3e351103f761ed5d9b5ed2453d022afddef 100644 (file)
@@ -49,7 +49,9 @@ See the notes in the ni_atmio.o driver.
 #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>
@@ -259,7 +261,11 @@ static void cs_release(struct pcmcia_device *link);
 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",
@@ -269,8 +275,13 @@ static dev_node_t dev_node = {
 #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
@@ -326,13 +337,23 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev,
 {
        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;
        }
@@ -411,25 +432,38 @@ static void mio_cs_config(struct pcmcia_device *link)
        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) {
@@ -466,7 +500,11 @@ static int mio_cs_attach(comedi_device * dev, comedi_devconfig * it)
                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;
@@ -588,7 +626,7 @@ struct pcmcia_driver ni_mio_cs_driver = {
        .id_table = ni_mio_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index 2d92ce9c4d8018aeb56cbe942726fe8d2600ad4d..d9ed1b8fdd662a74959205ac1e2ecdaccfe108d8 100644 (file)
@@ -51,7 +51,9 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308
 
 #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>
@@ -934,7 +936,11 @@ static int daqp_attach(comedi_device * dev, comedi_devconfig * it)
        }
 #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;
@@ -1058,12 +1064,16 @@ static int daqp_cs_attach(struct pcmcia_device *);
 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
 
 /*======================================================================
 
@@ -1185,6 +1195,7 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
                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)) {
@@ -1206,6 +1217,27 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
 
        /* 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
 
@@ -1294,6 +1326,7 @@ static void daqp_cs_config(struct pcmcia_device *link)
                        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)) {
@@ -1316,6 +1349,28 @@ static void daqp_cs_config(struct pcmcia_device *link)
                /* 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;
@@ -1390,12 +1445,19 @@ static void daqp_cs_config(struct pcmcia_device *link)
                        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;
@@ -1464,7 +1526,7 @@ struct pcmcia_driver daqp_cs_driver = {
        .id_table = daqp_cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
-                       .name = dev_info,
+                       .name = devname,
                },
 };
 
index 0a8f934bd5c30caec3fbe7d509456cbe3ac462ee..2b518888fcf51fa8460e36fff6a58aea2eb37189 100644 (file)
@@ -128,6 +128,24 @@ 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
 
+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],
index 4e4f8ccf9b6e3bff120ab98079e3418a8800ce40..fb8a68ee009948495b243a02291cd518863479df 100644 (file)
@@ -837,6 +837,56 @@ AC_DEFUN([COMEDI_CHECK_CS_IRQ_REQ_T],
        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])
 # -------------------------------------------------------------
 #