pcmcia: do not use io_req_t when calling pcmcia_request_io()
authorDominik Brodowski <linux@dominikbrodowski.net>
Sat, 24 Jul 2010 15:23:51 +0000 (17:23 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Tue, 3 Aug 2010 07:04:11 +0000 (09:04 +0200)
Instead of io_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
ranges. After a call to pcmcia_request_io(), the ports found there
are reserved, after calling pcmcia_request_configuration(), they may
be used.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Michael Buesch <mb@bu3sch.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
57 files changed:
Documentation/pcmcia/driver-changes.txt
drivers/ata/pata_pcmcia.c
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/dtl1_cs.c
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/pcmcia/ipwireless/main.c
drivers/char/pcmcia/synclink_cs.c
drivers/ide/ide-cs.c
drivers/isdn/hardware/avm/avm_cs.c
drivers/isdn/hisax/avma1_cs.c
drivers/isdn/hisax/elsa_cs.c
drivers/isdn/hisax/sedlbauer_cs.c
drivers/isdn/hisax/teles_cs.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/com20020_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/ibmtr_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/airo_cs.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/b43/pcmcia.c
drivers/net/wireless/hostap/hostap_cs.c
drivers/net/wireless/libertas/if_cs.c
drivers/net/wireless/orinoco/orinoco_cs.c
drivers/net/wireless/orinoco/spectrum_cs.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/wl3501_cs.c
drivers/parport/parport_cs.c
drivers/pcmcia/pcmcia_resource.c
drivers/scsi/pcmcia/aha152x_stub.c
drivers/scsi/pcmcia/fdomain_stub.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/qlogic_stub.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/serial/serial_cs.c
drivers/staging/comedi/drivers/cb_das16_cs.c
drivers/staging/comedi/drivers/das08_cs.c
drivers/staging/comedi/drivers/ni_daq_700.c
drivers/staging/comedi/drivers/ni_daq_dio24.c
drivers/staging/comedi/drivers/ni_labpc_cs.c
drivers/staging/comedi/drivers/ni_mio_cs.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c
drivers/staging/wlags49_h2/wl_cs.c
drivers/telephony/ixj_pcmcia.c
drivers/usb/host/sl811_cs.c
include/pcmcia/cs.h
include/pcmcia/ds.h
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vxpocket.c

index ff5f0be2470a429051bcb15ba34a77f6f2579409..26c0f9c00545300aeef860eba18422ba79bd2e75 100644 (file)
@@ -1,4 +1,11 @@
 This file details changes in 2.6 which affect PCMCIA card driver authors:
+* pcmcia_request_io changes (as of 2.6.36)
+   Instead of io_req_t, drivers are now requested to fill out
+   struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
+   ranges. After a call to pcmcia_request_io(), the ports found there
+   are reserved, after calling pcmcia_request_configuration(), they may
+   be used.
+
 * No dev_info_t, no cs_types.h (as of 2.6.36)
    dev_info_t and a few other typedefs are removed. No longer use them
    in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
index 1fcd0659b3f29b0e67aee78c531c640e8a68ece5..e944aa0c5517caaed7fc3cb8f10639245e8a3e3f 100644 (file)
@@ -200,21 +200,23 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
 
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               pdev->io.BasePort1 = io->win[0].base;
-               pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+               pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               pdev->resource[0]->start = io->win[0].base;
+               if (!(io->flags & CISTPL_IO_16BIT)) {
+                       pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+                       pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+               }
                if (io->nwin == 2) {
-                       pdev->io.NumPorts1 = 8;
-                       pdev->io.BasePort2 = io->win[1].base;
-                       pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1;
-                       if (pcmcia_request_io(pdev, &pdev->io) != 0)
+                       pdev->resource[0]->end = 8;
+                       pdev->resource[1]->start = io->win[1].base;
+                       pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
+                       if (pcmcia_request_io(pdev) != 0)
                                return -ENODEV;
                        stk->ctl_base = pdev->resource[1]->start;
                } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
-                       pdev->io.NumPorts1 = io->win[0].len;
-                       pdev->io.NumPorts2 = 0;
-                       if (pcmcia_request_io(pdev, &pdev->io) != 0)
+                       pdev->resource[0]->end = io->win[0].len;
+                       pdev->resource[1]->end = 0;
+                       if (pcmcia_request_io(pdev) != 0)
                                return -ENODEV;
                        stk->ctl_base = pdev->resource[0]->start + 0x0e;
                } else
@@ -245,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
        struct ata_port_operations *ops = &pcmcia_port_ops;
 
        /* Set up attributes in order to probe card and get resources */
-       pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-       pdev->io.IOAddrLines = 3;
+       pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
        pdev->conf.Attributes = CONF_ENABLE_IRQ;
        pdev->conf.IntType = INT_MEMORY_AND_IO;
 
index 24d2007139e893b75d830fa704c246bf36233444..d52e90a5a61750494a6c740e4dd4565fb00f788e 100644 (file)
@@ -865,9 +865,6 @@ static int bluecard_probe(struct pcmcia_device *link)
        info->p_dev = link;
        link->priv = info;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
-
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -890,12 +887,14 @@ static int bluecard_config(struct pcmcia_device *link)
        int i, n;
 
        link->conf.ConfigIndex = 0x20;
-       link->io.NumPorts1 = 64;
-       link->io.IOAddrLines = 6;
+
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 64;
+       link->io_lines = 6;
 
        for (n = 0; n < 0x400; n += 0x40) {
-               link->io.BasePort1 = n ^ 0x300;
-               i = pcmcia_request_io(link, &link->io);
+               link->resource[0]->start = n ^ 0x300;
+               i = pcmcia_request_io(link);
                if (i == 0)
                        break;
        }
index 8ab494c0c17ff8f783867d23941e3884b7c1eac6..7ab8f29d5e0dcb8df750bab81fc0bcce4494b12e 100644 (file)
@@ -657,8 +657,8 @@ static int bt3c_probe(struct pcmcia_device *link)
        info->p_dev = link;
        link->priv = info;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 8;
 
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -683,14 +683,14 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
 {
        unsigned long try = (unsigned long) priv_data;
 
+       p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+
        if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
                p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
        if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
            (cf->io.win[0].base != 0)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.IOAddrLines = (try == 0) ? 16 :
-                       cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -ENODEV;
@@ -707,9 +707,9 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
 
        if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
                for (j = 0; j < 5; j++) {
-                       p_dev->io.BasePort1 = base[j];
-                       p_dev->io.IOAddrLines = base[j] ? 16 : 3;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[0]->start = base[j];
+                       p_dev->io_lines = base[j] ? 16 : 3;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
index 7e770d40368dc0905aafd02d80295649023ac59a..1c4f5e863b032d21d8a765a4d3b97c1ca1bb73e4 100644 (file)
@@ -586,8 +586,8 @@ static int btuart_probe(struct pcmcia_device *link)
        info->p_dev = link;
        link->priv = info;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 8;
 
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -612,14 +612,14 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
 {
        int *try = priv_data;
 
+       p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+
        if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
                p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
        if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
            (cf->io.win[0].base != 0)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.IOAddrLines = (*try == 0) ? 16 :
-                       cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -ENODEV;
@@ -636,9 +636,9 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
 
        if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
                for (j = 0; j < 5; j++) {
-                       p_dev->io.BasePort1 = base[j];
-                       p_dev->io.IOAddrLines = base[j] ? 16 : 3;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[0]->start = base[j];
+                       p_dev->io_lines = base[j] ? 16 : 3;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
index bfe9313516fb2de71dfdd4b1afa39636e72408ce..18ecc5734e9f6276c2d250764e5b25091a8c1ebd 100644 (file)
@@ -572,8 +572,8 @@ static int dtl1_probe(struct pcmcia_device *link)
        info->p_dev = link;
        link->priv = info;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 8;
 
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -597,14 +597,13 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev,
                          unsigned int vcc,
                          void *priv_data)
 {
-       if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.NumPorts1 = cf->io.win[0].len;        /*yo */
-               p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
-                       return 0;
-       }
-       return -ENODEV;
+       if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
+               return -ENODEV;
+
+       p_dev->resource[0]->start = cf->io.win[0].base;
+       p_dev->resource[0]->end = cf->io.win[0].len;    /*yo */
+       p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
+       return pcmcia_request_io(p_dev);
 }
 
 static int dtl1_config(struct pcmcia_device *link)
@@ -613,7 +612,7 @@ static int dtl1_config(struct pcmcia_device *link)
        int i;
 
        /* Look for a generic full-sized window */
-       link->io.NumPorts1 = 8;
+       link->resource[0]->end = 8;
        if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
                goto failed;
 
index 18484edc125985e88a26653f8935cf1b5370f200..ec73d9f6d9ed92c9fa527718ff44871bd7d64669 100644 (file)
@@ -1751,17 +1751,12 @@ static int cm4000_config_check(struct pcmcia_device *p_dev,
        if (!cfg->io.nwin)
                return -ENODEV;
 
-       /* Get the IOaddr */
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       if (!(cfg->io.flags & CISTPL_IO_8BIT))
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-       if (!(cfg->io.flags & CISTPL_IO_16BIT))
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
-
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
+       p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
+       p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
+
+       return pcmcia_request_io(p_dev);
 }
 
 static int cm4000_config(struct pcmcia_device * link, int devno)
index a6bbf199dde9c4d4c210e822592acd6510f21ed2..815cde1d0570e86d4ba0e8970ef60248997a3302 100644 (file)
@@ -527,16 +527,12 @@ static int cm4040_config_check(struct pcmcia_device *p_dev,
                return -ENODEV;
 
        /* Get the IOaddr */
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       if (!(cfg->io.flags & CISTPL_IO_8BIT))
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-       if (!(cfg->io.flags & CISTPL_IO_16BIT))
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
-
-       rc = pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
+       p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
+       p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
+       rc = pcmcia_request_io(p_dev);
+
        dev_printk(KERN_INFO, &p_dev->dev,
                   "pcmcia_request_io returned 0x%x\n", rc);
        return rc;
@@ -548,10 +544,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
        struct reader_dev *dev;
        int fail_rc;
 
-       link->io.BasePort2 = 0;
-       link->io.NumPorts2 = 0;
-       link->io.Attributes2 = 0;
-
        if (pcmcia_loop_config(link, cm4040_config_check, NULL))
                goto cs_release;
 
index 9467994d556f75d8f45ab142f474387f2869d850..5f87b9f7b6d256b555bfc7026503de9d543f3ec8 100644 (file)
@@ -88,15 +88,15 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
        memreq_t memreq_common_memory;
        int ret;
 
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
-       p_dev->io.IOAddrLines = 16;
+       p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
 
        /* 0x40 causes it to generate level mode interrupts. */
        /* 0x04 enables IREQ pin. */
        p_dev->conf.ConfigIndex = cfg->index | 0x44;
-       ret = pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->io_lines = 16;
+       ret = pcmcia_request_io(p_dev);
        if (ret)
                return ret;
 
index 8ded9b02b9b904dd0d61b78dc766b28b027c08cd..9ecd6bef5d3b5457ec5bcc6566db7621c1d791f3 100644 (file)
@@ -571,18 +571,15 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
                          unsigned int vcc,
                          void *priv_data)
 {
-       if (cfg->io.nwin > 0) {
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(cfg->io.flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(cfg->io.flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = cfg->io.win[0].base;
-               p_dev->io.NumPorts1 = cfg->io.win[0].len;
-               return pcmcia_request_io(p_dev, &p_dev->io);
-       }
-       return -ENODEV;
+       if (!cfg->io.nwin)
+               return -ENODEV;
+
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
+       p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
+       p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
+
+       return pcmcia_request_io(p_dev);
 }
 
 static int mgslpc_config(struct pcmcia_device *link)
index 6be0e5f108b57f7f11c44beaa48f26e87488cbe0..2a4cb9c18f01706ce7a3c6b17126882321185612 100644 (file)
@@ -97,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link)
     info->p_dev = link;
     link->priv = info;
 
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-    link->io.IOAddrLines = 3;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+    link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -228,22 +227,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
 
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
+               pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+
                pdev->conf.ConfigIndex = cfg->index;
-               pdev->io.BasePort1 = io->win[0].base;
-               pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+               pdev->resource[0]->start = io->win[0].base;
+               if (!(io->flags & CISTPL_IO_16BIT)) {
+                       pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+                       pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+               }
                if (io->nwin == 2) {
-                       pdev->io.NumPorts1 = 8;
-                       pdev->io.BasePort2 = io->win[1].base;
-                       pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1;
-                       if (pcmcia_request_io(pdev, &pdev->io) != 0)
+                       pdev->resource[0]->end = 8;
+                       pdev->resource[1]->start = io->win[1].base;
+                       pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
+                       if (pcmcia_request_io(pdev) != 0)
                                return -ENODEV;
                        stk->ctl_base = pdev->resource[1]->start;
                } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
-                       pdev->io.NumPorts1 = io->win[0].len;
-                       pdev->io.NumPorts2 = 0;
-                       if (pcmcia_request_io(pdev, &pdev->io) != 0)
+                       pdev->resource[0]->end = io->win[0].len;
+                       pdev->resource[1]->end = 0;
+                       if (pcmcia_request_io(pdev) != 0)
                                return -ENODEV;
                        stk->ctl_base = pdev->resource[0]->start + 0x0e;
                } else
index 7c8c51f2200385cc2592fbc8eb63092ea0fb6088..09b1795516f4e95c4e49f0ce6e1e91c9eefa5bd1 100644 (file)
@@ -75,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
 {
 
     /* The io structure describes IO port mapping */
-    p_dev->io.NumPorts1 = 16;
-    p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    p_dev->io.NumPorts2 = 0;
+    p_dev->resource[0]->end = 16;
+    p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
 
     /* General socket configuration */
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -119,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
        if (cf->io.nwin <= 0)
                return -ENODEV;
 
-       p_dev->io.BasePort1 = cf->io.win[0].base;
-       p_dev->io.NumPorts1 = cf->io.win[0].len;
-       p_dev->io.NumPorts2 = 0;
-       printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
-              p_dev->io.BasePort1,
-              p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->resource[0]->start = cf->io.win[0].base;
+       p_dev->resource[0]->end = cf->io.win[0].len;
+       return pcmcia_request_io(p_dev);
 }
 
 static int avmcs_config(struct pcmcia_device *link)
index 88899638f8358cd25c2e0f3391691e375e7073db..94263c22b8746965109cc6b1654a8a30df2355fd 100644 (file)
@@ -78,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
     dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
 
     /* The io structure describes IO port mapping */
-    p_dev->io.NumPorts1 = 16;
-    p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    p_dev->io.NumPorts2 = 16;
-    p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
-    p_dev->io.IOAddrLines = 5;
+    p_dev->resource[0]->end = 16;
+    p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+    p_dev->resource[1]->end = 16;
+    p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
 
     /* General socket configuration */
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -126,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
        if (cf->io.nwin <= 0)
                return -ENODEV;
 
-       p_dev->io.BasePort1 = cf->io.win[0].base;
-       p_dev->io.NumPorts1 = cf->io.win[0].len;
-       p_dev->io.NumPorts2 = 0;
-       printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n",
-              p_dev->io.BasePort1,
-              p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->resource[0]->start = cf->io.win[0].base;
+       p_dev->resource[0]->end = cf->io.win[0].len;
+       p_dev->io_lines = 5;
+       return pcmcia_request_io(p_dev);
 }
 
 
index c10bfd3f4588855915f2ca8e6d5a439d5083230c..b3c08aaf41c410e57c91aaa82fefddc4af6212a8 100644 (file)
@@ -126,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
       and attributes of IO windows) are fixed by the nature of the
       device, and can be hard-wired here.
     */
-    link->io.NumPorts1 = 8;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 3;
+    link->resource[0]->end = 8;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
 
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -173,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
 {
        int j;
 
+       p_dev->io_lines = 3;
+
        if ((cf->io.nwin > 0) && cf->io.win[0].base) {
                printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        } else {
                printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
                for (j = 0x2f0; j > 0x100; j -= 0x10) {
-                       p_dev->io.BasePort1 = j;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[0]->start = j;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
index cecb35ab9d3d5afe5d651f78d87521a62c54eab7..4755eb440f7ef6d292479773e27e71ffc3540ecb 100644 (file)
@@ -129,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
     /* from old sedl_cs 
     */
     /* The io structure describes IO port mapping */
-    link->io.NumPorts1 = 8;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    link->io.IOAddrLines = 3;
+    link->resource[0]->end = 8;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
 
     link->conf.Attributes = 0;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -201,23 +200,22 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                                       pcmcia_io_cfg_data_width(io->flags);
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               p_dev->io_lines = 3;
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
 
index 3787fc70cf8fd7f551b1c9f8328d82d2d48c6730..7296102ca255d89ef34bee0a1736d695629214d2 100644 (file)
@@ -106,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)
       and attributes of IO windows) are fixed by the nature of the
       device, and can be hard-wired here.
     */
-    link->io.NumPorts1 = 96;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 5;
+    link->resource[0]->end = 96;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
 
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -153,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
 {
        int j;
 
+       p_dev->io_lines = 5;
+
        if ((cf->io.nwin > 0) && cf->io.win[0].base) {
                printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        } else {
                printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");
                for (j = 0x2f0; j > 0x100; j -= 0x10) {
-                       p_dev->io.BasePort1 = j;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[0]->start = j;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
index b5ea9b8cfd76e547fc40244ddaf96cd6fa766777..c683f77c6f424ebbc873d76f0e07cb386484ea70 100644 (file)
@@ -278,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link)
        lp->p_dev = link;
 
        spin_lock_init(&lp->window_lock);
-       link->io.NumPorts1 = 32;
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
+       link->resource[0]->end = 32;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
        link->conf.ConfigIndex = 1;
@@ -337,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link)
 
        dev_dbg(&link->dev, "3c574_config()\n");
 
-       link->io.IOAddrLines = 16;
+       link->io_lines = 16;
+
        for (i = j = 0; j < 0x400; j += 0x20) {
-               link->io.BasePort1 = j ^ 0x300;
-               i = pcmcia_request_io(link, &link->io);
+               link->resource[0]->start = j ^ 0x300;
+               i = pcmcia_request_io(link);
                if (i == 0)
                        break;
        }
index 122ef4a9488c85550ceb4b48d6a439a81f08861e..61f9cf2100ffd8bfdff824ccfa2c3f3013a8eb1f 100644 (file)
@@ -213,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link)
     lp->p_dev = link;
 
     spin_lock_init(&lp->lock);
-    link->io.NumPorts1 = 16;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
+    link->resource[0]->end = 16;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
 
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -277,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link)
                   "3Com card??\n");
     multi = (link->card_id == PRODID_3COM_3C562);
 
+    link->io_lines = 16;
+
     /* For the 3c562, the base address must be xx00-xx7f */
-    link->io.IOAddrLines = 16;
     for (i = j = 0; j < 0x400; j += 0x10) {
        if (multi && (j & 0x80)) continue;
-       link->io.BasePort1 = j ^ 0x300;
-       i = pcmcia_request_io(link, &link->io);
+       link->resource[0]->start = j ^ 0x300;
+       i = pcmcia_request_io(link);
        if (i == 0)
                break;
     }
index c52fdf31cbfe971eae992211ebfed1b85909171d..5f05ffb240cc899eb79537ffe8074ceb97d3da11 100644 (file)
@@ -259,28 +259,30 @@ static int get_prom(struct pcmcia_device *link)
 static int try_io_port(struct pcmcia_device *link)
 {
     int j, ret;
-    if (link->io.NumPorts1 == 32) {
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+    link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+    link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
+    if (link->resource[0]->end == 32) {
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
        /* for master/slave multifunction cards */
-       if (link->io.NumPorts2 > 0)
-           link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
+       if (link->resource[1]->end > 0)
+           link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
     } else {
        /* This should be two 16-port windows */
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
     }
-    if (link->io.BasePort1 == 0) {
-       link->io.IOAddrLines = 16;
+    if (link->resource[0]->start == 0) {
        for (j = 0; j < 0x400; j += 0x20) {
-           link->io.BasePort1 = j ^ 0x300;
-           link->io.BasePort2 = (j ^ 0x300) + 0x10;
-           ret = pcmcia_request_io(link, &link->io);
+           link->resource[0]->start = j ^ 0x300;
+           link->resource[1]->start = (j ^ 0x300) + 0x10;
+           link->io_lines = 16;
+           ret = pcmcia_request_io(link);
            if (ret == 0)
                    return ret;
        }
        return ret;
     } else {
-       return pcmcia_request_io(link, &link->io);
+       return pcmcia_request_io(link);
     }
 }
 
@@ -301,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
           network function with window 0, and serial with window 1 */
        if (io->nwin > 1) {
                i = (io->win[1].len > io->win[0].len);
-               p_dev->io.BasePort2 = io->win[1-i].base;
-               p_dev->io.NumPorts2 = io->win[1-i].len;
+               p_dev->resource[1]->start = io->win[1-i].base;
+               p_dev->resource[1]->end = io->win[1-i].len;
        } else {
-               i = p_dev->io.NumPorts2 = 0;
+               i = p_dev->resource[1]->end = 0;
        }
-       p_dev->io.BasePort1 = io->win[i].base;
-       p_dev->io.NumPorts1 = io->win[i].len;
-       p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-       if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32)
+       p_dev->resource[0]->start = io->win[i].base;
+       p_dev->resource[0]->end = io->win[i].len;
+       p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+       if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
                return try_io_port(p_dev);
 
        return -ENODEV;
index 3b53818e3eef02d7e53aac7411eaafaf6bc8559f..3c400cfa82ae2e88c0e67c3f0582f75491be925e 100644 (file)
@@ -158,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev)
     /* fill in our module parameters as defaults */
     dev->dev_addr[0] = node;
 
-    p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    p_dev->io.NumPorts1 = 16;
-    p_dev->io.IOAddrLines = 16;
+    p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+    p_dev->resource[0]->end = 16;
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
     p_dev->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -245,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "com20020_config\n");
 
-    dev_dbg(&link->dev, "baseport1 is %Xh\n", link->io.BasePort1);
+    dev_dbg(&link->dev, "baseport1 is %Xh\n",
+           (unsigned int) link->resource[0]->start);
+
     i = -ENODEV;
-    if (!link->io.BasePort1)
+    link->io_lines = 16;
+
+    if (!link->resource[0]->start)
     {
        for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
        {
-           link->io.BasePort1 = ioaddr;
-           i = pcmcia_request_io(link, &link->io);
+           link->resource[0]->start = ioaddr;
+           i = pcmcia_request_io(link);
            if (i == 0)
                break;
        }
     }
     else
-       i = pcmcia_request_io(link, &link->io);
+       i = pcmcia_request_io(link);
     
     if (i != 0)
     {
index bba6369a028e1ec9856f440eea2c64b8b6649d43..699304480aeda0d2e29f3bccd7947b24acc9fcb8 100644 (file)
@@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
     lp->base = NULL;
 
     /* The io structure describes IO port mapping */
-    link->io.NumPorts1 = 32;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 5;
+    link->resource[0]->end = 32;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
 
     /* General socket configuration */
     link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link)
        { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
 
     for (i = 0; i < 5; i++) {
-       link->io.BasePort2 = serial_base[i];
-       link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-       if (link->io.BasePort2 == 0) {
-           link->io.NumPorts2 = 0;
+       link->resource[1]->start = serial_base[i];
+       link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
+       if (link->resource[1]->start == 0) {
+           link->resource[1]->end = 0;
            printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
        }
-       ret = pcmcia_request_io(link, &link->io);
+       ret = pcmcia_request_io(link);
        if (ret == 0)
                return ret;
     }
@@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
        0x380,0x3c0 only for ioport.
     */
     for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
-       link->io.BasePort1 = ioaddr;
-       ret = pcmcia_request_io(link, &link->io);
+       link->resource[0]->start = ioaddr;
+       ret = pcmcia_request_io(link);
        if (ret == 0) {
            /* calculate ConfigIndex value */
            link->conf.ConfigIndex = 
@@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "fmvj18x_config\n");
 
+    link->io_lines = 5;
+
     len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
     kfree(buf);
 
@@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)
                /* MultiFunction Card */
                link->conf.ConfigBase = 0x800;
                link->conf.ConfigIndex = 0x47;
-               link->io.NumPorts2 = 8;
+               link->resource[1]->end = 8;
            }
            break;
        case MANFID_NEC:
            cardtype = NEC; /* MultiFunction Card */
            link->conf.ConfigBase = 0x800;
            link->conf.ConfigIndex = 0x47;
-           link->io.NumPorts2 = 8;
+           link->resource[1]->end = 8;
            break;
        case MANFID_KME:
            cardtype = KME; /* MultiFunction Card */
            link->conf.ConfigBase = 0x800;
            link->conf.ConfigIndex = 0x47;
-           link->io.NumPorts2 = 8;
+           link->resource[1]->end = 8;
            break;
        case MANFID_CONTEC:
            cardtype = CONTEC;
@@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
        }
     }
 
-    if (link->io.NumPorts2 != 0) {
+    if (link->resource[1]->end != 0) {
        ret = mfc_try_io_port(link);
        if (ret != 0) goto failed;
     } else if (cardtype == UNGERMANN) {
        ret = ungermann_try_io_port(link);
        if (ret != 0) goto failed;
     } else { 
-           ret = pcmcia_request_io(link, &link->io);
+           ret = pcmcia_request_io(link);
            if (ret)
                    goto failed;
     }
index e99abaa92be539cec139f3a88ebf802e68c598a6..3fd859570db3d16fea84f07b79bdd88260427c95 100644 (file)
@@ -151,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
     link->priv = info;
     info->ti = netdev_priv(dev);
 
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    link->io.NumPorts1 = 4;
-    link->io.IOAddrLines = 16;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+    link->resource[0]->end = 4;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.Present = PRESENT_OPTION;
@@ -218,16 +217,17 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
     dev_dbg(&link->dev, "ibmtr_config\n");
 
     link->conf.ConfigIndex = 0x61;
+    link->io_lines = 16;
 
     /* Determine if this is PRIMARY or ALTERNATE. */
 
     /* Try PRIMARY card at 0xA20-0xA23 */
-    link->io.BasePort1 = 0xA20;
-    i = pcmcia_request_io(link, &link->io);
+    link->resource[0]->start = 0xA20;
+    i = pcmcia_request_io(link);
     if (i != 0) {
        /* Couldn't get 0xA20-0xA23.  Try ALTERNATE at 0xA24-0xA27. */
-       link->io.BasePort1 = 0xA24;
-       ret = pcmcia_request_io(link, &link->io);
+       link->resource[0]->start = 0xA24;
+       ret = pcmcia_request_io(link);
        if (ret)
                goto failed;
     }
index 9980cbb81d34a7cc9d4c1e9196889ea746751cc6..68f2deeb3ade11722dc5333386f4afd56cc98eb3 100644 (file)
@@ -458,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link)
     link->priv = dev;
     
     spin_lock_init(&lp->bank_lock);
-    link->io.NumPorts1 = 32;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 5;
+    link->resource[0]->end = 32;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex = 1;
@@ -644,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link)
 
   dev_dbg(&link->dev, "nmclan_config\n");
 
-  ret = pcmcia_request_io(link, &link->io);
+  link->io_lines = 5;
+  ret = pcmcia_request_io(link);
   if (ret)
          goto failed;
   ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
index c9cd2377ef91f155e080143ee202436fba7bc319..9c5fc9dfc55d9500cb57d3cce462833cb170a145 100644 (file)
@@ -477,29 +477,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
 static int try_io_port(struct pcmcia_device *link)
 {
     int j, ret;
-    if (link->io.NumPorts1 == 32) {
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       if (link->io.NumPorts2 > 0) {
+    link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+    link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
+    if (link->resource[0]->end == 32) {
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       if (link->resource[1]->end > 0) {
            /* for master/slave multifunction cards */
-           link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
+           link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
        }
     } else {
        /* This should be two 16-port windows */
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
     }
-    if (link->io.BasePort1 == 0) {
-       link->io.IOAddrLines = 16;
+    if (link->resource[0]->start == 0) {
        for (j = 0; j < 0x400; j += 0x20) {
-           link->io.BasePort1 = j ^ 0x300;
-           link->io.BasePort2 = (j ^ 0x300) + 0x10;
-           ret = pcmcia_request_io(link, &link->io);
+           link->resource[0]->start = j ^ 0x300;
+           link->resource[1]->start = (j ^ 0x300) + 0x10;
+           link->io_lines = 16;
+           ret = pcmcia_request_io(link);
            if (ret == 0)
                    return ret;
        }
        return ret;
     } else {
-       return pcmcia_request_io(link, &link->io);
+       return pcmcia_request_io(link);
     }
 }
 
@@ -520,18 +522,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
           network function with window 0, and serial with window 1 */
        if (io->nwin > 1) {
                i = (io->win[1].len > io->win[0].len);
-               p_dev->io.BasePort2 = io->win[1-i].base;
-               p_dev->io.NumPorts2 = io->win[1-i].len;
+               p_dev->resource[1]->start = io->win[1-i].base;
+               p_dev->resource[1]->end = io->win[1-i].len;
        } else {
-               i = p_dev->io.NumPorts2 = 0;
+               i = p_dev->resource[1]->end = 0;
        }
 
        *has_shmem = ((cfg->mem.nwin == 1) &&
                      (cfg->mem.win[0].len >= 0x4000));
-       p_dev->io.BasePort1 = io->win[i].base;
-       p_dev->io.NumPorts1 = io->win[i].len;
-       p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-       if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32)
+       p_dev->resource[0]->start = io->win[i].base;
+       p_dev->resource[0]->end = io->win[i].len;
+       p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+       if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
                return try_io_port(p_dev);
 
        return 0;
index 1b0b3230dd717f05ed6ff839840f95705b3ad437..a5e47796f6aeb4e7fdbb79c0f0560c0209849c94 100644 (file)
@@ -324,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
     link->priv = dev;
 
     spin_lock_init(&smc->lock);
-    link->io.NumPorts1 = 16;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 4;
+    link->resource[0]->end = 16;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -427,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev,
                                void *priv_data)
 {
        int k;
-       p_dev->io.BasePort2 = cf->io.win[0].base;
+       p_dev->resource[1]->start = cf->io.win[0].base;
        for (k = 0; k < 0x400; k += 0x10) {
                if (k & 0x80)
                        continue;
-               p_dev->io.BasePort1 = k ^ 0x300;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = k ^ 0x300;
+               p_dev->io_lines = 16;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -ENODEV;
@@ -448,9 +448,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
 
     link->conf.Attributes |= CONF_ENABLE_SPKR;
     link->conf.Status = CCSR_AUDIO_ENA;
-    link->io.IOAddrLines = 16;
-    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-    link->io.NumPorts2 = 8;
+    link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
+    link->resource[1]->end = 8;
 
     /* The Megahertz combo cards have modem-like CIS entries, so
        we have to explicitly try a bunch of port combinations. */
@@ -601,9 +600,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev,
                           unsigned int vcc,
                           void *priv_data)
 {
-       p_dev->io.BasePort1 = cf->io.win[0].base;
-       p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->resource[0]->start = cf->io.win[0].base;
+       p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
+       return pcmcia_request_io(p_dev);
 }
 
 static int smc_config(struct pcmcia_device *link)
@@ -611,7 +610,7 @@ static int smc_config(struct pcmcia_device *link)
     struct net_device *dev = link->priv;
     int i;
 
-    link->io.NumPorts1 = 16;
+    link->resource[0]->end = 16;
     i = pcmcia_loop_config(link, smc_configcheck, NULL);
     if (!i)
            dev->base_addr = link->resource[0]->start;
@@ -646,25 +645,25 @@ static int osi_config(struct pcmcia_device *link)
 
     link->conf.Attributes |= CONF_ENABLE_SPKR;
     link->conf.Status = CCSR_AUDIO_ENA;
-    link->io.NumPorts1 = 64;
-    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-    link->io.NumPorts2 = 8;
-    link->io.IOAddrLines = 16;
+    link->resource[0]->end = 64;
+    link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
+    link->resource[1]->end = 8;
 
     /* Enable Hard Decode, LAN, Modem */
     link->conf.ConfigIndex = 0x23;
+    link->io_lines = 16;
 
     for (i = j = 0; j < 4; j++) {
-       link->io.BasePort2 = com[j];
-       i = pcmcia_request_io(link, &link->io);
+       link->resource[1]->start = com[j];
+       i = pcmcia_request_io(link);
        if (i == 0)
                break;
     }
     if (i != 0) {
        /* Fallback: turn off hard decode */
        link->conf.ConfigIndex = 0x03;
-       link->io.NumPorts2 = 0;
-       i = pcmcia_request_io(link, &link->io);
+       link->resource[1]->end = 0;
+       i = pcmcia_request_io(link);
     }
     dev->base_addr = link->resource[0]->start + 0x10;
     return i;
@@ -803,7 +802,7 @@ static int check_sig(struct pcmcia_device *link)
     }
 
     /* Try setting bus width */
-    width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO);
+    width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO);
     s = inb(ioaddr + CONFIG);
     if (width)
        s |= CFG_16BIT;
index 034920b459d1aabd81b74eb902c98dbb4ef9cfce..8fb0eb1dc3417ec4120367df3a14210211179bb1 100644 (file)
@@ -677,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev,
 
        if (cf->io.nwin > 0  &&  (cf->io.win[0].base & 0xf) == 8) {
                for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
-                       p_dev->io.BasePort2 = cf->io.win[0].base;
-                       p_dev->io.BasePort1 = ioaddr;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[1]->start = cf->io.win[0].base;
+                       p_dev->resource[0]->start = ioaddr;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
@@ -696,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,
        int *pass = priv_data;
 
        if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
-               p_dev->io.BasePort2 = cf->io.win[0].base;
-               p_dev->io.BasePort1 = p_dev->io.BasePort2
+               p_dev->resource[1]->start = cf->io.win[0].base;
+               p_dev->resource[0]->start = p_dev->resource[1]->start
                        + (*pass ? (cf->index & 0x20 ? -24:8)
                           : (cf->index & 0x20 ?   8:-24));
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -ENODEV;
@@ -807,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link)
        goto failure;
     }
 
-    link->io.IOAddrLines =10;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
     if (local->modem) {
        int pass;
 
@@ -816,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link)
            link->conf.Attributes |= CONF_ENABLE_SPKR;
            link->conf.Status |= CCSR_AUDIO_ENA;
        }
-       link->io.NumPorts2 = 8;
-       link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
+       link->resource[1]->end = 8;
+       link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
        if (local->dingo) {
            /* Take the Modem IO port from the CIS and scan for a free
             * Ethernet port */
-           link->io.NumPorts1 = 16; /* no Mako stuff anymore */
+           link->resource[0]->end = 16; /* no Mako stuff anymore */
            if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL))
                    goto port_found;
        } else {
-           link->io.NumPorts1 = 18;
+           link->resource[0]->end = 18;
            /* We do 2 passes here: The first one uses the regular mapping and
             * the second tries again, thereby considering that the 32 ports are
             * mirrored every 32 bytes. Actually we use a mirrored port for
@@ -840,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link)
        }
        printk(KNOT_XIRC "no ports available\n");
     } else {
-       link->io.NumPorts1 = 16;
+       link->io_lines = 10;
+       link->resource[0]->end = 16;
        for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
-           link->io.BasePort1 = ioaddr;
-           if (!(err=pcmcia_request_io(link, &link->io)))
+           link->resource[0]->start = ioaddr;
+           if (!(err = pcmcia_request_io(link)))
                goto port_found;
        }
-       link->io.BasePort1 = 0; /* let CS decide */
-       if ((err=pcmcia_request_io(link, &link->io)))
+       link->resource[0]->start = 0; /* let CS decide */
+       if ((err = pcmcia_request_io(link)))
            goto config_error;
     }
   port_found:
index b7e7f5054e4428d66ec404aba5520af4534930e5..d241b4aed71e706fb1b6da9805283f2808289757 100644 (file)
@@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+       if (pcmcia_request_io(p_dev) != 0)
                return -ENODEV;
 
        /*
index 65b3aed49e58474489804d94cdaa29090aacea06..3b632161c10696ee7ae896db24c11d4886395486 100644 (file)
@@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static int atmel_config(struct pcmcia_device *link)
index f71bc7821378a346e15df5d5278a90c365698f5e..7c9af82fcf7e77dd757b4f67301976a25314e2d3 100644 (file)
@@ -77,10 +77,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
        dev->conf.Attributes = CONF_ENABLE_IRQ;
        dev->conf.IntType = INT_MEMORY_AND_IO;
 
-       dev->io.BasePort2 = 0;
-       dev->io.NumPorts2 = 0;
-       dev->io.Attributes2 = 0;
-
        win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM |
                         WIN_ENABLE | WIN_DATA_WIDTH_16 |
                         WIN_USE_WAIT;
index 4e13cedb82352b4a7bc14b5c58a7dcd6913760ba..ba54d1b04d22a7e50ae244bb2b905c84d44c1986 100644 (file)
@@ -519,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
        PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
               "dflt->io.nwin=%d\n",
               cfg->io.nwin, dflt->io.nwin);
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               PDEBUG(DEBUG_EXTRA, "io->flags = 0x%04X, "
-                      "io.base=0x%04x, len=%d\n", io->flags,
-                      io->win[0].base, io->win[0].len);
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags &
-                       CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static int prism2_config(struct pcmcia_device *link)
index be4c47594b59942b3a01aec0c64757f1350f7198..9c298396be50b7fe5d0d6f8c6b102ecef441b3f7 100644 (file)
@@ -801,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
                         unsigned int vcc,
                         void *priv_data)
 {
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
+       p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
 
        /* Do we need to allocate an interrupt? */
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
@@ -815,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
        }
 
        /* This reserves IO space but doesn't actually enable it */
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static int if_cs_probe(struct pcmcia_device *p_dev)
index 6d514b5462fdcb7e7275059a57de145a1a47c366..ef46a2d885392f49f1803fbb47bb2f6a6b2f7fdc 100644 (file)
@@ -191,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        goto next_entry;
        }
        return 0;
index 4f8f55eab955d68db2d33098591648ca7588e4af..873877e17e1bf6bce4debd49b75f359a8d39b1ec 100644 (file)
@@ -253,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        goto next_entry;
        }
        return 0;
index 165beb6af8496b2522eacaaa775569da14df22a5..b83d5ef1dffeb39cef0dd66c0e2ed169deacf7dd 100644 (file)
@@ -315,9 +315,8 @@ static int ray_probe(struct pcmcia_device *p_dev)
        local->finder = p_dev;
 
        /* The io structure describes IO port mapping. None used here */
-       p_dev->io.NumPorts1 = 0;
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines = 5;
+       p_dev->resource[0]->end = 0;
+       p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
 
        /* General socket configuration */
        p_dev->conf.Attributes = CONF_ENABLE_IRQ;
index a32f220648c03744143b19c1dc3b8c4353b27569..a1cc2d498a1c01bd19b0174d1497d8bd0c0c8a8b 100644 (file)
@@ -1884,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
        struct wl3501_card *this;
 
        /* The io structure describes IO port mapping */
-       p_dev->io.NumPorts1     = 16;
-       p_dev->io.Attributes1   = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines   = 5;
+       p_dev->resource[0]->end = 16;
+       p_dev->resource[0]->flags       = IO_DATA_PATH_WIDTH_8;
 
        /* General socket configuration */
        p_dev->conf.Attributes  = CONF_ENABLE_IRQ;
@@ -1932,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link)
        /* Try allocating IO ports.  This tries a few fixed addresses.  If you
         * want, you can also read the card's config table to pick addresses --
         * see the serial driver for an example. */
+       link->io_lines = 5;
 
        for (j = 0x280; j < 0x400; j += 0x20) {
                /* The '^0x300' is so that we probe 0x300-0x3ff first, then
                 * 0x200-0x2ff, and so on, because this seems safer */
-               link->io.BasePort1 = j;
-               link->io.BasePort2 = link->io.BasePort1 + 0x10;
-               i = pcmcia_request_io(link, &link->io);
+               link->resource[0]->start = j;
+               link->resource[1]->start = link->resource[0]->start + 0x10;
+               i = pcmcia_request_io(link);
                if (i == 0)
                        break;
        }
index fc1639c5ada6c48a5a804e10a91971cb10066343..23e50f4a27c5b8719ac745223b2455d39bea0ad6 100644 (file)
@@ -101,8 +101,8 @@ static int parport_probe(struct pcmcia_device *link)
     link->priv = info;
     info->p_dev = link;
 
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+    link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -143,16 +143,16 @@ static int parport_config_check(struct pcmcia_device *p_dev,
 {
        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;
                if (epp_mode)
                        p_dev->conf.ConfigIndex |= FORCE_EPP_MODE;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin == 2) {
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
-               if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
                return 0;
        }
index fcd48dae79bca281c4fd44f827e5dd0d276b5dce..a48d4a91d440289de4cd603a0050d4baa6b27663 100644 (file)
@@ -70,7 +70,8 @@ static int alloc_io_space(struct pcmcia_socket *s, struct resource *res,
 
        res->flags |= IORESOURCE_IO;
 
-       dev_dbg(&s->dev, "alloc_io_space request for %pR\n", res);
+       dev_dbg(&s->dev, "alloc_io_space request for %pR, %d lines\n",
+               res, lines);
 
        align = base ? (lines ? 1<<lines : 0) : 1;
        if (align && (align < num)) {
@@ -541,38 +542,25 @@ EXPORT_SYMBOL(pcmcia_request_configuration);
  * pcmcia_request_io() - attempt to reserve port ranges for PCMCIA devices
  *
  * pcmcia_request_io() attepts to reserve the IO port ranges specified in
- * struct pcmcia_device *p_dev->resource[0] and *p_dev->resource[1]. The
+ * &struct pcmcia_device @p_dev->resource[0] and @p_dev->resource[1]. The
  * "start" value is the requested start of the IO port resource; "end"
- * relfects the number of ports requested.
- *
- * If io_req_t is passed, those values are converted automatically.
+ * reflects the number of ports requested. The number of IO lines requested
+ * is specified in &struct pcmcia_device @p_dev->io_lines.
  */
-int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
+int pcmcia_request_io(struct pcmcia_device *p_dev)
 {
        struct pcmcia_socket *s = p_dev->socket;
-       config_t *c;
+       config_t *c = p_dev->function_config;
        int ret = -EINVAL;
-       unsigned int lines = req->IOAddrLines;
 
        mutex_lock(&s->ops_mutex);
+       dev_dbg(&s->dev, "pcmcia_request_io: %pR , %pR", &c->io[0], &c->io[1]);
 
        if (!(s->state & SOCKET_PRESENT)) {
                dev_dbg(&s->dev, "pcmcia_request_io: No card present\n");
                goto out;
        }
 
-       c = p_dev->function_config;
-       if (req) {
-               c->io[0].start = req->BasePort1;
-               c->io[0].end = req->NumPorts1;
-               c->io[0].flags |= req->Attributes1;
-               c->io[1].start = req->BasePort2;
-               c->io[1].end = req->NumPorts2;
-               c->io[1].flags |= req->Attributes2;
-       }
-
-       dev_dbg(&s->dev, "pcmcia_request_io: %pR , %pR", &c->io[0], &c->io[1]);
-
        if (c->state & CONFIG_LOCKED) {
                dev_dbg(&s->dev, "Configuration is locked\n");
                goto out;
@@ -582,12 +570,12 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
                goto out;
        }
 
-       ret = alloc_io_space(s, &c->io[0], lines);
+       ret = alloc_io_space(s, &c->io[0], p_dev->io_lines);
        if (ret)
                goto out;
 
        if (c->io[1].end) {
-               ret = alloc_io_space(s, &c->io[1], lines);
+               ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
                if (ret) {
                        release_io_space(s, &c->io[0]);
                        goto out;
@@ -598,11 +586,6 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
        c->state |= CONFIG_IO_REQ;
        p_dev->_io = 1;
 
-       if (!ret) {
-               req->BasePort1 = c->io[0].start;
-               req->BasePort2 = c->io[1].start;
-       }
-
        dev_dbg(&s->dev, "pcmcia_request_io succeeded: %pR , %pR",
                &c->io[0], &c->io[1]);
 out:
index 3e040f503afa0d1132938441b467d1780b7dc87c..61f49bdcc0c2815cc3b28f805c711cc3e4163ff8 100644 (file)
@@ -100,9 +100,8 @@ static int aha152x_probe(struct pcmcia_device *link)
     info->p_dev = link;
     link->priv = info;
 
-    link->io.NumPorts1 = 0x20;
-    link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-    link->io.IOAddrLines = 10;
+    link->resource[0]->end = 0x20;
+    link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.Present = PRESENT_OPTION;
@@ -130,15 +129,16 @@ static int aha152x_config_check(struct pcmcia_device *p_dev,
                                unsigned int vcc,
                                void *priv_data)
 {
+       p_dev->io_lines = 10;
        /* For New Media T&J, look for a SCSI window */
        if (cfg->io.win[0].len >= 0x20)
-               p_dev->io.BasePort1 = cfg->io.win[0].base;
+               p_dev->resource[0]->start = cfg->io.win[0].base;
        else if ((cfg->io.nwin > 1) &&
                 (cfg->io.win[1].len >= 0x20))
-               p_dev->io.BasePort1 = cfg->io.win[1].base;
+               p_dev->resource[0]->start = cfg->io.win[1].base;
        if ((cfg->io.nwin > 0) &&
-           (p_dev->io.BasePort1 < 0xffff)) {
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+           (p_dev->resource[0]->start < 0xffff)) {
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -EINVAL;
index 49a9a0a60c829f1adc5a337b3b0a9fc1ab3a0b80..13dbe5c48492e720c2691e24ad17930d3ee41f36 100644 (file)
@@ -83,9 +83,8 @@ static int fdomain_probe(struct pcmcia_device *link)
 
        info->p_dev = link;
        link->priv = info;
-       link->io.NumPorts1 = 0x10;
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.IOAddrLines = 10;
+       link->resource[0]->end = 0x10;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
        link->conf.Present = PRESENT_OPTION;
@@ -112,8 +111,9 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
                                unsigned int vcc,
                                void *priv_data)
 {
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       p_dev->io_lines = 10;
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       return pcmcia_request_io(p_dev);
 }
 
 
index d929891809ab66b016cac264f99e5b3264124e7e..8bb598bb440d9a4ef2bcaa21456a4e1c76a64409 100644 (file)
@@ -1558,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)
        nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
 
        /* The io structure describes IO port mapping */
-       link->io.NumPorts1       = 0x10;
-       link->io.Attributes1     = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.IOAddrLines     = 10;  /* not used */
+       link->resource[0]->end   = 0x10;
+       link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
 
        /* General socket configuration */
        link->conf.Attributes    = CONF_ENABLE_IRQ;
@@ -1641,24 +1640,23 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
                p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
                /* IO window settings */
-               p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+               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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-                       if (!(io->flags & CISTPL_IO_8BIT))
-                               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-                       if (!(io->flags & CISTPL_IO_16BIT))
-                               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-                       p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-                       p_dev->io.BasePort1 = io->win[0].base;
-                       p_dev->io.NumPorts1 = io->win[0].len;
+                       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->io.Attributes2 = p_dev->io.Attributes1;
-                               p_dev->io.BasePort2 = io->win[1].base;
-                               p_dev->io.NumPorts2 = io->win[1].len;
+                               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, &p_dev->io) != 0)
+                       if (pcmcia_request_io(p_dev) != 0)
                                goto next_entry;
                }
 
index 4e2b83f26232e205cdbe787dcaf7b04dc48631f8..eb775f1a523cef364b0666db7baa01609a9d833d 100644 (file)
@@ -156,9 +156,8 @@ static int qlogic_probe(struct pcmcia_device *link)
                return -ENOMEM;
        info->p_dev = link;
        link->priv = info;
-       link->io.NumPorts1 = 16;
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.IOAddrLines = 10;
+       link->resource[0]->end = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
        link->conf.Present = PRESENT_OPTION;
@@ -185,13 +184,14 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,
                               unsigned int vcc,
                               void *priv_data)
 {
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
+       p_dev->io_lines = 10;
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
 
-       if (p_dev->io.BasePort1 == 0)
+       if (p_dev->resource[0]->start == 0)
                return -ENODEV;
 
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static int qlogic_config(struct pcmcia_device * link)
index d99c0cbad2dee106e9104d283132031259fd063e..321e390c9120631f07b81434e2dfe853bf78f05c 100644 (file)
@@ -690,13 +690,14 @@ static int SYM53C500_config_check(struct pcmcia_device *p_dev,
                                  unsigned int vcc,
                                  void *priv_data)
 {
-       p_dev->io.BasePort1 = cfg->io.win[0].base;
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
+       p_dev->io_lines = 10;
+       p_dev->resource[0]->start = cfg->io.win[0].base;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
 
-       if (p_dev->io.BasePort1 == 0)
+       if (p_dev->resource[0]->start == 0)
                return -ENODEV;
 
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static int
@@ -858,9 +859,8 @@ SYM53C500_probe(struct pcmcia_device *link)
                return -ENOMEM;
        info->p_dev = link;
        link->priv = info;
-       link->io.NumPorts1 = 16;
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.IOAddrLines = 10;
+       link->resource[0]->end = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
 
index fe7adcdfde9e5ee3c79975ba990b69292d89bd7d..141c69554bd481d27863b852bbd79b364417643e 100644 (file)
@@ -335,8 +335,8 @@ static int serial_probe(struct pcmcia_device *link)
        info->p_dev = link;
        link->priv = info;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 8;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        if (do_sound) {
                link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -424,12 +424,13 @@ static int simple_config_check(struct pcmcia_device *p_dev,
                p_dev->conf.Vpp =
                        cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
 
+       p_dev->io_lines = ((*try & 0x1) == 0) ?
+                       16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+
        if ((cf->io.nwin > 0) && (cf->io.win[0].len == size_table[(*try >> 1)])
            && (cf->io.win[0].base != 0)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.IOAddrLines = ((*try & 0x1) == 0) ?
-                       16 : cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -EINVAL;
@@ -446,9 +447,9 @@ static int simple_config_check_notpicky(struct pcmcia_device *p_dev,
 
        if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
                for (j = 0; j < 5; j++) {
-                       p_dev->io.BasePort1 = base[j];
-                       p_dev->io.IOAddrLines = base[j] ? 16 : 3;
-                       if (!pcmcia_request_io(p_dev, &p_dev->io))
+                       p_dev->resource[0]->start = base[j];
+                       p_dev->io_lines = base[j] ? 16 : 3;
+                       if (!pcmcia_request_io(p_dev))
                                return 0;
                }
        }
@@ -521,9 +522,9 @@ static int multi_config_check(struct pcmcia_device *p_dev,
        /* The quad port cards have bad CIS's, so just look for a
           window larger than 8 ports and assume it will be right */
        if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io)) {
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
+               if (!pcmcia_request_io(p_dev)) {
                        *base2 = p_dev->resource[0]->start + 8;
                        return 0;
                }
@@ -540,10 +541,10 @@ static int multi_config_check_notpicky(struct pcmcia_device *p_dev,
        int *base2 = priv_data;
 
        if (cf->io.nwin == 2) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.BasePort2 = cf->io.win[1].base;
-               p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io)) {
+               p_dev->resource[0]->start = cf->io.win[0].base;
+               p_dev->resource[1]->start = cf->io.win[1].base;
+               p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
+               if (!pcmcia_request_io(p_dev)) {
                        *base2 = p_dev->resource[1]->start;
                        return 0;
                }
@@ -557,10 +558,10 @@ static int multi_config(struct pcmcia_device *link)
        int i, base2 = 0;
 
        /* First, look for a generic full-sized window */
-       link->io.NumPorts1 = info->multi * 8;
+       link->resource[0]->end = info->multi * 8;
        if (pcmcia_loop_config(link, multi_config_check, &base2)) {
                /* If that didn't work, look for two windows */
-               link->io.NumPorts1 = link->io.NumPorts2 = 8;
+               link->resource[0]->end = link->resource[1]->end = 8;
                info->multi = 2;
                if (pcmcia_loop_config(link, multi_config_check_notpicky,
                                       &base2)) {
index 208f1b7a13129c0588a3e5d4cba55bd09abc8523..7cf0ccb5adefe2b16cfde8a42e4a8370185203af 100644 (file)
@@ -736,24 +736,22 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io);
+               return pcmcia_request_io(p_dev);
        }
 
        return 0;
index c4cfcffc633ebab63b7e5b96c07889304bc55e6f..9ee677f14b661e33de5b3fa0c06ad6062174b866 100644 (file)
@@ -224,24 +224,23 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+               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->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io);
+               return pcmcia_request_io(p_dev);
        }
        return 0;
 }
index 6d569579d677235539dcdfe68ca65563bd33b90e..7e41ad93703d54f675baa74cb3882b20c9ca3496 100644 (file)
@@ -571,24 +571,22 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
 
index 29e1daf6a9e61dcf31a36436e86db9a9f35f964b..b2483f86c24230be9ef5cd5cf3b3dde330f4d8e9 100644 (file)
@@ -323,24 +323,22 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
 
index fb10987a97b22b1c87696ec88b1fc19ff74ea795..c1444b4a5b4c210de425ac21717c192058528d70 100644 (file)
@@ -301,24 +301,22 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
 
index f37dc22b4dbc4483d0a70fa26562d7105e9bde19..d50b6c409fe7b33385732651fc91a928a5a616a6 100644 (file)
@@ -264,8 +264,8 @@ static const dev_info_t dev_info = "ni_mio_cs";
 
 static int cs_attach(struct pcmcia_device *link)
 {
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-       link->io.NumPorts1 = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
+       link->resource[0]->end = 16;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -310,13 +310,12 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev,
 {
        int base, ret;
 
-       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;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
+       p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
 
        for (base = 0x000; base < 0x400; base += 0x20) {
-               p_dev->io.BasePort1 = base;
-               ret = pcmcia_request_io(p_dev, &p_dev->io);
+               p_dev->resource[0]->start = base;
+               ret = pcmcia_request_io(p_dev);
                if (!ret)
                        return 0;
        }
index 80b8d57c68427303f728c7eeb6ab400342e6a3e2..25f4e67e3e897a327e00caafc722e33fa699719b 100644 (file)
@@ -1102,26 +1102,24 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               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->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       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, &p_dev->io);
+       return pcmcia_request_io(p_dev);
 }
 
 static void daqp_cs_config(struct pcmcia_device *link)
index 23615378acf142bab76745ce174571526bf1790f..f15afd2050becd6ed25de1070b66e619275bb8e1 100644 (file)
@@ -145,9 +145,8 @@ static int wl_adapter_attach(struct pcmcia_device *link)
        return -ENOMEM;
     }
 
-    link->io.NumPorts1      = HCF_NUM_IO_PORTS;
-    link->io.Attributes1    = IO_DATA_PATH_WIDTH_16;
-    link->io.IOAddrLines    = 6;
+    link->resource[0]->end      = HCF_NUM_IO_PORTS;
+    link->resource[0]->flags    = IO_DATA_PATH_WIDTH_16;
     link->conf.Attributes   = CONF_ENABLE_IRQ;
     link->conf.IntType      = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex  = 5;
@@ -305,8 +304,9 @@ void wl_adapter_insert( struct pcmcia_device *link )
 
     /* Do we need to allocate an interrupt? */
     link->conf.Attributes |= CONF_ENABLE_IRQ;
+    link->io_lines = 6;
 
-    ret = pcmcia_request_io(link, &link->io);
+    ret = pcmcia_request_io(link);
     if (ret != 0)
         goto failed;
 
index a801036392cd8e8583504bff8b91cb9af355996f..a1900e5025184521e0fe1c6f0c39b233e43026fe 100644 (file)
@@ -32,9 +32,8 @@ static int ixj_probe(struct pcmcia_device *p_dev)
 {
        dev_dbg(&p_dev->dev, "ixj_attach()\n");
        /* Create new ixj device */
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines = 3;
+       p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
        p_dev->conf.IntType = INT_MEMORY_AND_IO;
        p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
        if (!p_dev->priv) {
@@ -120,13 +119,14 @@ static int ixj_config_check(struct pcmcia_device *p_dev,
 {
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
+               p_dev->io_lines = 3;
                if (io->nwin == 2) {
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
+               if (!pcmcia_request_io(p_dev))
                        return 0;
        }
        return -ENODEV;
index 22e04f206304ad96e10cdb9cd551a4e16dd25d17..0e13a00eb2ed51ea38126fa954a5e3a4723d87c0 100644 (file)
@@ -162,16 +162,16 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev,
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       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->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
 
-               return pcmcia_request_io(p_dev, &p_dev->io);
+               return pcmcia_request_io(p_dev);
        }
        pcmcia_disable_device(p_dev);
        return -ENODEV;
index 0cd8c70d8aaa8c6b40d58f8ada54d48bc8d2a868..ad71bb5a8658ae09895769d5368a122de0871dc4 100644 (file)
@@ -56,23 +56,6 @@ typedef struct config_req_t {
 #define INT_CARDBUS            0x04
 #define INT_ZOOMED_VIDEO       0x08
 
-/* For RequestIO and ReleaseIO */
-typedef struct io_req_t {
-    u_int      BasePort1;
-    u_int      NumPorts1;
-    u_int      Attributes1;
-    u_int      BasePort2;
-    u_int      NumPorts2;
-    u_int      Attributes2;
-    u_int      IOAddrLines;
-} io_req_t;
-
-/* Attributes for RequestIO and ReleaseIO */
-#define IO_DATA_PATH_WIDTH     0x18
-#define IO_DATA_PATH_WIDTH_8   0x00
-#define IO_DATA_PATH_WIDTH_16  0x08
-#define IO_DATA_PATH_WIDTH_AUTO        0x10
-
 /* Bits in IRQInfo1 field */
 #define IRQ_NMI_ID             0x01
 #define IRQ_IOCK_ID            0x02
index 3dafd7db34dfa890dc78f338404f1723dfdff8d9..0748bec0a87a4b5b9256b05c88148d711adefcd7 100644 (file)
@@ -80,7 +80,6 @@ struct pcmcia_device {
        struct list_head        socket_device_list;
 
        /* deprecated, will be cleaned up soon */
-       io_req_t                io;
        config_req_t            conf;
        window_handle_t         win;
 
@@ -88,6 +87,8 @@ struct pcmcia_device {
        unsigned int            irq;
        struct resource         *resource[MAX_IO_WIN];
 
+       unsigned int            io_lines; /* number of I/O lines */
+
        /* Is the device suspended? */
        u16                     suspended:1;
 
@@ -179,7 +180,7 @@ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val);
 int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val);
 
 /* device configuration */
-int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
+int pcmcia_request_io(struct pcmcia_device *p_dev);
 
 int __must_check
 __pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
@@ -206,6 +207,22 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
 int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
 void pcmcia_disable_device(struct pcmcia_device *p_dev);
 
+/* IO ports */
+#define IO_DATA_PATH_WIDTH     0x18
+#define IO_DATA_PATH_WIDTH_8   0x00
+#define IO_DATA_PATH_WIDTH_16  0x08
+#define IO_DATA_PATH_WIDTH_AUTO        0x10
+
+/* convert flag found in cfgtable to data path width parameter */
+static inline int pcmcia_io_cfg_data_width(unsigned int flags)
+{
+       if (!(flags & CISTPL_IO_8BIT))
+               return IO_DATA_PATH_WIDTH_16;
+       if (!(flags & CISTPL_IO_16BIT))
+               return IO_DATA_PATH_WIDTH_8;
+       return IO_DATA_PATH_WIDTH_AUTO;
+}
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_DS_H */
index 9f897bca061544eccf42539fb4ddac444f5b1625..7ab9174a8a841b4a924474deb3c238a003180188 100644 (file)
@@ -139,8 +139,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
        pdacf->p_dev = link;
        link->priv = pdacf;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.NumPorts1 = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       link->resource[0]->end = 16;
 
        link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -219,7 +219,7 @@ static int pdacf_config(struct pcmcia_device *link)
        snd_printdd(KERN_DEBUG "pdacf_config called\n");
        link->conf.ConfigIndex = 0x5;
 
-       ret = pcmcia_request_io(link, &link->io);
+       ret = pcmcia_request_io(link);
        if (ret)
                goto failed;
 
index f23c235013a4c51b1b7b2c107217792daa0c797d..a6edfc3be29a59b018d6b268f9a01255b08451db 100644 (file)
@@ -159,8 +159,8 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
        vxp->p_dev = link;
        link->priv = chip;
 
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-       link->io.NumPorts1 = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+       link->resource[0]->end = 16;
 
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@ -226,7 +226,7 @@ static int vxpocket_config(struct pcmcia_device *link)
                strcpy(chip->card->driver, vxp440_hw.name);
        }
 
-       ret = pcmcia_request_io(link, &link->io);
+       ret = pcmcia_request_io(link);
        if (ret)
                goto failed;