aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/pcmcia/driver-changes.txt7
-rw-r--r--drivers/ata/pata_pcmcia.c29
-rw-r--r--drivers/bluetooth/bluecard_cs.c13
-rw-r--r--drivers/bluetooth/bt3c_cs.c18
-rw-r--r--drivers/bluetooth/btuart_cs.c18
-rw-r--r--drivers/bluetooth/dtl1_cs.c21
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c17
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c20
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c10
-rw-r--r--drivers/char/pcmcia/synclink_cs.c21
-rw-r--r--drivers/ide/ide-cs.c30
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c15
-rw-r--r--drivers/isdn/hisax/avma1_cs.c20
-rw-r--r--drivers/isdn/hisax/elsa_cs.c15
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c28
-rw-r--r--drivers/isdn/hisax/teles_cs.c15
-rw-r--r--drivers/net/pcmcia/3c574_cs.c11
-rw-r--r--drivers/net/pcmcia/3c589_cs.c11
-rw-r--r--drivers/net/pcmcia/axnet_cs.c40
-rw-r--r--drivers/net/pcmcia/com20020_cs.c19
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c31
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c14
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c8
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c40
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c43
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c34
-rw-r--r--drivers/net/wireless/airo_cs.c22
-rw-r--r--drivers/net/wireless/atmel_cs.c22
-rw-r--r--drivers/net/wireless/b43/pcmcia.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c28
-rw-r--r--drivers/net/wireless/libertas/if_cs.c8
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c24
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c24
-rw-r--r--drivers/net/wireless/ray_cs.c5
-rw-r--r--drivers/net/wireless/wl3501_cs.c12
-rw-r--r--drivers/parport/parport_cs.c16
-rw-r--r--drivers/pcmcia/pcmcia_resource.c37
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c14
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c10
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c30
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c14
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c14
-rw-r--r--drivers/serial/serial_cs.c37
-rw-r--r--drivers/staging/comedi/drivers/cb_das16_cs.c24
-rw-r--r--drivers/staging/comedi/drivers/das08_cs.c23
-rw-r--r--drivers/staging/comedi/drivers/ni_daq_700.c24
-rw-r--r--drivers/staging/comedi/drivers/ni_daq_dio24.c24
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c24
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_cs.c13
-rw-r--r--drivers/staging/comedi/drivers/quatech_daqp_cs.c24
-rw-r--r--drivers/staging/wlags49_h2/wl_cs.c8
-rw-r--r--drivers/telephony/ixj_pcmcia.c16
-rw-r--r--drivers/usb/host/sl811_cs.c12
-rw-r--r--include/pcmcia/cs.h17
-rw-r--r--include/pcmcia/ds.h21
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c6
-rw-r--r--sound/pcmcia/vx/vxpocket.c6
57 files changed, 527 insertions, 584 deletions
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index ff5f0be2470a..26c0f9c00545 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,4 +1,11 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2* pcmcia_request_io changes (as of 2.6.36)
3 Instead of io_req_t, drivers are now requested to fill out
4 struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
5 ranges. After a call to pcmcia_request_io(), the ports found there
6 are reserved, after calling pcmcia_request_configuration(), they may
7 be used.
8
2* No dev_info_t, no cs_types.h (as of 2.6.36) 9* No dev_info_t, no cs_types.h (as of 2.6.36)
3 dev_info_t and a few other typedefs are removed. No longer use them 10 dev_info_t and a few other typedefs are removed. No longer use them
4 in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as 11 in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 1fcd0659b3f2..e944aa0c5517 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -200,21 +200,23 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
200 200
201 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 201 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
202 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 202 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
203 pdev->io.BasePort1 = io->win[0].base; 203 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
204 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 204 pdev->resource[0]->start = io->win[0].base;
205 if (!(io->flags & CISTPL_IO_16BIT)) 205 if (!(io->flags & CISTPL_IO_16BIT)) {
206 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 206 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
207 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
208 }
207 if (io->nwin == 2) { 209 if (io->nwin == 2) {
208 pdev->io.NumPorts1 = 8; 210 pdev->resource[0]->end = 8;
209 pdev->io.BasePort2 = io->win[1].base; 211 pdev->resource[1]->start = io->win[1].base;
210 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 212 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
211 if (pcmcia_request_io(pdev, &pdev->io) != 0) 213 if (pcmcia_request_io(pdev) != 0)
212 return -ENODEV; 214 return -ENODEV;
213 stk->ctl_base = pdev->resource[1]->start; 215 stk->ctl_base = pdev->resource[1]->start;
214 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 216 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
215 pdev->io.NumPorts1 = io->win[0].len; 217 pdev->resource[0]->end = io->win[0].len;
216 pdev->io.NumPorts2 = 0; 218 pdev->resource[1]->end = 0;
217 if (pcmcia_request_io(pdev, &pdev->io) != 0) 219 if (pcmcia_request_io(pdev) != 0)
218 return -ENODEV; 220 return -ENODEV;
219 stk->ctl_base = pdev->resource[0]->start + 0x0e; 221 stk->ctl_base = pdev->resource[0]->start + 0x0e;
220 } else 222 } else
@@ -245,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
245 struct ata_port_operations *ops = &pcmcia_port_ops; 247 struct ata_port_operations *ops = &pcmcia_port_ops;
246 248
247 /* Set up attributes in order to probe card and get resources */ 249 /* Set up attributes in order to probe card and get resources */
248 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 250 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
249 pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 251 pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
250 pdev->io.IOAddrLines = 3;
251 pdev->conf.Attributes = CONF_ENABLE_IRQ; 252 pdev->conf.Attributes = CONF_ENABLE_IRQ;
252 pdev->conf.IntType = INT_MEMORY_AND_IO; 253 pdev->conf.IntType = INT_MEMORY_AND_IO;
253 254
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 24d2007139e8..d52e90a5a617 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -865,9 +865,6 @@ static int bluecard_probe(struct pcmcia_device *link)
865 info->p_dev = link; 865 info->p_dev = link;
866 link->priv = info; 866 link->priv = info;
867 867
868 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
869 link->io.NumPorts1 = 8;
870
871 link->conf.Attributes = CONF_ENABLE_IRQ; 868 link->conf.Attributes = CONF_ENABLE_IRQ;
872 link->conf.IntType = INT_MEMORY_AND_IO; 869 link->conf.IntType = INT_MEMORY_AND_IO;
873 870
@@ -890,12 +887,14 @@ static int bluecard_config(struct pcmcia_device *link)
890 int i, n; 887 int i, n;
891 888
892 link->conf.ConfigIndex = 0x20; 889 link->conf.ConfigIndex = 0x20;
893 link->io.NumPorts1 = 64; 890
894 link->io.IOAddrLines = 6; 891 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
892 link->resource[0]->end = 64;
893 link->io_lines = 6;
895 894
896 for (n = 0; n < 0x400; n += 0x40) { 895 for (n = 0; n < 0x400; n += 0x40) {
897 link->io.BasePort1 = n ^ 0x300; 896 link->resource[0]->start = n ^ 0x300;
898 i = pcmcia_request_io(link, &link->io); 897 i = pcmcia_request_io(link);
899 if (i == 0) 898 if (i == 0)
900 break; 899 break;
901 } 900 }
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 8ab494c0c17f..7ab8f29d5e0d 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -657,8 +657,8 @@ static int bt3c_probe(struct pcmcia_device *link)
657 info->p_dev = link; 657 info->p_dev = link;
658 link->priv = info; 658 link->priv = info;
659 659
660 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 660 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
661 link->io.NumPorts1 = 8; 661 link->resource[0]->end = 8;
662 662
663 link->conf.Attributes = CONF_ENABLE_IRQ; 663 link->conf.Attributes = CONF_ENABLE_IRQ;
664 link->conf.IntType = INT_MEMORY_AND_IO; 664 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -683,14 +683,14 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
683{ 683{
684 unsigned long try = (unsigned long) priv_data; 684 unsigned long try = (unsigned long) priv_data;
685 685
686 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
687
686 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 688 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
687 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 689 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
688 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 690 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
689 (cf->io.win[0].base != 0)) { 691 (cf->io.win[0].base != 0)) {
690 p_dev->io.BasePort1 = cf->io.win[0].base; 692 p_dev->resource[0]->start = cf->io.win[0].base;
691 p_dev->io.IOAddrLines = (try == 0) ? 16 : 693 if (!pcmcia_request_io(p_dev))
692 cf->io.flags & CISTPL_IO_LINES_MASK;
693 if (!pcmcia_request_io(p_dev, &p_dev->io))
694 return 0; 694 return 0;
695 } 695 }
696 return -ENODEV; 696 return -ENODEV;
@@ -707,9 +707,9 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
707 707
708 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 708 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
709 for (j = 0; j < 5; j++) { 709 for (j = 0; j < 5; j++) {
710 p_dev->io.BasePort1 = base[j]; 710 p_dev->resource[0]->start = base[j];
711 p_dev->io.IOAddrLines = base[j] ? 16 : 3; 711 p_dev->io_lines = base[j] ? 16 : 3;
712 if (!pcmcia_request_io(p_dev, &p_dev->io)) 712 if (!pcmcia_request_io(p_dev))
713 return 0; 713 return 0;
714 } 714 }
715 } 715 }
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 7e770d40368d..1c4f5e863b03 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -586,8 +586,8 @@ static int btuart_probe(struct pcmcia_device *link)
586 info->p_dev = link; 586 info->p_dev = link;
587 link->priv = info; 587 link->priv = info;
588 588
589 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 589 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
590 link->io.NumPorts1 = 8; 590 link->resource[0]->end = 8;
591 591
592 link->conf.Attributes = CONF_ENABLE_IRQ; 592 link->conf.Attributes = CONF_ENABLE_IRQ;
593 link->conf.IntType = INT_MEMORY_AND_IO; 593 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -612,14 +612,14 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
612{ 612{
613 int *try = priv_data; 613 int *try = priv_data;
614 614
615 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
616
615 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 617 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
616 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 618 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
617 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 619 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
618 (cf->io.win[0].base != 0)) { 620 (cf->io.win[0].base != 0)) {
619 p_dev->io.BasePort1 = cf->io.win[0].base; 621 p_dev->resource[0]->start = cf->io.win[0].base;
620 p_dev->io.IOAddrLines = (*try == 0) ? 16 : 622 if (!pcmcia_request_io(p_dev))
621 cf->io.flags & CISTPL_IO_LINES_MASK;
622 if (!pcmcia_request_io(p_dev, &p_dev->io))
623 return 0; 623 return 0;
624 } 624 }
625 return -ENODEV; 625 return -ENODEV;
@@ -636,9 +636,9 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
636 636
637 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 637 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
638 for (j = 0; j < 5; j++) { 638 for (j = 0; j < 5; j++) {
639 p_dev->io.BasePort1 = base[j]; 639 p_dev->resource[0]->start = base[j];
640 p_dev->io.IOAddrLines = base[j] ? 16 : 3; 640 p_dev->io_lines = base[j] ? 16 : 3;
641 if (!pcmcia_request_io(p_dev, &p_dev->io)) 641 if (!pcmcia_request_io(p_dev))
642 return 0; 642 return 0;
643 } 643 }
644 } 644 }
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index bfe9313516fb..18ecc5734e9f 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -572,8 +572,8 @@ static int dtl1_probe(struct pcmcia_device *link)
572 info->p_dev = link; 572 info->p_dev = link;
573 link->priv = info; 573 link->priv = info;
574 574
575 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 575 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
576 link->io.NumPorts1 = 8; 576 link->resource[0]->end = 8;
577 577
578 link->conf.Attributes = CONF_ENABLE_IRQ; 578 link->conf.Attributes = CONF_ENABLE_IRQ;
579 link->conf.IntType = INT_MEMORY_AND_IO; 579 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -597,14 +597,13 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev,
597 unsigned int vcc, 597 unsigned int vcc,
598 void *priv_data) 598 void *priv_data)
599{ 599{
600 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 600 if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
601 p_dev->io.BasePort1 = cf->io.win[0].base; 601 return -ENODEV;
602 p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */ 602
603 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 603 p_dev->resource[0]->start = cf->io.win[0].base;
604 if (!pcmcia_request_io(p_dev, &p_dev->io)) 604 p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
605 return 0; 605 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
606 } 606 return pcmcia_request_io(p_dev);
607 return -ENODEV;
608} 607}
609 608
610static int dtl1_config(struct pcmcia_device *link) 609static int dtl1_config(struct pcmcia_device *link)
@@ -613,7 +612,7 @@ static int dtl1_config(struct pcmcia_device *link)
613 int i; 612 int i;
614 613
615 /* Look for a generic full-sized window */ 614 /* Look for a generic full-sized window */
616 link->io.NumPorts1 = 8; 615 link->resource[0]->end = 8;
617 if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0) 616 if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
618 goto failed; 617 goto failed;
619 618
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index 18484edc1259..ec73d9f6d9ed 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1751,17 +1751,12 @@ static int cm4000_config_check(struct pcmcia_device *p_dev,
1751 if (!cfg->io.nwin) 1751 if (!cfg->io.nwin)
1752 return -ENODEV; 1752 return -ENODEV;
1753 1753
1754 /* Get the IOaddr */ 1754 p_dev->resource[0]->start = cfg->io.win[0].base;
1755 p_dev->io.BasePort1 = cfg->io.win[0].base; 1755 p_dev->resource[0]->end = cfg->io.win[0].len;
1756 p_dev->io.NumPorts1 = cfg->io.win[0].len; 1756 p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
1757 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1757 p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
1758 if (!(cfg->io.flags & CISTPL_IO_8BIT)) 1758
1759 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1759 return pcmcia_request_io(p_dev);
1760 if (!(cfg->io.flags & CISTPL_IO_16BIT))
1761 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1762 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
1763
1764 return pcmcia_request_io(p_dev, &p_dev->io);
1765} 1760}
1766 1761
1767static int cm4000_config(struct pcmcia_device * link, int devno) 1762static int cm4000_config(struct pcmcia_device * link, int devno)
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index a6bbf199dde9..815cde1d0570 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -527,16 +527,12 @@ static int cm4040_config_check(struct pcmcia_device *p_dev,
527 return -ENODEV; 527 return -ENODEV;
528 528
529 /* Get the IOaddr */ 529 /* Get the IOaddr */
530 p_dev->io.BasePort1 = cfg->io.win[0].base; 530 p_dev->resource[0]->start = cfg->io.win[0].base;
531 p_dev->io.NumPorts1 = cfg->io.win[0].len; 531 p_dev->resource[0]->end = cfg->io.win[0].len;
532 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 532 p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
533 if (!(cfg->io.flags & CISTPL_IO_8BIT)) 533 p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
534 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 534 rc = pcmcia_request_io(p_dev);
535 if (!(cfg->io.flags & CISTPL_IO_16BIT)) 535
536 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
537 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
538
539 rc = pcmcia_request_io(p_dev, &p_dev->io);
540 dev_printk(KERN_INFO, &p_dev->dev, 536 dev_printk(KERN_INFO, &p_dev->dev,
541 "pcmcia_request_io returned 0x%x\n", rc); 537 "pcmcia_request_io returned 0x%x\n", rc);
542 return rc; 538 return rc;
@@ -548,10 +544,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
548 struct reader_dev *dev; 544 struct reader_dev *dev;
549 int fail_rc; 545 int fail_rc;
550 546
551 link->io.BasePort2 = 0;
552 link->io.NumPorts2 = 0;
553 link->io.Attributes2 = 0;
554
555 if (pcmcia_loop_config(link, cm4040_config_check, NULL)) 547 if (pcmcia_loop_config(link, cm4040_config_check, NULL))
556 goto cs_release; 548 goto cs_release;
557 549
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 9467994d556f..5f87b9f7b6d2 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -88,15 +88,15 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
88 memreq_t memreq_common_memory; 88 memreq_t memreq_common_memory;
89 int ret; 89 int ret;
90 90
91 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 91 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
92 p_dev->io.BasePort1 = cfg->io.win[0].base; 92 p_dev->resource[0]->start = cfg->io.win[0].base;
93 p_dev->io.NumPorts1 = cfg->io.win[0].len; 93 p_dev->resource[0]->end = cfg->io.win[0].len;
94 p_dev->io.IOAddrLines = 16;
95 94
96 /* 0x40 causes it to generate level mode interrupts. */ 95 /* 0x40 causes it to generate level mode interrupts. */
97 /* 0x04 enables IREQ pin. */ 96 /* 0x04 enables IREQ pin. */
98 p_dev->conf.ConfigIndex = cfg->index | 0x44; 97 p_dev->conf.ConfigIndex = cfg->index | 0x44;
99 ret = pcmcia_request_io(p_dev, &p_dev->io); 98 p_dev->io_lines = 16;
99 ret = pcmcia_request_io(p_dev);
100 if (ret) 100 if (ret)
101 return ret; 101 return ret;
102 102
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 8ded9b02b9b9..9ecd6bef5d3b 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -571,18 +571,15 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
571 unsigned int vcc, 571 unsigned int vcc,
572 void *priv_data) 572 void *priv_data)
573{ 573{
574 if (cfg->io.nwin > 0) { 574 if (!cfg->io.nwin)
575 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 575 return -ENODEV;
576 if (!(cfg->io.flags & CISTPL_IO_8BIT)) 576
577 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 577 p_dev->resource[0]->start = cfg->io.win[0].base;
578 if (!(cfg->io.flags & CISTPL_IO_16BIT)) 578 p_dev->resource[0]->end = cfg->io.win[0].len;
579 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 579 p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
580 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK; 580 p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
581 p_dev->io.BasePort1 = cfg->io.win[0].base; 581
582 p_dev->io.NumPorts1 = cfg->io.win[0].len; 582 return pcmcia_request_io(p_dev);
583 return pcmcia_request_io(p_dev, &p_dev->io);
584 }
585 return -ENODEV;
586} 583}
587 584
588static int mgslpc_config(struct pcmcia_device *link) 585static int mgslpc_config(struct pcmcia_device *link)
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 6be0e5f108b5..2a4cb9c18f01 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -97,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link)
97 info->p_dev = link; 97 info->p_dev = link;
98 link->priv = info; 98 link->priv = info;
99 99
100 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 100 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
101 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 101 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
102 link->io.IOAddrLines = 3;
103 link->conf.Attributes = CONF_ENABLE_IRQ; 102 link->conf.Attributes = CONF_ENABLE_IRQ;
104 link->conf.IntType = INT_MEMORY_AND_IO; 103 link->conf.IntType = INT_MEMORY_AND_IO;
105 104
@@ -228,22 +227,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
228 227
229 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 228 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
230 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 229 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
230 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
231
231 pdev->conf.ConfigIndex = cfg->index; 232 pdev->conf.ConfigIndex = cfg->index;
232 pdev->io.BasePort1 = io->win[0].base; 233 pdev->resource[0]->start = io->win[0].base;
233 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 234 if (!(io->flags & CISTPL_IO_16BIT)) {
234 if (!(io->flags & CISTPL_IO_16BIT)) 235 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
235 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 236 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
237 }
236 if (io->nwin == 2) { 238 if (io->nwin == 2) {
237 pdev->io.NumPorts1 = 8; 239 pdev->resource[0]->end = 8;
238 pdev->io.BasePort2 = io->win[1].base; 240 pdev->resource[1]->start = io->win[1].base;
239 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 241 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
240 if (pcmcia_request_io(pdev, &pdev->io) != 0) 242 if (pcmcia_request_io(pdev) != 0)
241 return -ENODEV; 243 return -ENODEV;
242 stk->ctl_base = pdev->resource[1]->start; 244 stk->ctl_base = pdev->resource[1]->start;
243 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 245 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
244 pdev->io.NumPorts1 = io->win[0].len; 246 pdev->resource[0]->end = io->win[0].len;
245 pdev->io.NumPorts2 = 0; 247 pdev->resource[1]->end = 0;
246 if (pcmcia_request_io(pdev, &pdev->io) != 0) 248 if (pcmcia_request_io(pdev) != 0)
247 return -ENODEV; 249 return -ENODEV;
248 stk->ctl_base = pdev->resource[0]->start + 0x0e; 250 stk->ctl_base = pdev->resource[0]->start + 0x0e;
249 } else 251 } else
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 7c8c51f22003..09b1795516f4 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -75,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
75{ 75{
76 76
77 /* The io structure describes IO port mapping */ 77 /* The io structure describes IO port mapping */
78 p_dev->io.NumPorts1 = 16; 78 p_dev->resource[0]->end = 16;
79 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 79 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
80 p_dev->io.NumPorts2 = 0;
81 80
82 /* General socket configuration */ 81 /* General socket configuration */
83 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 82 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -119,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
119 if (cf->io.nwin <= 0) 118 if (cf->io.nwin <= 0)
120 return -ENODEV; 119 return -ENODEV;
121 120
122 p_dev->io.BasePort1 = cf->io.win[0].base; 121 p_dev->resource[0]->start = cf->io.win[0].base;
123 p_dev->io.NumPorts1 = cf->io.win[0].len; 122 p_dev->resource[0]->end = cf->io.win[0].len;
124 p_dev->io.NumPorts2 = 0; 123 return pcmcia_request_io(p_dev);
125 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
126 p_dev->io.BasePort1,
127 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
128 return pcmcia_request_io(p_dev, &p_dev->io);
129} 124}
130 125
131static int avmcs_config(struct pcmcia_device *link) 126static int avmcs_config(struct pcmcia_device *link)
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 88899638f835..94263c22b874 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -78,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
78 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 78 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
79 79
80 /* The io structure describes IO port mapping */ 80 /* The io structure describes IO port mapping */
81 p_dev->io.NumPorts1 = 16; 81 p_dev->resource[0]->end = 16;
82 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 82 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
83 p_dev->io.NumPorts2 = 16; 83 p_dev->resource[1]->end = 16;
84 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 84 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
85 p_dev->io.IOAddrLines = 5;
86 85
87 /* General socket configuration */ 86 /* General socket configuration */
88 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 87 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -126,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
126 if (cf->io.nwin <= 0) 125 if (cf->io.nwin <= 0)
127 return -ENODEV; 126 return -ENODEV;
128 127
129 p_dev->io.BasePort1 = cf->io.win[0].base; 128 p_dev->resource[0]->start = cf->io.win[0].base;
130 p_dev->io.NumPorts1 = cf->io.win[0].len; 129 p_dev->resource[0]->end = cf->io.win[0].len;
131 p_dev->io.NumPorts2 = 0; 130 p_dev->io_lines = 5;
132 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", 131 return pcmcia_request_io(p_dev);
133 p_dev->io.BasePort1,
134 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
135 return pcmcia_request_io(p_dev, &p_dev->io);
136} 132}
137 133
138 134
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index c10bfd3f4588..b3c08aaf41c4 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -126,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
126 and attributes of IO windows) are fixed by the nature of the 126 and attributes of IO windows) are fixed by the nature of the
127 device, and can be hard-wired here. 127 device, and can be hard-wired here.
128 */ 128 */
129 link->io.NumPorts1 = 8; 129 link->resource[0]->end = 8;
130 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 130 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
131 link->io.IOAddrLines = 3;
132 131
133 link->conf.Attributes = CONF_ENABLE_IRQ; 132 link->conf.Attributes = CONF_ENABLE_IRQ;
134 link->conf.IntType = INT_MEMORY_AND_IO; 133 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -173,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
173{ 172{
174 int j; 173 int j;
175 174
175 p_dev->io_lines = 3;
176
176 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 177 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
177 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); 178 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
178 p_dev->io.BasePort1 = cf->io.win[0].base; 179 p_dev->resource[0]->start = cf->io.win[0].base;
179 if (!pcmcia_request_io(p_dev, &p_dev->io)) 180 if (!pcmcia_request_io(p_dev))
180 return 0; 181 return 0;
181 } else { 182 } else {
182 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); 183 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
183 for (j = 0x2f0; j > 0x100; j -= 0x10) { 184 for (j = 0x2f0; j > 0x100; j -= 0x10) {
184 p_dev->io.BasePort1 = j; 185 p_dev->resource[0]->start = j;
185 if (!pcmcia_request_io(p_dev, &p_dev->io)) 186 if (!pcmcia_request_io(p_dev))
186 return 0; 187 return 0;
187 } 188 }
188 } 189 }
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index cecb35ab9d3d..4755eb440f7e 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -129,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
129 /* from old sedl_cs 129 /* from old sedl_cs
130 */ 130 */
131 /* The io structure describes IO port mapping */ 131 /* The io structure describes IO port mapping */
132 link->io.NumPorts1 = 8; 132 link->resource[0]->end = 8;
133 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 133 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
134 link->io.IOAddrLines = 3;
135 134
136 link->conf.Attributes = 0; 135 link->conf.Attributes = 0;
137 link->conf.IntType = INT_MEMORY_AND_IO; 136 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -201,23 +200,22 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
201 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 200 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
202 201
203 /* IO window settings */ 202 /* IO window settings */
204 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 203 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
205 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 204 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
206 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 205 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
207 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 206 p_dev->resource[0]->start = io->win[0].base;
208 if (!(io->flags & CISTPL_IO_8BIT)) 207 p_dev->resource[0]->end = io->win[0].len;
209 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 208 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
210 if (!(io->flags & CISTPL_IO_16BIT)) 209 p_dev->resource[0]->flags |=
211 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 210 pcmcia_io_cfg_data_width(io->flags);
212 p_dev->io.BasePort1 = io->win[0].base;
213 p_dev->io.NumPorts1 = io->win[0].len;
214 if (io->nwin > 1) { 211 if (io->nwin > 1) {
215 p_dev->io.Attributes2 = p_dev->io.Attributes1; 212 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
216 p_dev->io.BasePort2 = io->win[1].base; 213 p_dev->resource[1]->start = io->win[1].base;
217 p_dev->io.NumPorts2 = io->win[1].len; 214 p_dev->resource[1]->end = io->win[1].len;
218 } 215 }
219 /* This reserves IO space but doesn't actually enable it */ 216 /* This reserves IO space but doesn't actually enable it */
220 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 217 p_dev->io_lines = 3;
218 if (pcmcia_request_io(p_dev) != 0)
221 return -ENODEV; 219 return -ENODEV;
222 } 220 }
223 221
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 3787fc70cf8f..7296102ca255 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -106,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)
106 and attributes of IO windows) are fixed by the nature of the 106 and attributes of IO windows) are fixed by the nature of the
107 device, and can be hard-wired here. 107 device, and can be hard-wired here.
108 */ 108 */
109 link->io.NumPorts1 = 96; 109 link->resource[0]->end = 96;
110 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 110 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
111 link->io.IOAddrLines = 5;
112 111
113 link->conf.Attributes = CONF_ENABLE_IRQ; 112 link->conf.Attributes = CONF_ENABLE_IRQ;
114 link->conf.IntType = INT_MEMORY_AND_IO; 113 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -153,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
153{ 152{
154 int j; 153 int j;
155 154
155 p_dev->io_lines = 5;
156
156 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 157 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
157 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); 158 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");
158 p_dev->io.BasePort1 = cf->io.win[0].base; 159 p_dev->resource[0]->start = cf->io.win[0].base;
159 if (!pcmcia_request_io(p_dev, &p_dev->io)) 160 if (!pcmcia_request_io(p_dev))
160 return 0; 161 return 0;
161 } else { 162 } else {
162 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); 163 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");
163 for (j = 0x2f0; j > 0x100; j -= 0x10) { 164 for (j = 0x2f0; j > 0x100; j -= 0x10) {
164 p_dev->io.BasePort1 = j; 165 p_dev->resource[0]->start = j;
165 if (!pcmcia_request_io(p_dev, &p_dev->io)) 166 if (!pcmcia_request_io(p_dev))
166 return 0; 167 return 0;
167 } 168 }
168 } 169 }
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index b5ea9b8cfd76..c683f77c6f42 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -278,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link)
278 lp->p_dev = link; 278 lp->p_dev = link;
279 279
280 spin_lock_init(&lp->window_lock); 280 spin_lock_init(&lp->window_lock);
281 link->io.NumPorts1 = 32; 281 link->resource[0]->end = 32;
282 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 282 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
283 link->conf.Attributes = CONF_ENABLE_IRQ; 283 link->conf.Attributes = CONF_ENABLE_IRQ;
284 link->conf.IntType = INT_MEMORY_AND_IO; 284 link->conf.IntType = INT_MEMORY_AND_IO;
285 link->conf.ConfigIndex = 1; 285 link->conf.ConfigIndex = 1;
@@ -337,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link)
337 337
338 dev_dbg(&link->dev, "3c574_config()\n"); 338 dev_dbg(&link->dev, "3c574_config()\n");
339 339
340 link->io.IOAddrLines = 16; 340 link->io_lines = 16;
341
341 for (i = j = 0; j < 0x400; j += 0x20) { 342 for (i = j = 0; j < 0x400; j += 0x20) {
342 link->io.BasePort1 = j ^ 0x300; 343 link->resource[0]->start = j ^ 0x300;
343 i = pcmcia_request_io(link, &link->io); 344 i = pcmcia_request_io(link);
344 if (i == 0) 345 if (i == 0)
345 break; 346 break;
346 } 347 }
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 122ef4a9488c..61f9cf2100ff 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -213,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link)
213 lp->p_dev = link; 213 lp->p_dev = link;
214 214
215 spin_lock_init(&lp->lock); 215 spin_lock_init(&lp->lock);
216 link->io.NumPorts1 = 16; 216 link->resource[0]->end = 16;
217 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 217 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
218 218
219 link->conf.Attributes = CONF_ENABLE_IRQ; 219 link->conf.Attributes = CONF_ENABLE_IRQ;
220 link->conf.IntType = INT_MEMORY_AND_IO; 220 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -277,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link)
277 "3Com card??\n"); 277 "3Com card??\n");
278 multi = (link->card_id == PRODID_3COM_3C562); 278 multi = (link->card_id == PRODID_3COM_3C562);
279 279
280 link->io_lines = 16;
281
280 /* For the 3c562, the base address must be xx00-xx7f */ 282 /* For the 3c562, the base address must be xx00-xx7f */
281 link->io.IOAddrLines = 16;
282 for (i = j = 0; j < 0x400; j += 0x10) { 283 for (i = j = 0; j < 0x400; j += 0x10) {
283 if (multi && (j & 0x80)) continue; 284 if (multi && (j & 0x80)) continue;
284 link->io.BasePort1 = j ^ 0x300; 285 link->resource[0]->start = j ^ 0x300;
285 i = pcmcia_request_io(link, &link->io); 286 i = pcmcia_request_io(link);
286 if (i == 0) 287 if (i == 0)
287 break; 288 break;
288 } 289 }
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index c52fdf31cbfe..5f05ffb240cc 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -259,28 +259,30 @@ static int get_prom(struct pcmcia_device *link)
259static int try_io_port(struct pcmcia_device *link) 259static int try_io_port(struct pcmcia_device *link)
260{ 260{
261 int j, ret; 261 int j, ret;
262 if (link->io.NumPorts1 == 32) { 262 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
263 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 263 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
264 if (link->resource[0]->end == 32) {
265 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
264 /* for master/slave multifunction cards */ 266 /* for master/slave multifunction cards */
265 if (link->io.NumPorts2 > 0) 267 if (link->resource[1]->end > 0)
266 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 268 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
267 } else { 269 } else {
268 /* This should be two 16-port windows */ 270 /* This should be two 16-port windows */
269 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 271 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
270 link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 272 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
271 } 273 }
272 if (link->io.BasePort1 == 0) { 274 if (link->resource[0]->start == 0) {
273 link->io.IOAddrLines = 16;
274 for (j = 0; j < 0x400; j += 0x20) { 275 for (j = 0; j < 0x400; j += 0x20) {
275 link->io.BasePort1 = j ^ 0x300; 276 link->resource[0]->start = j ^ 0x300;
276 link->io.BasePort2 = (j ^ 0x300) + 0x10; 277 link->resource[1]->start = (j ^ 0x300) + 0x10;
277 ret = pcmcia_request_io(link, &link->io); 278 link->io_lines = 16;
279 ret = pcmcia_request_io(link);
278 if (ret == 0) 280 if (ret == 0)
279 return ret; 281 return ret;
280 } 282 }
281 return ret; 283 return ret;
282 } else { 284 } else {
283 return pcmcia_request_io(link, &link->io); 285 return pcmcia_request_io(link);
284 } 286 }
285} 287}
286 288
@@ -301,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
301 network function with window 0, and serial with window 1 */ 303 network function with window 0, and serial with window 1 */
302 if (io->nwin > 1) { 304 if (io->nwin > 1) {
303 i = (io->win[1].len > io->win[0].len); 305 i = (io->win[1].len > io->win[0].len);
304 p_dev->io.BasePort2 = io->win[1-i].base; 306 p_dev->resource[1]->start = io->win[1-i].base;
305 p_dev->io.NumPorts2 = io->win[1-i].len; 307 p_dev->resource[1]->end = io->win[1-i].len;
306 } else { 308 } else {
307 i = p_dev->io.NumPorts2 = 0; 309 i = p_dev->resource[1]->end = 0;
308 } 310 }
309 p_dev->io.BasePort1 = io->win[i].base; 311 p_dev->resource[0]->start = io->win[i].base;
310 p_dev->io.NumPorts1 = io->win[i].len; 312 p_dev->resource[0]->end = io->win[i].len;
311 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 313 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
312 if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) 314 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
313 return try_io_port(p_dev); 315 return try_io_port(p_dev);
314 316
315 return -ENODEV; 317 return -ENODEV;
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 3b53818e3eef..3c400cfa82ae 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -158,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev)
158 /* fill in our module parameters as defaults */ 158 /* fill in our module parameters as defaults */
159 dev->dev_addr[0] = node; 159 dev->dev_addr[0] = node;
160 160
161 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 161 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
162 p_dev->io.NumPorts1 = 16; 162 p_dev->resource[0]->end = 16;
163 p_dev->io.IOAddrLines = 16;
164 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 163 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
165 p_dev->conf.IntType = INT_MEMORY_AND_IO; 164 p_dev->conf.IntType = INT_MEMORY_AND_IO;
166 165
@@ -245,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link)
245 244
246 dev_dbg(&link->dev, "com20020_config\n"); 245 dev_dbg(&link->dev, "com20020_config\n");
247 246
248 dev_dbg(&link->dev, "baseport1 is %Xh\n", link->io.BasePort1); 247 dev_dbg(&link->dev, "baseport1 is %Xh\n",
248 (unsigned int) link->resource[0]->start);
249
249 i = -ENODEV; 250 i = -ENODEV;
250 if (!link->io.BasePort1) 251 link->io_lines = 16;
252
253 if (!link->resource[0]->start)
251 { 254 {
252 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) 255 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
253 { 256 {
254 link->io.BasePort1 = ioaddr; 257 link->resource[0]->start = ioaddr;
255 i = pcmcia_request_io(link, &link->io); 258 i = pcmcia_request_io(link);
256 if (i == 0) 259 if (i == 0)
257 break; 260 break;
258 } 261 }
259 } 262 }
260 else 263 else
261 i = pcmcia_request_io(link, &link->io); 264 i = pcmcia_request_io(link);
262 265
263 if (i != 0) 266 if (i != 0)
264 { 267 {
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index bba6369a028e..699304480aed 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
248 lp->base = NULL; 248 lp->base = NULL;
249 249
250 /* The io structure describes IO port mapping */ 250 /* The io structure describes IO port mapping */
251 link->io.NumPorts1 = 32; 251 link->resource[0]->end = 32;
252 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 252 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
253 link->io.IOAddrLines = 5;
254 253
255 /* General socket configuration */ 254 /* General socket configuration */
256 link->conf.Attributes = CONF_ENABLE_IRQ; 255 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link)
288 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 287 { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
289 288
290 for (i = 0; i < 5; i++) { 289 for (i = 0; i < 5; i++) {
291 link->io.BasePort2 = serial_base[i]; 290 link->resource[1]->start = serial_base[i];
292 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 291 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
293 if (link->io.BasePort2 == 0) { 292 if (link->resource[1]->start == 0) {
294 link->io.NumPorts2 = 0; 293 link->resource[1]->end = 0;
295 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n"); 294 printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
296 } 295 }
297 ret = pcmcia_request_io(link, &link->io); 296 ret = pcmcia_request_io(link);
298 if (ret == 0) 297 if (ret == 0)
299 return ret; 298 return ret;
300 } 299 }
@@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
310 0x380,0x3c0 only for ioport. 309 0x380,0x3c0 only for ioport.
311 */ 310 */
312 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) { 311 for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
313 link->io.BasePort1 = ioaddr; 312 link->resource[0]->start = ioaddr;
314 ret = pcmcia_request_io(link, &link->io); 313 ret = pcmcia_request_io(link);
315 if (ret == 0) { 314 if (ret == 0) {
316 /* calculate ConfigIndex value */ 315 /* calculate ConfigIndex value */
317 link->conf.ConfigIndex = 316 link->conf.ConfigIndex =
@@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)
345 344
346 dev_dbg(&link->dev, "fmvj18x_config\n"); 345 dev_dbg(&link->dev, "fmvj18x_config\n");
347 346
347 link->io_lines = 5;
348
348 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf); 349 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
349 kfree(buf); 350 kfree(buf);
350 351
@@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)
363 /* MultiFunction Card */ 364 /* MultiFunction Card */
364 link->conf.ConfigBase = 0x800; 365 link->conf.ConfigBase = 0x800;
365 link->conf.ConfigIndex = 0x47; 366 link->conf.ConfigIndex = 0x47;
366 link->io.NumPorts2 = 8; 367 link->resource[1]->end = 8;
367 } 368 }
368 break; 369 break;
369 case MANFID_NEC: 370 case MANFID_NEC:
370 cardtype = NEC; /* MultiFunction Card */ 371 cardtype = NEC; /* MultiFunction Card */
371 link->conf.ConfigBase = 0x800; 372 link->conf.ConfigBase = 0x800;
372 link->conf.ConfigIndex = 0x47; 373 link->conf.ConfigIndex = 0x47;
373 link->io.NumPorts2 = 8; 374 link->resource[1]->end = 8;
374 break; 375 break;
375 case MANFID_KME: 376 case MANFID_KME:
376 cardtype = KME; /* MultiFunction Card */ 377 cardtype = KME; /* MultiFunction Card */
377 link->conf.ConfigBase = 0x800; 378 link->conf.ConfigBase = 0x800;
378 link->conf.ConfigIndex = 0x47; 379 link->conf.ConfigIndex = 0x47;
379 link->io.NumPorts2 = 8; 380 link->resource[1]->end = 8;
380 break; 381 break;
381 case MANFID_CONTEC: 382 case MANFID_CONTEC:
382 cardtype = CONTEC; 383 cardtype = CONTEC;
@@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
417 } 418 }
418 } 419 }
419 420
420 if (link->io.NumPorts2 != 0) { 421 if (link->resource[1]->end != 0) {
421 ret = mfc_try_io_port(link); 422 ret = mfc_try_io_port(link);
422 if (ret != 0) goto failed; 423 if (ret != 0) goto failed;
423 } else if (cardtype == UNGERMANN) { 424 } else if (cardtype == UNGERMANN) {
424 ret = ungermann_try_io_port(link); 425 ret = ungermann_try_io_port(link);
425 if (ret != 0) goto failed; 426 if (ret != 0) goto failed;
426 } else { 427 } else {
427 ret = pcmcia_request_io(link, &link->io); 428 ret = pcmcia_request_io(link);
428 if (ret) 429 if (ret)
429 goto failed; 430 goto failed;
430 } 431 }
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index e99abaa92be5..3fd859570db3 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -151,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
151 link->priv = info; 151 link->priv = info;
152 info->ti = netdev_priv(dev); 152 info->ti = netdev_priv(dev);
153 153
154 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 154 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
155 link->io.NumPorts1 = 4; 155 link->resource[0]->end = 4;
156 link->io.IOAddrLines = 16;
157 link->conf.Attributes = CONF_ENABLE_IRQ; 156 link->conf.Attributes = CONF_ENABLE_IRQ;
158 link->conf.IntType = INT_MEMORY_AND_IO; 157 link->conf.IntType = INT_MEMORY_AND_IO;
159 link->conf.Present = PRESENT_OPTION; 158 link->conf.Present = PRESENT_OPTION;
@@ -218,16 +217,17 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
218 dev_dbg(&link->dev, "ibmtr_config\n"); 217 dev_dbg(&link->dev, "ibmtr_config\n");
219 218
220 link->conf.ConfigIndex = 0x61; 219 link->conf.ConfigIndex = 0x61;
220 link->io_lines = 16;
221 221
222 /* Determine if this is PRIMARY or ALTERNATE. */ 222 /* Determine if this is PRIMARY or ALTERNATE. */
223 223
224 /* Try PRIMARY card at 0xA20-0xA23 */ 224 /* Try PRIMARY card at 0xA20-0xA23 */
225 link->io.BasePort1 = 0xA20; 225 link->resource[0]->start = 0xA20;
226 i = pcmcia_request_io(link, &link->io); 226 i = pcmcia_request_io(link);
227 if (i != 0) { 227 if (i != 0) {
228 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ 228 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
229 link->io.BasePort1 = 0xA24; 229 link->resource[0]->start = 0xA24;
230 ret = pcmcia_request_io(link, &link->io); 230 ret = pcmcia_request_io(link);
231 if (ret) 231 if (ret)
232 goto failed; 232 goto failed;
233 } 233 }
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 9980cbb81d34..68f2deeb3ade 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -458,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link)
458 link->priv = dev; 458 link->priv = dev;
459 459
460 spin_lock_init(&lp->bank_lock); 460 spin_lock_init(&lp->bank_lock);
461 link->io.NumPorts1 = 32; 461 link->resource[0]->end = 32;
462 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 462 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
463 link->io.IOAddrLines = 5;
464 link->conf.Attributes = CONF_ENABLE_IRQ; 463 link->conf.Attributes = CONF_ENABLE_IRQ;
465 link->conf.IntType = INT_MEMORY_AND_IO; 464 link->conf.IntType = INT_MEMORY_AND_IO;
466 link->conf.ConfigIndex = 1; 465 link->conf.ConfigIndex = 1;
@@ -644,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link)
644 643
645 dev_dbg(&link->dev, "nmclan_config\n"); 644 dev_dbg(&link->dev, "nmclan_config\n");
646 645
647 ret = pcmcia_request_io(link, &link->io); 646 link->io_lines = 5;
647 ret = pcmcia_request_io(link);
648 if (ret) 648 if (ret)
649 goto failed; 649 goto failed;
650 ret = pcmcia_request_exclusive_irq(link, mace_interrupt); 650 ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index c9cd2377ef91..9c5fc9dfc55d 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -477,29 +477,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
477static int try_io_port(struct pcmcia_device *link) 477static int try_io_port(struct pcmcia_device *link)
478{ 478{
479 int j, ret; 479 int j, ret;
480 if (link->io.NumPorts1 == 32) { 480 link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
481 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 481 link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
482 if (link->io.NumPorts2 > 0) { 482 if (link->resource[0]->end == 32) {
483 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
484 if (link->resource[1]->end > 0) {
483 /* for master/slave multifunction cards */ 485 /* for master/slave multifunction cards */
484 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 486 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
485 } 487 }
486 } else { 488 } else {
487 /* This should be two 16-port windows */ 489 /* This should be two 16-port windows */
488 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 490 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
489 link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 491 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
490 } 492 }
491 if (link->io.BasePort1 == 0) { 493 if (link->resource[0]->start == 0) {
492 link->io.IOAddrLines = 16;
493 for (j = 0; j < 0x400; j += 0x20) { 494 for (j = 0; j < 0x400; j += 0x20) {
494 link->io.BasePort1 = j ^ 0x300; 495 link->resource[0]->start = j ^ 0x300;
495 link->io.BasePort2 = (j ^ 0x300) + 0x10; 496 link->resource[1]->start = (j ^ 0x300) + 0x10;
496 ret = pcmcia_request_io(link, &link->io); 497 link->io_lines = 16;
498 ret = pcmcia_request_io(link);
497 if (ret == 0) 499 if (ret == 0)
498 return ret; 500 return ret;
499 } 501 }
500 return ret; 502 return ret;
501 } else { 503 } else {
502 return pcmcia_request_io(link, &link->io); 504 return pcmcia_request_io(link);
503 } 505 }
504} 506}
505 507
@@ -520,18 +522,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
520 network function with window 0, and serial with window 1 */ 522 network function with window 0, and serial with window 1 */
521 if (io->nwin > 1) { 523 if (io->nwin > 1) {
522 i = (io->win[1].len > io->win[0].len); 524 i = (io->win[1].len > io->win[0].len);
523 p_dev->io.BasePort2 = io->win[1-i].base; 525 p_dev->resource[1]->start = io->win[1-i].base;
524 p_dev->io.NumPorts2 = io->win[1-i].len; 526 p_dev->resource[1]->end = io->win[1-i].len;
525 } else { 527 } else {
526 i = p_dev->io.NumPorts2 = 0; 528 i = p_dev->resource[1]->end = 0;
527 } 529 }
528 530
529 *has_shmem = ((cfg->mem.nwin == 1) && 531 *has_shmem = ((cfg->mem.nwin == 1) &&
530 (cfg->mem.win[0].len >= 0x4000)); 532 (cfg->mem.win[0].len >= 0x4000));
531 p_dev->io.BasePort1 = io->win[i].base; 533 p_dev->resource[0]->start = io->win[i].base;
532 p_dev->io.NumPorts1 = io->win[i].len; 534 p_dev->resource[0]->end = io->win[i].len;
533 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 535 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
534 if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32) 536 if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
535 return try_io_port(p_dev); 537 return try_io_port(p_dev);
536 538
537 return 0; 539 return 0;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 1b0b3230dd71..a5e47796f6ae 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -324,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
324 link->priv = dev; 324 link->priv = dev;
325 325
326 spin_lock_init(&smc->lock); 326 spin_lock_init(&smc->lock);
327 link->io.NumPorts1 = 16; 327 link->resource[0]->end = 16;
328 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 328 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
329 link->io.IOAddrLines = 4;
330 link->conf.Attributes = CONF_ENABLE_IRQ; 329 link->conf.Attributes = CONF_ENABLE_IRQ;
331 link->conf.IntType = INT_MEMORY_AND_IO; 330 link->conf.IntType = INT_MEMORY_AND_IO;
332 331
@@ -427,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev,
427 void *priv_data) 426 void *priv_data)
428{ 427{
429 int k; 428 int k;
430 p_dev->io.BasePort2 = cf->io.win[0].base; 429 p_dev->resource[1]->start = cf->io.win[0].base;
431 for (k = 0; k < 0x400; k += 0x10) { 430 for (k = 0; k < 0x400; k += 0x10) {
432 if (k & 0x80) 431 if (k & 0x80)
433 continue; 432 continue;
434 p_dev->io.BasePort1 = k ^ 0x300; 433 p_dev->resource[0]->start = k ^ 0x300;
435 if (!pcmcia_request_io(p_dev, &p_dev->io)) 434 p_dev->io_lines = 16;
435 if (!pcmcia_request_io(p_dev))
436 return 0; 436 return 0;
437 } 437 }
438 return -ENODEV; 438 return -ENODEV;
@@ -448,9 +448,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
448 448
449 link->conf.Attributes |= CONF_ENABLE_SPKR; 449 link->conf.Attributes |= CONF_ENABLE_SPKR;
450 link->conf.Status = CCSR_AUDIO_ENA; 450 link->conf.Status = CCSR_AUDIO_ENA;
451 link->io.IOAddrLines = 16; 451 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
452 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 452 link->resource[1]->end = 8;
453 link->io.NumPorts2 = 8;
454 453
455 /* The Megahertz combo cards have modem-like CIS entries, so 454 /* The Megahertz combo cards have modem-like CIS entries, so
456 we have to explicitly try a bunch of port combinations. */ 455 we have to explicitly try a bunch of port combinations. */
@@ -601,9 +600,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev,
601 unsigned int vcc, 600 unsigned int vcc,
602 void *priv_data) 601 void *priv_data)
603{ 602{
604 p_dev->io.BasePort1 = cf->io.win[0].base; 603 p_dev->resource[0]->start = cf->io.win[0].base;
605 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 604 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
606 return pcmcia_request_io(p_dev, &p_dev->io); 605 return pcmcia_request_io(p_dev);
607} 606}
608 607
609static int smc_config(struct pcmcia_device *link) 608static int smc_config(struct pcmcia_device *link)
@@ -611,7 +610,7 @@ static int smc_config(struct pcmcia_device *link)
611 struct net_device *dev = link->priv; 610 struct net_device *dev = link->priv;
612 int i; 611 int i;
613 612
614 link->io.NumPorts1 = 16; 613 link->resource[0]->end = 16;
615 i = pcmcia_loop_config(link, smc_configcheck, NULL); 614 i = pcmcia_loop_config(link, smc_configcheck, NULL);
616 if (!i) 615 if (!i)
617 dev->base_addr = link->resource[0]->start; 616 dev->base_addr = link->resource[0]->start;
@@ -646,25 +645,25 @@ static int osi_config(struct pcmcia_device *link)
646 645
647 link->conf.Attributes |= CONF_ENABLE_SPKR; 646 link->conf.Attributes |= CONF_ENABLE_SPKR;
648 link->conf.Status = CCSR_AUDIO_ENA; 647 link->conf.Status = CCSR_AUDIO_ENA;
649 link->io.NumPorts1 = 64; 648 link->resource[0]->end = 64;
650 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 649 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
651 link->io.NumPorts2 = 8; 650 link->resource[1]->end = 8;
652 link->io.IOAddrLines = 16;
653 651
654 /* Enable Hard Decode, LAN, Modem */ 652 /* Enable Hard Decode, LAN, Modem */
655 link->conf.ConfigIndex = 0x23; 653 link->conf.ConfigIndex = 0x23;
654 link->io_lines = 16;
656 655
657 for (i = j = 0; j < 4; j++) { 656 for (i = j = 0; j < 4; j++) {
658 link->io.BasePort2 = com[j]; 657 link->resource[1]->start = com[j];
659 i = pcmcia_request_io(link, &link->io); 658 i = pcmcia_request_io(link);
660 if (i == 0) 659 if (i == 0)
661 break; 660 break;
662 } 661 }
663 if (i != 0) { 662 if (i != 0) {
664 /* Fallback: turn off hard decode */ 663 /* Fallback: turn off hard decode */
665 link->conf.ConfigIndex = 0x03; 664 link->conf.ConfigIndex = 0x03;
666 link->io.NumPorts2 = 0; 665 link->resource[1]->end = 0;
667 i = pcmcia_request_io(link, &link->io); 666 i = pcmcia_request_io(link);
668 } 667 }
669 dev->base_addr = link->resource[0]->start + 0x10; 668 dev->base_addr = link->resource[0]->start + 0x10;
670 return i; 669 return i;
@@ -803,7 +802,7 @@ static int check_sig(struct pcmcia_device *link)
803 } 802 }
804 803
805 /* Try setting bus width */ 804 /* Try setting bus width */
806 width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO); 805 width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO);
807 s = inb(ioaddr + CONFIG); 806 s = inb(ioaddr + CONFIG);
808 if (width) 807 if (width)
809 s |= CFG_16BIT; 808 s |= CFG_16BIT;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 034920b459d1..8fb0eb1dc341 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -677,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev,
677 677
678 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 678 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
679 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 679 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
680 p_dev->io.BasePort2 = cf->io.win[0].base; 680 p_dev->resource[1]->start = cf->io.win[0].base;
681 p_dev->io.BasePort1 = ioaddr; 681 p_dev->resource[0]->start = ioaddr;
682 if (!pcmcia_request_io(p_dev, &p_dev->io)) 682 if (!pcmcia_request_io(p_dev))
683 return 0; 683 return 0;
684 } 684 }
685 } 685 }
@@ -696,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,
696 int *pass = priv_data; 696 int *pass = priv_data;
697 697
698 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) { 698 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
699 p_dev->io.BasePort2 = cf->io.win[0].base; 699 p_dev->resource[1]->start = cf->io.win[0].base;
700 p_dev->io.BasePort1 = p_dev->io.BasePort2 700 p_dev->resource[0]->start = p_dev->resource[1]->start
701 + (*pass ? (cf->index & 0x20 ? -24:8) 701 + (*pass ? (cf->index & 0x20 ? -24:8)
702 : (cf->index & 0x20 ? 8:-24)); 702 : (cf->index & 0x20 ? 8:-24));
703 if (!pcmcia_request_io(p_dev, &p_dev->io)) 703 if (!pcmcia_request_io(p_dev))
704 return 0; 704 return 0;
705 } 705 }
706 return -ENODEV; 706 return -ENODEV;
@@ -807,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link)
807 goto failure; 807 goto failure;
808 } 808 }
809 809
810 link->io.IOAddrLines =10; 810 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
811 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
812 if (local->modem) { 811 if (local->modem) {
813 int pass; 812 int pass;
814 813
@@ -816,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link)
816 link->conf.Attributes |= CONF_ENABLE_SPKR; 815 link->conf.Attributes |= CONF_ENABLE_SPKR;
817 link->conf.Status |= CCSR_AUDIO_ENA; 816 link->conf.Status |= CCSR_AUDIO_ENA;
818 } 817 }
819 link->io.NumPorts2 = 8; 818 link->resource[1]->end = 8;
820 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 819 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
821 if (local->dingo) { 820 if (local->dingo) {
822 /* Take the Modem IO port from the CIS and scan for a free 821 /* Take the Modem IO port from the CIS and scan for a free
823 * Ethernet port */ 822 * Ethernet port */
824 link->io.NumPorts1 = 16; /* no Mako stuff anymore */ 823 link->resource[0]->end = 16; /* no Mako stuff anymore */
825 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL)) 824 if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL))
826 goto port_found; 825 goto port_found;
827 } else { 826 } else {
828 link->io.NumPorts1 = 18; 827 link->resource[0]->end = 18;
829 /* We do 2 passes here: The first one uses the regular mapping and 828 /* We do 2 passes here: The first one uses the regular mapping and
830 * the second tries again, thereby considering that the 32 ports are 829 * the second tries again, thereby considering that the 32 ports are
831 * mirrored every 32 bytes. Actually we use a mirrored port for 830 * mirrored every 32 bytes. Actually we use a mirrored port for
@@ -840,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link)
840 } 839 }
841 printk(KNOT_XIRC "no ports available\n"); 840 printk(KNOT_XIRC "no ports available\n");
842 } else { 841 } else {
843 link->io.NumPorts1 = 16; 842 link->io_lines = 10;
843 link->resource[0]->end = 16;
844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 844 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
845 link->io.BasePort1 = ioaddr; 845 link->resource[0]->start = ioaddr;
846 if (!(err=pcmcia_request_io(link, &link->io))) 846 if (!(err = pcmcia_request_io(link)))
847 goto port_found; 847 goto port_found;
848 } 848 }
849 link->io.BasePort1 = 0; /* let CS decide */ 849 link->resource[0]->start = 0; /* let CS decide */
850 if ((err=pcmcia_request_io(link, &link->io))) 850 if ((err = pcmcia_request_io(link)))
851 goto config_error; 851 goto config_error;
852 } 852 }
853 port_found: 853 port_found:
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index b7e7f5054e44..d241b4aed71e 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 175 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
176 176
177 /* IO window settings */ 177 /* IO window settings */
178 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 178 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 179 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 180 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
181 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 181 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
182 if (!(io->flags & CISTPL_IO_8BIT)) 182 p_dev->resource[0]->flags |=
183 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 183 pcmcia_io_cfg_data_width(io->flags);
184 if (!(io->flags & CISTPL_IO_16BIT)) 184 p_dev->resource[0]->start = io->win[0].base;
185 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 185 p_dev->resource[0]->end = io->win[0].len;
186 p_dev->io.BasePort1 = io->win[0].base;
187 p_dev->io.NumPorts1 = io->win[0].len;
188 if (io->nwin > 1) { 186 if (io->nwin > 1) {
189 p_dev->io.Attributes2 = p_dev->io.Attributes1; 187 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
190 p_dev->io.BasePort2 = io->win[1].base; 188 p_dev->resource[1]->start = io->win[1].base;
191 p_dev->io.NumPorts2 = io->win[1].len; 189 p_dev->resource[1]->end = io->win[1].len;
192 } 190 }
193 } 191 }
194 192
195 /* This reserves IO space but doesn't actually enable it */ 193 /* This reserves IO space but doesn't actually enable it */
196 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 194 if (pcmcia_request_io(p_dev) != 0)
197 return -ENODEV; 195 return -ENODEV;
198 196
199 /* 197 /*
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 65b3aed49e58..3b632161c106 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 190 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
191 191
192 /* IO window settings */ 192 /* IO window settings */
193 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 193 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 194 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 195 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
196 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 196 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
197 if (!(io->flags & CISTPL_IO_8BIT)) 197 p_dev->resource[0]->flags |=
198 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 198 pcmcia_io_cfg_data_width(io->flags);
199 if (!(io->flags & CISTPL_IO_16BIT)) 199 p_dev->resource[0]->start = io->win[0].base;
200 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 200 p_dev->resource[0]->end = io->win[0].len;
201 p_dev->io.BasePort1 = io->win[0].base;
202 p_dev->io.NumPorts1 = io->win[0].len;
203 if (io->nwin > 1) { 201 if (io->nwin > 1) {
204 p_dev->io.Attributes2 = p_dev->io.Attributes1; 202 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
205 p_dev->io.BasePort2 = io->win[1].base; 203 p_dev->resource[1]->start = io->win[1].base;
206 p_dev->io.NumPorts2 = io->win[1].len; 204 p_dev->resource[1]->end = io->win[1].len;
207 } 205 }
208 } 206 }
209 207
210 /* This reserves IO space but doesn't actually enable it */ 208 /* This reserves IO space but doesn't actually enable it */
211 return pcmcia_request_io(p_dev, &p_dev->io); 209 return pcmcia_request_io(p_dev);
212} 210}
213 211
214static int atmel_config(struct pcmcia_device *link) 212static int atmel_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index f71bc7821378..7c9af82fcf7e 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -77,10 +77,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
77 dev->conf.Attributes = CONF_ENABLE_IRQ; 77 dev->conf.Attributes = CONF_ENABLE_IRQ;
78 dev->conf.IntType = INT_MEMORY_AND_IO; 78 dev->conf.IntType = INT_MEMORY_AND_IO;
79 79
80 dev->io.BasePort2 = 0;
81 dev->io.NumPorts2 = 0;
82 dev->io.Attributes2 = 0;
83
84 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | 80 win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM |
85 WIN_ENABLE | WIN_DATA_WIDTH_16 | 81 WIN_ENABLE | WIN_DATA_WIDTH_16 |
86 WIN_USE_WAIT; 82 WIN_USE_WAIT;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 4e13cedb8235..ba54d1b04d22 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -519,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " 519 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
520 "dflt->io.nwin=%d\n", 520 "dflt->io.nwin=%d\n",
521 cfg->io.nwin, dflt->io.nwin); 521 cfg->io.nwin, dflt->io.nwin);
522 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 522 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 523 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 524 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
525 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 525 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
526 PDEBUG(DEBUG_EXTRA, "io->flags = 0x%04X, " 526 p_dev->resource[0]->flags |=
527 "io.base=0x%04x, len=%d\n", io->flags, 527 pcmcia_io_cfg_data_width(io->flags);
528 io->win[0].base, io->win[0].len); 528 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
529 if (!(io->flags & CISTPL_IO_8BIT)) 529 p_dev->resource[0]->start = io->win[0].base;
530 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 530 p_dev->resource[0]->end = io->win[0].len;
531 if (!(io->flags & CISTPL_IO_16BIT))
532 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
533 p_dev->io.IOAddrLines = io->flags &
534 CISTPL_IO_LINES_MASK;
535 p_dev->io.BasePort1 = io->win[0].base;
536 p_dev->io.NumPorts1 = io->win[0].len;
537 if (io->nwin > 1) { 531 if (io->nwin > 1) {
538 p_dev->io.Attributes2 = p_dev->io.Attributes1; 532 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
539 p_dev->io.BasePort2 = io->win[1].base; 533 p_dev->resource[1]->start = io->win[1].base;
540 p_dev->io.NumPorts2 = io->win[1].len; 534 p_dev->resource[1]->end = io->win[1].len;
541 } 535 }
542 } 536 }
543 537
544 /* This reserves IO space but doesn't actually enable it */ 538 /* This reserves IO space but doesn't actually enable it */
545 return pcmcia_request_io(p_dev, &p_dev->io); 539 return pcmcia_request_io(p_dev);
546} 540}
547 541
548static int prism2_config(struct pcmcia_device *link) 542static int prism2_config(struct pcmcia_device *link)
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index be4c47594b59..9c298396be50 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -801,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
801 unsigned int vcc, 801 unsigned int vcc,
802 void *priv_data) 802 void *priv_data)
803{ 803{
804 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 804 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
805 p_dev->io.BasePort1 = cfg->io.win[0].base; 805 p_dev->resource[0]->start = cfg->io.win[0].base;
806 p_dev->io.NumPorts1 = cfg->io.win[0].len; 806 p_dev->resource[0]->end = cfg->io.win[0].len;
807 807
808 /* Do we need to allocate an interrupt? */ 808 /* Do we need to allocate an interrupt? */
809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
@@ -815,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
815 } 815 }
816 816
817 /* This reserves IO space but doesn't actually enable it */ 817 /* This reserves IO space but doesn't actually enable it */
818 return pcmcia_request_io(p_dev, &p_dev->io); 818 return pcmcia_request_io(p_dev);
819} 819}
820 820
821static int if_cs_probe(struct pcmcia_device *p_dev) 821static int if_cs_probe(struct pcmcia_device *p_dev)
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 6d514b5462fd..ef46a2d88539 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -191,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
192 192
193 /* IO window settings */ 193 /* IO window settings */
194 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 194 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 195 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 196 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
197 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 197 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
198 if (!(io->flags & CISTPL_IO_8BIT)) 198 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
199 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 199 p_dev->resource[0]->flags |=
200 if (!(io->flags & CISTPL_IO_16BIT)) 200 pcmcia_io_cfg_data_width(io->flags);
201 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 201 p_dev->resource[0]->start = io->win[0].base;
202 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 202 p_dev->resource[0]->end = io->win[0].len;
203 p_dev->io.BasePort1 = io->win[0].base;
204 p_dev->io.NumPorts1 = io->win[0].len;
205 if (io->nwin > 1) { 203 if (io->nwin > 1) {
206 p_dev->io.Attributes2 = p_dev->io.Attributes1; 204 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
207 p_dev->io.BasePort2 = io->win[1].base; 205 p_dev->resource[1]->start = io->win[1].base;
208 p_dev->io.NumPorts2 = io->win[1].len; 206 p_dev->resource[1]->end = io->win[1].len;
209 } 207 }
210 208
211 /* This reserves IO space but doesn't actually enable it */ 209 /* This reserves IO space but doesn't actually enable it */
212 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 210 if (pcmcia_request_io(p_dev) != 0)
213 goto next_entry; 211 goto next_entry;
214 } 212 }
215 return 0; 213 return 0;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 4f8f55eab955..873877e17e1b 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -253,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 253 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
254 254
255 /* IO window settings */ 255 /* IO window settings */
256 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 256 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 257 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 258 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
259 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 259 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
260 if (!(io->flags & CISTPL_IO_8BIT)) 260 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
261 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 261 p_dev->resource[0]->flags |=
262 if (!(io->flags & CISTPL_IO_16BIT)) 262 pcmcia_io_cfg_data_width(io->flags);
263 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 263 p_dev->resource[0]->start = io->win[0].base;
264 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 264 p_dev->resource[0]->end = io->win[0].len;
265 p_dev->io.BasePort1 = io->win[0].base;
266 p_dev->io.NumPorts1 = io->win[0].len;
267 if (io->nwin > 1) { 265 if (io->nwin > 1) {
268 p_dev->io.Attributes2 = p_dev->io.Attributes1; 266 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
269 p_dev->io.BasePort2 = io->win[1].base; 267 p_dev->resource[1]->start = io->win[1].base;
270 p_dev->io.NumPorts2 = io->win[1].len; 268 p_dev->resource[1]->end = io->win[1].len;
271 } 269 }
272 270
273 /* This reserves IO space but doesn't actually enable it */ 271 /* This reserves IO space but doesn't actually enable it */
274 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 272 if (pcmcia_request_io(p_dev) != 0)
275 goto next_entry; 273 goto next_entry;
276 } 274 }
277 return 0; 275 return 0;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 165beb6af849..b83d5ef1dffe 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -315,9 +315,8 @@ static int ray_probe(struct pcmcia_device *p_dev)
315 local->finder = p_dev; 315 local->finder = p_dev;
316 316
317 /* The io structure describes IO port mapping. None used here */ 317 /* The io structure describes IO port mapping. None used here */
318 p_dev->io.NumPorts1 = 0; 318 p_dev->resource[0]->end = 0;
319 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 319 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
320 p_dev->io.IOAddrLines = 5;
321 320
322 /* General socket configuration */ 321 /* General socket configuration */
323 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 322 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a32f220648c0..a1cc2d498a1c 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1884,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1884 struct wl3501_card *this; 1884 struct wl3501_card *this;
1885 1885
1886 /* The io structure describes IO port mapping */ 1886 /* The io structure describes IO port mapping */
1887 p_dev->io.NumPorts1 = 16; 1887 p_dev->resource[0]->end = 16;
1888 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1888 p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8;
1889 p_dev->io.IOAddrLines = 5;
1890 1889
1891 /* General socket configuration */ 1890 /* General socket configuration */
1892 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1891 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1932,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link)
1932 /* Try allocating IO ports. This tries a few fixed addresses. If you 1931 /* Try allocating IO ports. This tries a few fixed addresses. If you
1933 * want, you can also read the card's config table to pick addresses -- 1932 * want, you can also read the card's config table to pick addresses --
1934 * see the serial driver for an example. */ 1933 * see the serial driver for an example. */
1934 link->io_lines = 5;
1935 1935
1936 for (j = 0x280; j < 0x400; j += 0x20) { 1936 for (j = 0x280; j < 0x400; j += 0x20) {
1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then 1937 /* The '^0x300' is so that we probe 0x300-0x3ff first, then
1938 * 0x200-0x2ff, and so on, because this seems safer */ 1938 * 0x200-0x2ff, and so on, because this seems safer */
1939 link->io.BasePort1 = j; 1939 link->resource[0]->start = j;
1940 link->io.BasePort2 = link->io.BasePort1 + 0x10; 1940 link->resource[1]->start = link->resource[0]->start + 0x10;
1941 i = pcmcia_request_io(link, &link->io); 1941 i = pcmcia_request_io(link);
1942 if (i == 0) 1942 if (i == 0)
1943 break; 1943 break;
1944 } 1944 }
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index fc1639c5ada6..23e50f4a27c5 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -101,8 +101,8 @@ static int parport_probe(struct pcmcia_device *link)
101 link->priv = info; 101 link->priv = info;
102 info->p_dev = link; 102 info->p_dev = link;
103 103
104 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
105 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 105 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
106 link->conf.Attributes = CONF_ENABLE_IRQ; 106 link->conf.Attributes = CONF_ENABLE_IRQ;
107 link->conf.IntType = INT_MEMORY_AND_IO; 107 link->conf.IntType = INT_MEMORY_AND_IO;
108 108
@@ -143,16 +143,16 @@ static int parport_config_check(struct pcmcia_device *p_dev,
143{ 143{
144 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 144 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
145 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 145 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
146 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
146 if (epp_mode) 147 if (epp_mode)
147 p_dev->conf.ConfigIndex |= FORCE_EPP_MODE; 148 p_dev->conf.ConfigIndex |= FORCE_EPP_MODE;
148 p_dev->io.BasePort1 = io->win[0].base; 149 p_dev->resource[0]->start = io->win[0].base;
149 p_dev->io.NumPorts1 = io->win[0].len; 150 p_dev->resource[0]->end = io->win[0].len;
150 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
151 if (io->nwin == 2) { 151 if (io->nwin == 2) {
152 p_dev->io.BasePort2 = io->win[1].base; 152 p_dev->resource[1]->start = io->win[1].base;
153 p_dev->io.NumPorts2 = io->win[1].len; 153 p_dev->resource[1]->end = io->win[1].len;
154 } 154 }
155 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 155 if (pcmcia_request_io(p_dev) != 0)
156 return -ENODEV; 156 return -ENODEV;
157 return 0; 157 return 0;
158 } 158 }
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index fcd48dae79bc..a48d4a91d440 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -70,7 +70,8 @@ static int alloc_io_space(struct pcmcia_socket *s, struct resource *res,
70 70
71 res->flags |= IORESOURCE_IO; 71 res->flags |= IORESOURCE_IO;
72 72
73 dev_dbg(&s->dev, "alloc_io_space request for %pR\n", res); 73 dev_dbg(&s->dev, "alloc_io_space request for %pR, %d lines\n",
74 res, lines);
74 75
75 align = base ? (lines ? 1<<lines : 0) : 1; 76 align = base ? (lines ? 1<<lines : 0) : 1;
76 if (align && (align < num)) { 77 if (align && (align < num)) {
@@ -541,38 +542,25 @@ EXPORT_SYMBOL(pcmcia_request_configuration);
541 * pcmcia_request_io() - attempt to reserve port ranges for PCMCIA devices 542 * pcmcia_request_io() - attempt to reserve port ranges for PCMCIA devices
542 * 543 *
543 * pcmcia_request_io() attepts to reserve the IO port ranges specified in 544 * pcmcia_request_io() attepts to reserve the IO port ranges specified in
544 * struct pcmcia_device *p_dev->resource[0] and *p_dev->resource[1]. The 545 * &struct pcmcia_device @p_dev->resource[0] and @p_dev->resource[1]. The
545 * "start" value is the requested start of the IO port resource; "end" 546 * "start" value is the requested start of the IO port resource; "end"
546 * relfects the number of ports requested. 547 * reflects the number of ports requested. The number of IO lines requested
547 * 548 * is specified in &struct pcmcia_device @p_dev->io_lines.
548 * If io_req_t is passed, those values are converted automatically.
549 */ 549 */
550int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req) 550int pcmcia_request_io(struct pcmcia_device *p_dev)
551{ 551{
552 struct pcmcia_socket *s = p_dev->socket; 552 struct pcmcia_socket *s = p_dev->socket;
553 config_t *c; 553 config_t *c = p_dev->function_config;
554 int ret = -EINVAL; 554 int ret = -EINVAL;
555 unsigned int lines = req->IOAddrLines;
556 555
557 mutex_lock(&s->ops_mutex); 556 mutex_lock(&s->ops_mutex);
557 dev_dbg(&s->dev, "pcmcia_request_io: %pR , %pR", &c->io[0], &c->io[1]);
558 558
559 if (!(s->state & SOCKET_PRESENT)) { 559 if (!(s->state & SOCKET_PRESENT)) {
560 dev_dbg(&s->dev, "pcmcia_request_io: No card present\n"); 560 dev_dbg(&s->dev, "pcmcia_request_io: No card present\n");
561 goto out; 561 goto out;
562 } 562 }
563 563
564 c = p_dev->function_config;
565 if (req) {
566 c->io[0].start = req->BasePort1;
567 c->io[0].end = req->NumPorts1;
568 c->io[0].flags |= req->Attributes1;
569 c->io[1].start = req->BasePort2;
570 c->io[1].end = req->NumPorts2;
571 c->io[1].flags |= req->Attributes2;
572 }
573
574 dev_dbg(&s->dev, "pcmcia_request_io: %pR , %pR", &c->io[0], &c->io[1]);
575
576 if (c->state & CONFIG_LOCKED) { 564 if (c->state & CONFIG_LOCKED) {
577 dev_dbg(&s->dev, "Configuration is locked\n"); 565 dev_dbg(&s->dev, "Configuration is locked\n");
578 goto out; 566 goto out;
@@ -582,12 +570,12 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
582 goto out; 570 goto out;
583 } 571 }
584 572
585 ret = alloc_io_space(s, &c->io[0], lines); 573 ret = alloc_io_space(s, &c->io[0], p_dev->io_lines);
586 if (ret) 574 if (ret)
587 goto out; 575 goto out;
588 576
589 if (c->io[1].end) { 577 if (c->io[1].end) {
590 ret = alloc_io_space(s, &c->io[1], lines); 578 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
591 if (ret) { 579 if (ret) {
592 release_io_space(s, &c->io[0]); 580 release_io_space(s, &c->io[0]);
593 goto out; 581 goto out;
@@ -598,11 +586,6 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
598 c->state |= CONFIG_IO_REQ; 586 c->state |= CONFIG_IO_REQ;
599 p_dev->_io = 1; 587 p_dev->_io = 1;
600 588
601 if (!ret) {
602 req->BasePort1 = c->io[0].start;
603 req->BasePort2 = c->io[1].start;
604 }
605
606 dev_dbg(&s->dev, "pcmcia_request_io succeeded: %pR , %pR", 589 dev_dbg(&s->dev, "pcmcia_request_io succeeded: %pR , %pR",
607 &c->io[0], &c->io[1]); 590 &c->io[0], &c->io[1]);
608out: 591out:
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 3e040f503afa..61f49bdcc0c2 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -100,9 +100,8 @@ static int aha152x_probe(struct pcmcia_device *link)
100 info->p_dev = link; 100 info->p_dev = link;
101 link->priv = info; 101 link->priv = info;
102 102
103 link->io.NumPorts1 = 0x20; 103 link->resource[0]->end = 0x20;
104 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
105 link->io.IOAddrLines = 10;
106 link->conf.Attributes = CONF_ENABLE_IRQ; 105 link->conf.Attributes = CONF_ENABLE_IRQ;
107 link->conf.IntType = INT_MEMORY_AND_IO; 106 link->conf.IntType = INT_MEMORY_AND_IO;
108 link->conf.Present = PRESENT_OPTION; 107 link->conf.Present = PRESENT_OPTION;
@@ -130,15 +129,16 @@ static int aha152x_config_check(struct pcmcia_device *p_dev,
130 unsigned int vcc, 129 unsigned int vcc,
131 void *priv_data) 130 void *priv_data)
132{ 131{
132 p_dev->io_lines = 10;
133 /* For New Media T&J, look for a SCSI window */ 133 /* For New Media T&J, look for a SCSI window */
134 if (cfg->io.win[0].len >= 0x20) 134 if (cfg->io.win[0].len >= 0x20)
135 p_dev->io.BasePort1 = cfg->io.win[0].base; 135 p_dev->resource[0]->start = cfg->io.win[0].base;
136 else if ((cfg->io.nwin > 1) && 136 else if ((cfg->io.nwin > 1) &&
137 (cfg->io.win[1].len >= 0x20)) 137 (cfg->io.win[1].len >= 0x20))
138 p_dev->io.BasePort1 = cfg->io.win[1].base; 138 p_dev->resource[0]->start = cfg->io.win[1].base;
139 if ((cfg->io.nwin > 0) && 139 if ((cfg->io.nwin > 0) &&
140 (p_dev->io.BasePort1 < 0xffff)) { 140 (p_dev->resource[0]->start < 0xffff)) {
141 if (!pcmcia_request_io(p_dev, &p_dev->io)) 141 if (!pcmcia_request_io(p_dev))
142 return 0; 142 return 0;
143 } 143 }
144 return -EINVAL; 144 return -EINVAL;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 49a9a0a60c82..13dbe5c48492 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -83,9 +83,8 @@ static int fdomain_probe(struct pcmcia_device *link)
83 83
84 info->p_dev = link; 84 info->p_dev = link;
85 link->priv = info; 85 link->priv = info;
86 link->io.NumPorts1 = 0x10; 86 link->resource[0]->end = 0x10;
87 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 87 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
88 link->io.IOAddrLines = 10;
89 link->conf.Attributes = CONF_ENABLE_IRQ; 88 link->conf.Attributes = CONF_ENABLE_IRQ;
90 link->conf.IntType = INT_MEMORY_AND_IO; 89 link->conf.IntType = INT_MEMORY_AND_IO;
91 link->conf.Present = PRESENT_OPTION; 90 link->conf.Present = PRESENT_OPTION;
@@ -112,8 +111,9 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
112 unsigned int vcc, 111 unsigned int vcc,
113 void *priv_data) 112 void *priv_data)
114{ 113{
115 p_dev->io.BasePort1 = cfg->io.win[0].base; 114 p_dev->io_lines = 10;
116 return pcmcia_request_io(p_dev, &p_dev->io); 115 p_dev->resource[0]->start = cfg->io.win[0].base;
116 return pcmcia_request_io(p_dev);
117} 117}
118 118
119 119
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index d929891809ab..8bb598bb440d 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1558,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info); 1558 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
1559 1559
1560 /* The io structure describes IO port mapping */ 1560 /* The io structure describes IO port mapping */
1561 link->io.NumPorts1 = 0x10; 1561 link->resource[0]->end = 0x10;
1562 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1562 link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
1563 link->io.IOAddrLines = 10; /* not used */
1564 1563
1565 /* General socket configuration */ 1564 /* General socket configuration */
1566 link->conf.Attributes = CONF_ENABLE_IRQ; 1565 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -1641,24 +1640,23 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1641 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 1640 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1642 1641
1643 /* IO window settings */ 1642 /* IO window settings */
1644 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1643 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
1645 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1644 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1646 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1645 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1647 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1646 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1648 if (!(io->flags & CISTPL_IO_8BIT)) 1647 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1649 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1648 p_dev->resource[0]->flags |=
1650 if (!(io->flags & CISTPL_IO_16BIT)) 1649 pcmcia_io_cfg_data_width(io->flags);
1651 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1650 p_dev->resource[0]->start = io->win[0].base;
1652 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 1651 p_dev->resource[0]->end = io->win[0].len;
1653 p_dev->io.BasePort1 = io->win[0].base;
1654 p_dev->io.NumPorts1 = io->win[0].len;
1655 if (io->nwin > 1) { 1652 if (io->nwin > 1) {
1656 p_dev->io.Attributes2 = p_dev->io.Attributes1; 1653 p_dev->resource[1]->flags =
1657 p_dev->io.BasePort2 = io->win[1].base; 1654 p_dev->resource[0]->flags;
1658 p_dev->io.NumPorts2 = io->win[1].len; 1655 p_dev->resource[1]->start = io->win[1].base;
1656 p_dev->resource[1]->end = io->win[1].len;
1659 } 1657 }
1660 /* This reserves IO space but doesn't actually enable it */ 1658 /* This reserves IO space but doesn't actually enable it */
1661 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 1659 if (pcmcia_request_io(p_dev) != 0)
1662 goto next_entry; 1660 goto next_entry;
1663 } 1661 }
1664 1662
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 4e2b83f26232..eb775f1a523c 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -156,9 +156,8 @@ static int qlogic_probe(struct pcmcia_device *link)
156 return -ENOMEM; 156 return -ENOMEM;
157 info->p_dev = link; 157 info->p_dev = link;
158 link->priv = info; 158 link->priv = info;
159 link->io.NumPorts1 = 16; 159 link->resource[0]->end = 16;
160 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 160 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
161 link->io.IOAddrLines = 10;
162 link->conf.Attributes = CONF_ENABLE_IRQ; 161 link->conf.Attributes = CONF_ENABLE_IRQ;
163 link->conf.IntType = INT_MEMORY_AND_IO; 162 link->conf.IntType = INT_MEMORY_AND_IO;
164 link->conf.Present = PRESENT_OPTION; 163 link->conf.Present = PRESENT_OPTION;
@@ -185,13 +184,14 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,
185 unsigned int vcc, 184 unsigned int vcc,
186 void *priv_data) 185 void *priv_data)
187{ 186{
188 p_dev->io.BasePort1 = cfg->io.win[0].base; 187 p_dev->io_lines = 10;
189 p_dev->io.NumPorts1 = cfg->io.win[0].len; 188 p_dev->resource[0]->start = cfg->io.win[0].base;
189 p_dev->resource[0]->end = cfg->io.win[0].len;
190 190
191 if (p_dev->io.BasePort1 == 0) 191 if (p_dev->resource[0]->start == 0)
192 return -ENODEV; 192 return -ENODEV;
193 193
194 return pcmcia_request_io(p_dev, &p_dev->io); 194 return pcmcia_request_io(p_dev);
195} 195}
196 196
197static int qlogic_config(struct pcmcia_device * link) 197static int qlogic_config(struct pcmcia_device * link)
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index d99c0cbad2de..321e390c9120 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -690,13 +690,14 @@ static int SYM53C500_config_check(struct pcmcia_device *p_dev,
690 unsigned int vcc, 690 unsigned int vcc,
691 void *priv_data) 691 void *priv_data)
692{ 692{
693 p_dev->io.BasePort1 = cfg->io.win[0].base; 693 p_dev->io_lines = 10;
694 p_dev->io.NumPorts1 = cfg->io.win[0].len; 694 p_dev->resource[0]->start = cfg->io.win[0].base;
695 p_dev->resource[0]->end = cfg->io.win[0].len;
695 696
696 if (p_dev->io.BasePort1 == 0) 697 if (p_dev->resource[0]->start == 0)
697 return -ENODEV; 698 return -ENODEV;
698 699
699 return pcmcia_request_io(p_dev, &p_dev->io); 700 return pcmcia_request_io(p_dev);
700} 701}
701 702
702static int 703static int
@@ -858,9 +859,8 @@ SYM53C500_probe(struct pcmcia_device *link)
858 return -ENOMEM; 859 return -ENOMEM;
859 info->p_dev = link; 860 info->p_dev = link;
860 link->priv = info; 861 link->priv = info;
861 link->io.NumPorts1 = 16; 862 link->resource[0]->end = 16;
862 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 863 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
863 link->io.IOAddrLines = 10;
864 link->conf.Attributes = CONF_ENABLE_IRQ; 864 link->conf.Attributes = CONF_ENABLE_IRQ;
865 link->conf.IntType = INT_MEMORY_AND_IO; 865 link->conf.IntType = INT_MEMORY_AND_IO;
866 866
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index fe7adcdfde9e..141c69554bd4 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -335,8 +335,8 @@ static int serial_probe(struct pcmcia_device *link)
335 info->p_dev = link; 335 info->p_dev = link;
336 link->priv = info; 336 link->priv = info;
337 337
338 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 338 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
339 link->io.NumPorts1 = 8; 339 link->resource[0]->end = 8;
340 link->conf.Attributes = CONF_ENABLE_IRQ; 340 link->conf.Attributes = CONF_ENABLE_IRQ;
341 if (do_sound) { 341 if (do_sound) {
342 link->conf.Attributes |= CONF_ENABLE_SPKR; 342 link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -424,12 +424,13 @@ static int simple_config_check(struct pcmcia_device *p_dev,
424 p_dev->conf.Vpp = 424 p_dev->conf.Vpp =
425 cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 425 cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
426 426
427 p_dev->io_lines = ((*try & 0x1) == 0) ?
428 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
429
427 if ((cf->io.nwin > 0) && (cf->io.win[0].len == size_table[(*try >> 1)]) 430 if ((cf->io.nwin > 0) && (cf->io.win[0].len == size_table[(*try >> 1)])
428 && (cf->io.win[0].base != 0)) { 431 && (cf->io.win[0].base != 0)) {
429 p_dev->io.BasePort1 = cf->io.win[0].base; 432 p_dev->resource[0]->start = cf->io.win[0].base;
430 p_dev->io.IOAddrLines = ((*try & 0x1) == 0) ? 433 if (!pcmcia_request_io(p_dev))
431 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
432 if (!pcmcia_request_io(p_dev, &p_dev->io))
433 return 0; 434 return 0;
434 } 435 }
435 return -EINVAL; 436 return -EINVAL;
@@ -446,9 +447,9 @@ static int simple_config_check_notpicky(struct pcmcia_device *p_dev,
446 447
447 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 448 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
448 for (j = 0; j < 5; j++) { 449 for (j = 0; j < 5; j++) {
449 p_dev->io.BasePort1 = base[j]; 450 p_dev->resource[0]->start = base[j];
450 p_dev->io.IOAddrLines = base[j] ? 16 : 3; 451 p_dev->io_lines = base[j] ? 16 : 3;
451 if (!pcmcia_request_io(p_dev, &p_dev->io)) 452 if (!pcmcia_request_io(p_dev))
452 return 0; 453 return 0;
453 } 454 }
454 } 455 }
@@ -521,9 +522,9 @@ static int multi_config_check(struct pcmcia_device *p_dev,
521 /* The quad port cards have bad CIS's, so just look for a 522 /* The quad port cards have bad CIS's, so just look for a
522 window larger than 8 ports and assume it will be right */ 523 window larger than 8 ports and assume it will be right */
523 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 524 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
524 p_dev->io.BasePort1 = cf->io.win[0].base; 525 p_dev->resource[0]->start = cf->io.win[0].base;
525 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 526 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
526 if (!pcmcia_request_io(p_dev, &p_dev->io)) { 527 if (!pcmcia_request_io(p_dev)) {
527 *base2 = p_dev->resource[0]->start + 8; 528 *base2 = p_dev->resource[0]->start + 8;
528 return 0; 529 return 0;
529 } 530 }
@@ -540,10 +541,10 @@ static int multi_config_check_notpicky(struct pcmcia_device *p_dev,
540 int *base2 = priv_data; 541 int *base2 = priv_data;
541 542
542 if (cf->io.nwin == 2) { 543 if (cf->io.nwin == 2) {
543 p_dev->io.BasePort1 = cf->io.win[0].base; 544 p_dev->resource[0]->start = cf->io.win[0].base;
544 p_dev->io.BasePort2 = cf->io.win[1].base; 545 p_dev->resource[1]->start = cf->io.win[1].base;
545 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 546 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
546 if (!pcmcia_request_io(p_dev, &p_dev->io)) { 547 if (!pcmcia_request_io(p_dev)) {
547 *base2 = p_dev->resource[1]->start; 548 *base2 = p_dev->resource[1]->start;
548 return 0; 549 return 0;
549 } 550 }
@@ -557,10 +558,10 @@ static int multi_config(struct pcmcia_device *link)
557 int i, base2 = 0; 558 int i, base2 = 0;
558 559
559 /* First, look for a generic full-sized window */ 560 /* First, look for a generic full-sized window */
560 link->io.NumPorts1 = info->multi * 8; 561 link->resource[0]->end = info->multi * 8;
561 if (pcmcia_loop_config(link, multi_config_check, &base2)) { 562 if (pcmcia_loop_config(link, multi_config_check, &base2)) {
562 /* If that didn't work, look for two windows */ 563 /* If that didn't work, look for two windows */
563 link->io.NumPorts1 = link->io.NumPorts2 = 8; 564 link->resource[0]->end = link->resource[1]->end = 8;
564 info->multi = 2; 565 info->multi = 2;
565 if (pcmcia_loop_config(link, multi_config_check_notpicky, 566 if (pcmcia_loop_config(link, multi_config_check_notpicky,
566 &base2)) { 567 &base2)) {
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 208f1b7a1312..7cf0ccb5adef 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -736,24 +736,22 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
736 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 736 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
737 737
738 /* IO window settings */ 738 /* IO window settings */
739 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 739 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
740 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 740 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
741 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 741 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
742 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 742 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
743 if (!(io->flags & CISTPL_IO_8BIT)) 743 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
744 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 744 p_dev->resource[0]->flags |=
745 if (!(io->flags & CISTPL_IO_16BIT)) 745 pcmcia_io_cfg_data_width(io->flags);
746 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 746 p_dev->resource[0]->start = io->win[0].base;
747 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 747 p_dev->resource[0]->end = io->win[0].len;
748 p_dev->io.BasePort1 = io->win[0].base;
749 p_dev->io.NumPorts1 = io->win[0].len;
750 if (io->nwin > 1) { 748 if (io->nwin > 1) {
751 p_dev->io.Attributes2 = p_dev->io.Attributes1; 749 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
752 p_dev->io.BasePort2 = io->win[1].base; 750 p_dev->resource[1]->start = io->win[1].base;
753 p_dev->io.NumPorts2 = io->win[1].len; 751 p_dev->resource[1]->end = io->win[1].len;
754 } 752 }
755 /* This reserves IO space but doesn't actually enable it */ 753 /* This reserves IO space but doesn't actually enable it */
756 return pcmcia_request_io(p_dev, &p_dev->io); 754 return pcmcia_request_io(p_dev);
757 } 755 }
758 756
759 return 0; 757 return 0;
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c
index c4cfcffc633e..9ee677f14b66 100644
--- a/drivers/staging/comedi/drivers/das08_cs.c
+++ b/drivers/staging/comedi/drivers/das08_cs.c
@@ -224,24 +224,23 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
224 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 224 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
225 225
226 /* IO window settings */ 226 /* IO window settings */
227 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 227 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
228 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 228 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
229 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 229 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
230 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 230 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
231 if (!(io->flags & CISTPL_IO_8BIT)) 231 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
232 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 232 p_dev->resource[0]->flags |=
233 if (!(io->flags & CISTPL_IO_16BIT)) 233 pcmcia_io_cfg_data_width(io->flags);
234 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
235 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 234 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
236 p_dev->io.BasePort1 = io->win[0].base; 235 p_dev->resource[0]->start = io->win[0].base;
237 p_dev->io.NumPorts1 = io->win[0].len; 236 p_dev->resource[0]->end = io->win[0].len;
238 if (io->nwin > 1) { 237 if (io->nwin > 1) {
239 p_dev->io.Attributes2 = p_dev->io.Attributes1; 238 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
240 p_dev->io.BasePort2 = io->win[1].base; 239 p_dev->resource[1]->start = io->win[1].base;
241 p_dev->io.NumPorts2 = io->win[1].len; 240 p_dev->resource[1]->end = io->win[1].len;
242 } 241 }
243 /* This reserves IO space but doesn't actually enable it */ 242 /* This reserves IO space but doesn't actually enable it */
244 return pcmcia_request_io(p_dev, &p_dev->io); 243 return pcmcia_request_io(p_dev);
245 } 244 }
246 return 0; 245 return 0;
247} 246}
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c
index 6d569579d677..7e41ad93703d 100644
--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -571,24 +571,22 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
571 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 571 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
572 572
573 /* IO window settings */ 573 /* IO window settings */
574 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 574 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
575 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 575 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
576 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 576 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
577 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 577 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
578 if (!(io->flags & CISTPL_IO_8BIT)) 578 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
579 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 579 p_dev->resource[0]->flags |=
580 if (!(io->flags & CISTPL_IO_16BIT)) 580 pcmcia_io_cfg_data_width(io->flags);
581 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 581 p_dev->resource[0]->start = io->win[0].base;
582 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 582 p_dev->resource[0]->end = io->win[0].len;
583 p_dev->io.BasePort1 = io->win[0].base;
584 p_dev->io.NumPorts1 = io->win[0].len;
585 if (io->nwin > 1) { 583 if (io->nwin > 1) {
586 p_dev->io.Attributes2 = p_dev->io.Attributes1; 584 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
587 p_dev->io.BasePort2 = io->win[1].base; 585 p_dev->resource[1]->start = io->win[1].base;
588 p_dev->io.NumPorts2 = io->win[1].len; 586 p_dev->resource[1]->end = io->win[1].len;
589 } 587 }
590 /* This reserves IO space but doesn't actually enable it */ 588 /* This reserves IO space but doesn't actually enable it */
591 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 589 if (pcmcia_request_io(p_dev) != 0)
592 return -ENODEV; 590 return -ENODEV;
593 } 591 }
594 592
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c
index 29e1daf6a9e6..b2483f86c242 100644
--- a/drivers/staging/comedi/drivers/ni_daq_dio24.c
+++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c
@@ -323,24 +323,22 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
323 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 323 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
324 324
325 /* IO window settings */ 325 /* IO window settings */
326 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 326 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
327 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 327 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
328 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 328 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
329 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 329 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
330 if (!(io->flags & CISTPL_IO_8BIT)) 330 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
331 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 331 p_dev->resource[0]->flags |=
332 if (!(io->flags & CISTPL_IO_16BIT)) 332 pcmcia_io_cfg_data_width(io->flags);
333 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 333 p_dev->resource[0]->start = io->win[0].base;
334 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 334 p_dev->resource[0]->end = io->win[0].len;
335 p_dev->io.BasePort1 = io->win[0].base;
336 p_dev->io.NumPorts1 = io->win[0].len;
337 if (io->nwin > 1) { 335 if (io->nwin > 1) {
338 p_dev->io.Attributes2 = p_dev->io.Attributes1; 336 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
339 p_dev->io.BasePort2 = io->win[1].base; 337 p_dev->resource[1]->start = io->win[1].base;
340 p_dev->io.NumPorts2 = io->win[1].len; 338 p_dev->resource[1]->end = io->win[1].len;
341 } 339 }
342 /* This reserves IO space but doesn't actually enable it */ 340 /* This reserves IO space but doesn't actually enable it */
343 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 341 if (pcmcia_request_io(p_dev) != 0)
344 return -ENODEV; 342 return -ENODEV;
345 } 343 }
346 344
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index fb10987a97b2..c1444b4a5b4c 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -301,24 +301,22 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
301 p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; 301 p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
302 302
303 /* IO window settings */ 303 /* IO window settings */
304 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 304 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
305 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 305 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
306 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 306 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
307 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 307 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
308 if (!(io->flags & CISTPL_IO_8BIT)) 308 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
309 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 309 p_dev->resource[0]->flags |=
310 if (!(io->flags & CISTPL_IO_16BIT)) 310 pcmcia_io_cfg_data_width(io->flags);
311 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 311 p_dev->resource[0]->start = io->win[0].base;
312 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 312 p_dev->resource[0]->end = io->win[0].len;
313 p_dev->io.BasePort1 = io->win[0].base;
314 p_dev->io.NumPorts1 = io->win[0].len;
315 if (io->nwin > 1) { 313 if (io->nwin > 1) {
316 p_dev->io.Attributes2 = p_dev->io.Attributes1; 314 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
317 p_dev->io.BasePort2 = io->win[1].base; 315 p_dev->resource[1]->start = io->win[1].base;
318 p_dev->io.NumPorts2 = io->win[1].len; 316 p_dev->resource[1]->end = io->win[1].len;
319 } 317 }
320 /* This reserves IO space but doesn't actually enable it */ 318 /* This reserves IO space but doesn't actually enable it */
321 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 319 if (pcmcia_request_io(p_dev) != 0)
322 return -ENODEV; 320 return -ENODEV;
323 } 321 }
324 322
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index f37dc22b4dbc..d50b6c409fe7 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -264,8 +264,8 @@ static const dev_info_t dev_info = "ni_mio_cs";
264 264
265static int cs_attach(struct pcmcia_device *link) 265static int cs_attach(struct pcmcia_device *link)
266{ 266{
267 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 267 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
268 link->io.NumPorts1 = 16; 268 link->resource[0]->end = 16;
269 link->conf.Attributes = CONF_ENABLE_IRQ; 269 link->conf.Attributes = CONF_ENABLE_IRQ;
270 link->conf.IntType = INT_MEMORY_AND_IO; 270 link->conf.IntType = INT_MEMORY_AND_IO;
271 271
@@ -310,13 +310,12 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev,
310{ 310{
311 int base, ret; 311 int base, ret;
312 312
313 p_dev->io.NumPorts1 = cfg->io.win[0].len; 313 p_dev->resource[0]->end = cfg->io.win[0].len;
314 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK; 314 p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
315 p_dev->io.NumPorts2 = 0;
316 315
317 for (base = 0x000; base < 0x400; base += 0x20) { 316 for (base = 0x000; base < 0x400; base += 0x20) {
318 p_dev->io.BasePort1 = base; 317 p_dev->resource[0]->start = base;
319 ret = pcmcia_request_io(p_dev, &p_dev->io); 318 ret = pcmcia_request_io(p_dev);
320 if (!ret) 319 if (!ret)
321 return 0; 320 return 0;
322 } 321 }
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 80b8d57c6842..25f4e67e3e89 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -1102,26 +1102,24 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
1102 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 1102 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1103 1103
1104 /* IO window settings */ 1104 /* IO window settings */
1105 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 1105 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
1106 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1106 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1107 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1107 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1108 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 1108 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1109 if (!(io->flags & CISTPL_IO_8BIT)) 1109 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1110 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 1110 p_dev->resource[0]->flags |=
1111 if (!(io->flags & CISTPL_IO_16BIT)) 1111 pcmcia_io_cfg_data_width(io->flags);
1112 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1112 p_dev->resource[0]->start = io->win[0].base;
1113 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 1113 p_dev->resource[0]->end = io->win[0].len;
1114 p_dev->io.BasePort1 = io->win[0].base;
1115 p_dev->io.NumPorts1 = io->win[0].len;
1116 if (io->nwin > 1) { 1114 if (io->nwin > 1) {
1117 p_dev->io.Attributes2 = p_dev->io.Attributes1; 1115 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
1118 p_dev->io.BasePort2 = io->win[1].base; 1116 p_dev->resource[1]->start = io->win[1].base;
1119 p_dev->io.NumPorts2 = io->win[1].len; 1117 p_dev->resource[1]->end = io->win[1].len;
1120 } 1118 }
1121 } 1119 }
1122 1120
1123 /* This reserves IO space but doesn't actually enable it */ 1121 /* This reserves IO space but doesn't actually enable it */
1124 return pcmcia_request_io(p_dev, &p_dev->io); 1122 return pcmcia_request_io(p_dev);
1125} 1123}
1126 1124
1127static void daqp_cs_config(struct pcmcia_device *link) 1125static void daqp_cs_config(struct pcmcia_device *link)
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c
index 23615378acf1..f15afd2050be 100644
--- a/drivers/staging/wlags49_h2/wl_cs.c
+++ b/drivers/staging/wlags49_h2/wl_cs.c
@@ -145,9 +145,8 @@ static int wl_adapter_attach(struct pcmcia_device *link)
145 return -ENOMEM; 145 return -ENOMEM;
146 } 146 }
147 147
148 link->io.NumPorts1 = HCF_NUM_IO_PORTS; 148 link->resource[0]->end = HCF_NUM_IO_PORTS;
149 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 149 link->resource[0]->flags = IO_DATA_PATH_WIDTH_16;
150 link->io.IOAddrLines = 6;
151 link->conf.Attributes = CONF_ENABLE_IRQ; 150 link->conf.Attributes = CONF_ENABLE_IRQ;
152 link->conf.IntType = INT_MEMORY_AND_IO; 151 link->conf.IntType = INT_MEMORY_AND_IO;
153 link->conf.ConfigIndex = 5; 152 link->conf.ConfigIndex = 5;
@@ -305,8 +304,9 @@ void wl_adapter_insert( struct pcmcia_device *link )
305 304
306 /* Do we need to allocate an interrupt? */ 305 /* Do we need to allocate an interrupt? */
307 link->conf.Attributes |= CONF_ENABLE_IRQ; 306 link->conf.Attributes |= CONF_ENABLE_IRQ;
307 link->io_lines = 6;
308 308
309 ret = pcmcia_request_io(link, &link->io); 309 ret = pcmcia_request_io(link);
310 if (ret != 0) 310 if (ret != 0)
311 goto failed; 311 goto failed;
312 312
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index a801036392cd..a1900e502518 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -32,9 +32,8 @@ static int ixj_probe(struct pcmcia_device *p_dev)
32{ 32{
33 dev_dbg(&p_dev->dev, "ixj_attach()\n"); 33 dev_dbg(&p_dev->dev, "ixj_attach()\n");
34 /* Create new ixj device */ 34 /* Create new ixj device */
35 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 35 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
36 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 36 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
37 p_dev->io.IOAddrLines = 3;
38 p_dev->conf.IntType = INT_MEMORY_AND_IO; 37 p_dev->conf.IntType = INT_MEMORY_AND_IO;
39 p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL); 38 p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
40 if (!p_dev->priv) { 39 if (!p_dev->priv) {
@@ -120,13 +119,14 @@ static int ixj_config_check(struct pcmcia_device *p_dev,
120{ 119{
121 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 120 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
122 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 121 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
123 p_dev->io.BasePort1 = io->win[0].base; 122 p_dev->resource[0]->start = io->win[0].base;
124 p_dev->io.NumPorts1 = io->win[0].len; 123 p_dev->resource[0]->end = io->win[0].len;
124 p_dev->io_lines = 3;
125 if (io->nwin == 2) { 125 if (io->nwin == 2) {
126 p_dev->io.BasePort2 = io->win[1].base; 126 p_dev->resource[1]->start = io->win[1].base;
127 p_dev->io.NumPorts2 = io->win[1].len; 127 p_dev->resource[1]->end = io->win[1].len;
128 } 128 }
129 if (!pcmcia_request_io(p_dev, &p_dev->io)) 129 if (!pcmcia_request_io(p_dev))
130 return 0; 130 return 0;
131 } 131 }
132 return -ENODEV; 132 return -ENODEV;
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index 22e04f206304..0e13a00eb2ed 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -162,16 +162,16 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev,
162 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 162 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
163 163
164 /* IO window settings */ 164 /* IO window settings */
165 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 165 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
166 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 166 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
167 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 167 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
168 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
168 169
169 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 170 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
170 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 171 p_dev->resource[0]->start = io->win[0].base;
171 p_dev->io.BasePort1 = io->win[0].base; 172 p_dev->resource[0]->end = io->win[0].len;
172 p_dev->io.NumPorts1 = io->win[0].len;
173 173
174 return pcmcia_request_io(p_dev, &p_dev->io); 174 return pcmcia_request_io(p_dev);
175 } 175 }
176 pcmcia_disable_device(p_dev); 176 pcmcia_disable_device(p_dev);
177 return -ENODEV; 177 return -ENODEV;
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 0cd8c70d8aaa..ad71bb5a8658 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -56,23 +56,6 @@ typedef struct config_req_t {
56#define INT_CARDBUS 0x04 56#define INT_CARDBUS 0x04
57#define INT_ZOOMED_VIDEO 0x08 57#define INT_ZOOMED_VIDEO 0x08
58 58
59/* For RequestIO and ReleaseIO */
60typedef struct io_req_t {
61 u_int BasePort1;
62 u_int NumPorts1;
63 u_int Attributes1;
64 u_int BasePort2;
65 u_int NumPorts2;
66 u_int Attributes2;
67 u_int IOAddrLines;
68} io_req_t;
69
70/* Attributes for RequestIO and ReleaseIO */
71#define IO_DATA_PATH_WIDTH 0x18
72#define IO_DATA_PATH_WIDTH_8 0x00
73#define IO_DATA_PATH_WIDTH_16 0x08
74#define IO_DATA_PATH_WIDTH_AUTO 0x10
75
76/* Bits in IRQInfo1 field */ 59/* Bits in IRQInfo1 field */
77#define IRQ_NMI_ID 0x01 60#define IRQ_NMI_ID 0x01
78#define IRQ_IOCK_ID 0x02 61#define IRQ_IOCK_ID 0x02
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 3dafd7db34df..0748bec0a87a 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -80,7 +80,6 @@ struct pcmcia_device {
80 struct list_head socket_device_list; 80 struct list_head socket_device_list;
81 81
82 /* deprecated, will be cleaned up soon */ 82 /* deprecated, will be cleaned up soon */
83 io_req_t io;
84 config_req_t conf; 83 config_req_t conf;
85 window_handle_t win; 84 window_handle_t win;
86 85
@@ -88,6 +87,8 @@ struct pcmcia_device {
88 unsigned int irq; 87 unsigned int irq;
89 struct resource *resource[MAX_IO_WIN]; 88 struct resource *resource[MAX_IO_WIN];
90 89
90 unsigned int io_lines; /* number of I/O lines */
91
91 /* Is the device suspended? */ 92 /* Is the device suspended? */
92 u16 suspended:1; 93 u16 suspended:1;
93 94
@@ -179,7 +180,7 @@ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val);
179int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val); 180int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val);
180 181
181/* device configuration */ 182/* device configuration */
182int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); 183int pcmcia_request_io(struct pcmcia_device *p_dev);
183 184
184int __must_check 185int __must_check
185__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, 186__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,
206int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 207int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
207void pcmcia_disable_device(struct pcmcia_device *p_dev); 208void pcmcia_disable_device(struct pcmcia_device *p_dev);
208 209
210/* IO ports */
211#define IO_DATA_PATH_WIDTH 0x18
212#define IO_DATA_PATH_WIDTH_8 0x00
213#define IO_DATA_PATH_WIDTH_16 0x08
214#define IO_DATA_PATH_WIDTH_AUTO 0x10
215
216/* convert flag found in cfgtable to data path width parameter */
217static inline int pcmcia_io_cfg_data_width(unsigned int flags)
218{
219 if (!(flags & CISTPL_IO_8BIT))
220 return IO_DATA_PATH_WIDTH_16;
221 if (!(flags & CISTPL_IO_16BIT))
222 return IO_DATA_PATH_WIDTH_8;
223 return IO_DATA_PATH_WIDTH_AUTO;
224}
225
209#endif /* __KERNEL__ */ 226#endif /* __KERNEL__ */
210 227
211#endif /* _LINUX_DS_H */ 228#endif /* _LINUX_DS_H */
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 9f897bca0615..7ab9174a8a84 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -139,8 +139,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
139 pdacf->p_dev = link; 139 pdacf->p_dev = link;
140 link->priv = pdacf; 140 link->priv = pdacf;
141 141
142 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 142 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
143 link->io.NumPorts1 = 16; 143 link->resource[0]->end = 16;
144 144
145 link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; 145 link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
146 link->conf.IntType = INT_MEMORY_AND_IO; 146 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -219,7 +219,7 @@ static int pdacf_config(struct pcmcia_device *link)
219 snd_printdd(KERN_DEBUG "pdacf_config called\n"); 219 snd_printdd(KERN_DEBUG "pdacf_config called\n");
220 link->conf.ConfigIndex = 0x5; 220 link->conf.ConfigIndex = 0x5;
221 221
222 ret = pcmcia_request_io(link, &link->io); 222 ret = pcmcia_request_io(link);
223 if (ret) 223 if (ret)
224 goto failed; 224 goto failed;
225 225
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index f23c235013a4..a6edfc3be29a 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -159,8 +159,8 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
159 vxp->p_dev = link; 159 vxp->p_dev = link;
160 link->priv = chip; 160 link->priv = chip;
161 161
162 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 162 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
163 link->io.NumPorts1 = 16; 163 link->resource[0]->end = 16;
164 164
165 link->conf.Attributes = CONF_ENABLE_IRQ; 165 link->conf.Attributes = CONF_ENABLE_IRQ;
166 link->conf.IntType = INT_MEMORY_AND_IO; 166 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -226,7 +226,7 @@ static int vxpocket_config(struct pcmcia_device *link)
226 strcpy(chip->card->driver, vxp440_hw.name); 226 strcpy(chip->card->driver, vxp440_hw.name);
227 } 227 }
228 228
229 ret = pcmcia_request_io(link, &link->io); 229 ret = pcmcia_request_io(link);
230 if (ret) 230 if (ret)
231 goto failed; 231 goto failed;
232 232