Browse Source

pcmcia: do not use io_req_t when calling pcmcia_request_io()

Instead of io_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
ranges. After a call to pcmcia_request_io(), the ports found there
are reserved, after calling pcmcia_request_configuration(), they may
be used.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Michael Buesch <mb@bu3sch.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
imx_3.10.17_1.0.0_ga
Dominik Brodowski 10 years ago
parent
commit
90abdc3b97
57 changed files with 527 additions and 584 deletions
  1. +7
    -0
      Documentation/pcmcia/driver-changes.txt
  2. +15
    -14
      drivers/ata/pata_pcmcia.c
  3. +6
    -7
      drivers/bluetooth/bluecard_cs.c
  4. +9
    -9
      drivers/bluetooth/bt3c_cs.c
  5. +9
    -9
      drivers/bluetooth/btuart_cs.c
  6. +10
    -11
      drivers/bluetooth/dtl1_cs.c
  7. +6
    -11
      drivers/char/pcmcia/cm4000_cs.c
  8. +6
    -14
      drivers/char/pcmcia/cm4040_cs.c
  9. +5
    -5
      drivers/char/pcmcia/ipwireless/main.c
  10. +9
    -12
      drivers/char/pcmcia/synclink_cs.c
  11. +16
    -14
      drivers/ide/ide-cs.c
  12. +5
    -10
      drivers/isdn/hardware/avm/avm_cs.c
  13. +8
    -12
      drivers/isdn/hisax/avma1_cs.c
  14. +8
    -7
      drivers/isdn/hisax/elsa_cs.c
  15. +13
    -15
      drivers/isdn/hisax/sedlbauer_cs.c
  16. +8
    -7
      drivers/isdn/hisax/teles_cs.c
  17. +6
    -5
      drivers/net/pcmcia/3c574_cs.c
  18. +6
    -5
      drivers/net/pcmcia/3c589_cs.c
  19. +21
    -19
      drivers/net/pcmcia/axnet_cs.c
  20. +11
    -8
      drivers/net/pcmcia/com20020_cs.c
  21. +16
    -15
      drivers/net/pcmcia/fmvj18x_cs.c
  22. +7
    -7
      drivers/net/pcmcia/ibmtr_cs.c
  23. +4
    -4
      drivers/net/pcmcia/nmclan_cs.c
  24. +21
    -19
      drivers/net/pcmcia/pcnet_cs.c
  25. +21
    -22
      drivers/net/pcmcia/smc91c92_cs.c
  26. +17
    -17
      drivers/net/pcmcia/xirc2ps_cs.c
  27. +10
    -12
      drivers/net/wireless/airo_cs.c
  28. +10
    -12
      drivers/net/wireless/atmel_cs.c
  29. +0
    -4
      drivers/net/wireless/b43/pcmcia.c
  30. +11
    -17
      drivers/net/wireless/hostap/hostap_cs.c
  31. +4
    -4
      drivers/net/wireless/libertas/if_cs.c
  32. +11
    -13
      drivers/net/wireless/orinoco/orinoco_cs.c
  33. +11
    -13
      drivers/net/wireless/orinoco/spectrum_cs.c
  34. +2
    -3
      drivers/net/wireless/ray_cs.c
  35. +6
    -6
      drivers/net/wireless/wl3501_cs.c
  36. +8
    -8
      drivers/parport/parport_cs.c
  37. +10
    -27
      drivers/pcmcia/pcmcia_resource.c
  38. +7
    -7
      drivers/scsi/pcmcia/aha152x_stub.c
  39. +5
    -5
      drivers/scsi/pcmcia/fdomain_stub.c
  40. +14
    -16
      drivers/scsi/pcmcia/nsp_cs.c
  41. +7
    -7
      drivers/scsi/pcmcia/qlogic_stub.c
  42. +7
    -7
      drivers/scsi/pcmcia/sym53c500_cs.c
  43. +19
    -18
      drivers/serial/serial_cs.c
  44. +11
    -13
      drivers/staging/comedi/drivers/cb_das16_cs.c
  45. +11
    -12
      drivers/staging/comedi/drivers/das08_cs.c
  46. +11
    -13
      drivers/staging/comedi/drivers/ni_daq_700.c
  47. +11
    -13
      drivers/staging/comedi/drivers/ni_daq_dio24.c
  48. +11
    -13
      drivers/staging/comedi/drivers/ni_labpc_cs.c
  49. +6
    -7
      drivers/staging/comedi/drivers/ni_mio_cs.c
  50. +11
    -13
      drivers/staging/comedi/drivers/quatech_daqp_cs.c
  51. +4
    -4
      drivers/staging/wlags49_h2/wl_cs.c
  52. +8
    -8
      drivers/telephony/ixj_pcmcia.c
  53. +6
    -6
      drivers/usb/host/sl811_cs.c
  54. +0
    -17
      include/pcmcia/cs.h
  55. +19
    -2
      include/pcmcia/ds.h
  56. +3
    -3
      sound/pcmcia/pdaudiocf/pdaudiocf.c
  57. +3
    -3
      sound/pcmcia/vx/vxpocket.c

+ 7
- 0
Documentation/pcmcia/driver-changes.txt View File

@ -1,4 +1,11 @@
This file details changes in 2.6 which affect PCMCIA card driver authors:
* pcmcia_request_io changes (as of 2.6.36)
Instead of io_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
ranges. After a call to pcmcia_request_io(), the ports found there
are reserved, after calling pcmcia_request_configuration(), they may
be used.
* No dev_info_t, no cs_types.h (as of 2.6.36)
dev_info_t and a few other typedefs are removed. No longer use them
in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as


+ 15
- 14
drivers/ata/pata_pcmcia.c View File

@ -200,21 +200,23 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
pdev->io.BasePort1 = io->win[0].base;
pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
if (!(io->flags & CISTPL_IO_16BIT))
pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
pdev->resource[0]->start = io->win[0].base;
if (!(io->flags & CISTPL_IO_16BIT)) {
pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
}
if (io->nwin == 2) {
pdev->io.NumPorts1 = 8;
pdev->io.BasePort2 = io->win[1].base;
pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1;
if (pcmcia_request_io(pdev, &pdev->io) != 0)
pdev->resource[0]->end = 8;
pdev->resource[1]->start = io->win[1].base;
pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
if (pcmcia_request_io(pdev) != 0)
return -ENODEV;
stk->ctl_base = pdev->resource[1]->start;
} else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
pdev->io.NumPorts1 = io->win[0].len;
pdev->io.NumPorts2 = 0;
if (pcmcia_request_io(pdev, &pdev->io) != 0)
pdev->resource[0]->end = io->win[0].len;
pdev->resource[1]->end = 0;
if (pcmcia_request_io(pdev) != 0)
return -ENODEV;
stk->ctl_base = pdev->resource[0]->start + 0x0e;
} else
@ -245,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
struct ata_port_operations *ops = &pcmcia_port_ops;
/* Set up attributes in order to probe card and get resources */
pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
pdev->io.IOAddrLines = 3;
pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
pdev->conf.Attributes = CONF_ENABLE_IRQ;
pdev->conf.IntType = INT_MEMORY_AND_IO;


+ 6
- 7
drivers/bluetooth/bluecard_cs.c View File

@ -865,9 +865,6 @@ static int bluecard_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -890,12 +887,14 @@ static int bluecard_config(struct pcmcia_device *link)
int i, n;
link->conf.ConfigIndex = 0x20;
link->io.NumPorts1 = 64;
link->io.IOAddrLines = 6;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 64;
link->io_lines = 6;
for (n = 0; n < 0x400; n += 0x40) {
link->io.BasePort1 = n ^ 0x300;
i = pcmcia_request_io(link, &link->io);
link->resource[0]->start = n ^ 0x300;
i = pcmcia_request_io(link);
if (i == 0)
break;
}


+ 9
- 9
drivers/bluetooth/bt3c_cs.c View File

@ -657,8 +657,8 @@ static int bt3c_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -683,14 +683,14 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
{
unsigned long try = (unsigned long) priv_data;
p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
(cf->io.win[0].base != 0)) {
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.IOAddrLines = (try == 0) ? 16 :
cf->io.flags & CISTPL_IO_LINES_MASK;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev))
return 0;
}
return -ENODEV;
@ -707,9 +707,9 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
for (j = 0; j < 5; j++) {
p_dev->io.BasePort1 = base[j];
p_dev->io.IOAddrLines = base[j] ? 16 : 3;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = base[j];
p_dev->io_lines = base[j] ? 16 : 3;
if (!pcmcia_request_io(p_dev))
return 0;
}
}


+ 9
- 9
drivers/bluetooth/btuart_cs.c View File

@ -586,8 +586,8 @@ static int btuart_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -612,14 +612,14 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
{
int *try = priv_data;
p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
(cf->io.win[0].base != 0)) {
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.IOAddrLines = (*try == 0) ? 16 :
cf->io.flags & CISTPL_IO_LINES_MASK;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev))
return 0;
}
return -ENODEV;
@ -636,9 +636,9 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
for (j = 0; j < 5; j++) {
p_dev->io.BasePort1 = base[j];
p_dev->io.IOAddrLines = base[j] ? 16 : 3;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = base[j];
p_dev->io_lines = base[j] ? 16 : 3;
if (!pcmcia_request_io(p_dev))
return 0;
}
}


+ 10
- 11
drivers/bluetooth/dtl1_cs.c View File

@ -572,8 +572,8 @@ static int dtl1_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -597,14 +597,13 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev,
unsigned int vcc,
void *priv_data)
{
if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */
p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
if (!pcmcia_request_io(p_dev, &p_dev->io))
return 0;
}
return -ENODEV;
if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
return -ENODEV;
p_dev->resource[0]->start = cf->io.win[0].base;
p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
}
static int dtl1_config(struct pcmcia_device *link)
@ -613,7 +612,7 @@ static int dtl1_config(struct pcmcia_device *link)
int i;
/* Look for a generic full-sized window */
link->io.NumPorts1 = 8;
link->resource[0]->end = 8;
if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
goto failed;


+ 6
- 11
drivers/char/pcmcia/cm4000_cs.c View File

@ -1751,17 +1751,12 @@ static int cm4000_config_check(struct pcmcia_device *p_dev,
if (!cfg->io.nwin)
return -ENODEV;
/* Get the IOaddr */
p_dev->io.BasePort1 = cfg->io.win[0].base;
p_dev->io.NumPorts1 = cfg->io.win[0].len;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (!(cfg->io.flags & CISTPL_IO_8BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
if (!(cfg->io.flags & CISTPL_IO_16BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev, &p_dev->io);
p_dev->resource[0]->start = cfg->io.win[0].base;
p_dev->resource[0]->end = cfg->io.win[0].len;
p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
}
static int cm4000_config(struct pcmcia_device * link, int devno)


+ 6
- 14
drivers/char/pcmcia/cm4040_cs.c View File

@ -527,16 +527,12 @@ static int cm4040_config_check(struct pcmcia_device *p_dev,
return -ENODEV;
/* Get the IOaddr */
p_dev->io.BasePort1 = cfg->io.win[0].base;
p_dev->io.NumPorts1 = cfg->io.win[0].len;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (!(cfg->io.flags & CISTPL_IO_8BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
if (!(cfg->io.flags & CISTPL_IO_16BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
rc = pcmcia_request_io(p_dev, &p_dev->io);
p_dev->resource[0]->start = cfg->io.win[0].base;
p_dev->resource[0]->end = cfg->io.win[0].len;
p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
rc = pcmcia_request_io(p_dev);
dev_printk(KERN_INFO, &p_dev->dev,
"pcmcia_request_io returned 0x%x\n", rc);
return rc;
@ -548,10 +544,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
struct reader_dev *dev;
int fail_rc;
link->io.BasePort2 = 0;
link->io.NumPorts2 = 0;
link->io.Attributes2 = 0;
if (pcmcia_loop_config(link, cm4040_config_check, NULL))
goto cs_release;


+ 5
- 5
drivers/char/pcmcia/ipwireless/main.c View File

@ -88,15 +88,15 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
memreq_t memreq_common_memory;
int ret;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
p_dev->io.BasePort1 = cfg->io.win[0].base;
p_dev->io.NumPorts1 = cfg->io.win[0].len;
p_dev->io.IOAddrLines = 16;
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
p_dev->resource[0]->start = cfg->io.win[0].base;
p_dev->resource[0]->end = cfg->io.win[0].len;
/* 0x40 causes it to generate level mode interrupts. */
/* 0x04 enables IREQ pin. */
p_dev->conf.ConfigIndex = cfg->index | 0x44;
ret = pcmcia_request_io(p_dev, &p_dev->io);
p_dev->io_lines = 16;
ret = pcmcia_request_io(p_dev);
if (ret)
return ret;


+ 9
- 12
drivers/char/pcmcia/synclink_cs.c View File

@ -571,18 +571,15 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
unsigned int vcc,
void *priv_data)
{
if (cfg->io.nwin > 0) {
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (!(cfg->io.flags & CISTPL_IO_8BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
if (!(cfg->io.flags & CISTPL_IO_16BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
p_dev->io.BasePort1 = cfg->io.win[0].base;
p_dev->io.NumPorts1 = cfg->io.win[0].len;
return pcmcia_request_io(p_dev, &p_dev->io);
}
return -ENODEV;
if (!cfg->io.nwin)
return -ENODEV;
p_dev->resource[0]->start = cfg->io.win[0].base;
p_dev->resource[0]->end = cfg->io.win[0].len;
p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags);
p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
}
static int mgslpc_config(struct pcmcia_device *link)


+ 16
- 14
drivers/ide/ide-cs.c View File

@ -97,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 3;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -228,22 +227,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
pdev->conf.ConfigIndex = cfg->index;
pdev->io.BasePort1 = io->win[0].base;
pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
if (!(io->flags & CISTPL_IO_16BIT))
pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
pdev->resource[0]->start = io->win[0].base;
if (!(io->flags & CISTPL_IO_16BIT)) {
pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
}
if (io->nwin == 2) {
pdev->io.NumPorts1 = 8;
pdev->io.BasePort2 = io->win[1].base;
pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1;
if (pcmcia_request_io(pdev, &pdev->io) != 0)
pdev->resource[0]->end = 8;
pdev->resource[1]->start = io->win[1].base;
pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
if (pcmcia_request_io(pdev) != 0)
return -ENODEV;
stk->ctl_base = pdev->resource[1]->start;
} else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
pdev->io.NumPorts1 = io->win[0].len;
pdev->io.NumPorts2 = 0;
if (pcmcia_request_io(pdev, &pdev->io) != 0)
pdev->resource[0]->end = io->win[0].len;
pdev->resource[1]->end = 0;
if (pcmcia_request_io(pdev) != 0)
return -ENODEV;
stk->ctl_base = pdev->resource[0]->start + 0x0e;
} else


+ 5
- 10
drivers/isdn/hardware/avm/avm_cs.c View File

@ -75,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
{
/* The io structure describes IO port mapping */
p_dev->io.NumPorts1 = 16;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.NumPorts2 = 0;
p_dev->resource[0]->end = 16;
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
/* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@ -119,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
if (cf->io.nwin <= 0)
return -ENODEV;
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.NumPorts1 = cf->io.win[0].len;
p_dev->io.NumPorts2 = 0;
printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
p_dev->io.BasePort1,
p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
return pcmcia_request_io(p_dev, &p_dev->io);
p_dev->resource[0]->start = cf->io.win[0].base;
p_dev->resource[0]->end = cf->io.win[0].len;
return pcmcia_request_io(p_dev);
}
static int avmcs_config(struct pcmcia_device *link)


+ 8
- 12
drivers/isdn/hisax/avma1_cs.c View File

@ -78,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
/* The io structure describes IO port mapping */
p_dev->io.NumPorts1 = 16;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.NumPorts2 = 16;
p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
p_dev->io.IOAddrLines = 5;
p_dev->resource[0]->end = 16;
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
p_dev->resource[1]->end = 16;
p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
/* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@ -126,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
if (cf->io.nwin <= 0)
return -ENODEV;
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.NumPorts1 = cf->io.win[0].len;
p_dev->io.NumPorts2 = 0;
printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n",
p_dev->io.BasePort1,
p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
return pcmcia_request_io(p_dev, &p_dev->io);
p_dev->resource[0]->start = cf->io.win[0].base;
p_dev->resource[0]->end = cf->io.win[0].len;
p_dev->io_lines = 5;
return pcmcia_request_io(p_dev);
}


+ 8
- 7
drivers/isdn/hisax/elsa_cs.c View File

@ -126,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
and attributes of IO windows) are fixed by the nature of the
device, and can be hard-wired here.
*/
link->io.NumPorts1 = 8;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 3;
link->resource[0]->end = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -173,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
{
int j;
p_dev->io_lines = 3;
if ((cf->io.nwin > 0) && cf->io.win[0].base) {
printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
p_dev->io.BasePort1 = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev))
return 0;
} else {
printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
for (j = 0x2f0; j > 0x100; j -= 0x10) {
p_dev->io.BasePort1 = j;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = j;
if (!pcmcia_request_io(p_dev))
return 0;
}
}


+ 13
- 15
drivers/isdn/hisax/sedlbauer_cs.c View File

@ -129,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
/* from old sedl_cs
*/
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 8;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 3;
link->resource[0]->end = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -201,23 +200,22 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (!(io->flags & CISTPL_IO_8BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
if (!(io->flags & CISTPL_IO_16BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.BasePort1 = io->win[0].base;
p_dev->io.NumPorts1 = io->win[0].len;
p_dev->resource[0]->start = io->win[0].base;
p_dev->resource[0]->end = io->win[0].len;
p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
p_dev->resource[0]->flags |=
pcmcia_io_cfg_data_width(io->flags);
if (io->nwin > 1) {
p_dev->io.Attributes2 = p_dev->io.Attributes1;
p_dev->io.BasePort2 = io->win[1].base;
p_dev->io.NumPorts2 = io->win[1].len;
p_dev->resource[1]->flags = p_dev->resource[0]->flags;
p_dev->resource[1]->start = io->win[1].base;
p_dev->resource[1]->end = io->win[1].len;
}
/* This reserves IO space but doesn't actually enable it */
if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
p_dev->io_lines = 3;
if (pcmcia_request_io(p_dev) != 0)
return -ENODEV;
}


+ 8
- 7
drivers/isdn/hisax/teles_cs.c View File

@ -106,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)
and attributes of IO windows) are fixed by the nature of the
device, and can be hard-wired here.
*/
link->io.NumPorts1 = 96;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 5;
link->resource[0]->end = 96;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -153,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
{
int j;
p_dev->io_lines = 5;
if ((cf->io.nwin > 0) && cf->io.win[0].base) {
printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");
p_dev->io.BasePort1 = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = cf->io.win[0].base;
if (!pcmcia_request_io(p_dev))
return 0;
} else {
printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");
for (j = 0x2f0; j > 0x100; j -= 0x10) {
p_dev->io.BasePort1 = j;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = j;
if (!pcmcia_request_io(p_dev))
return 0;
}
}


+ 6
- 5
drivers/net/pcmcia/3c574_cs.c View File

@ -278,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link)
lp->p_dev = link;
spin_lock_init(&lp->window_lock);
link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->resource[0]->end = 32;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
@ -337,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "3c574_config()\n");
link->io.IOAddrLines = 16;
link->io_lines = 16;
for (i = j = 0; j < 0x400; j += 0x20) {
link->io.BasePort1 = j ^ 0x300;
i = pcmcia_request_io(link, &link->io);
link->resource[0]->start = j ^ 0x300;
i = pcmcia_request_io(link);
if (i == 0)
break;
}


+ 6
- 5
drivers/net/pcmcia/3c589_cs.c View File

@ -213,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link)
lp->p_dev = link;
spin_lock_init(&lp->lock);
link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->resource[0]->end = 16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -277,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link)
"3Com card??\n");
multi = (link->card_id == PRODID_3COM_3C562);
link->io_lines = 16;
/* For the 3c562, the base address must be xx00-xx7f */
link->io.IOAddrLines = 16;
for (i = j = 0; j < 0x400; j += 0x10) {
if (multi && (j & 0x80)) continue;
link->io.BasePort1 = j ^ 0x300;
i = pcmcia_request_io(link, &link->io);
link->resource[0]->start = j ^ 0x300;
i = pcmcia_request_io(link);
if (i == 0)
break;
}


+ 21
- 19
drivers/net/pcmcia/axnet_cs.c View File

@ -259,28 +259,30 @@ static int get_prom(struct pcmcia_device *link)
static int try_io_port(struct pcmcia_device *link)
{
int j, ret;
if (link->io.NumPorts1 == 32) {
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
if (link->resource[0]->end == 32) {
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
/* for master/slave multifunction cards */
if (link->io.NumPorts2 > 0)
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
if (link->resource[1]->end > 0)
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
} else {
/* This should be two 16-port windows */
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
}
if (link->io.BasePort1 == 0) {
link->io.IOAddrLines = 16;
if (link->resource[0]->start == 0) {
for (j = 0; j < 0x400; j += 0x20) {
link->io.BasePort1 = j ^ 0x300;
link->io.BasePort2 = (j ^ 0x300) + 0x10;
ret = pcmcia_request_io(link, &link->io);
link->resource[0]->start = j ^ 0x300;
link->resource[1]->start = (j ^ 0x300) + 0x10;
link->io_lines = 16;
ret = pcmcia_request_io(link);
if (ret == 0)
return ret;
}
return ret;
} else {
return pcmcia_request_io(link, &link->io);
return pcmcia_request_io(link);
}
}
@ -301,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
network function with window 0, and serial with window 1 */
if (io->nwin > 1) {
i = (io->win[1].len > io->win[0].len);
p_dev->io.BasePort2 = io->win[1-i].base;
p_dev->io.NumPorts2 = io->win[1-i].len;
p_dev->resource[1]->start = io->win[1-i].base;
p_dev->resource[1]->end = io->win[1-i].len;
} else {
i = p_dev->io.NumPorts2 = 0;
i = p_dev->resource[1]->end = 0;
}
p_dev->io.BasePort1 = io->win[i].base;
p_dev->io.NumPorts1 = io->win[i].len;
p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32)
p_dev->resource[0]->start = io->win[i].base;
p_dev->resource[0]->end = io->win[i].len;
p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
return try_io_port(p_dev);
return -ENODEV;


+ 11
- 8
drivers/net/pcmcia/com20020_cs.c View File

@ -158,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev)
/* fill in our module parameters as defaults */
dev->dev_addr[0] = node;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.NumPorts1 = 16;
p_dev->io.IOAddrLines = 16;
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
p_dev->resource[0]->end = 16;
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.IntType = INT_MEMORY_AND_IO;
@ -245,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "com20020_config\n");
dev_dbg(&link->dev, "baseport1 is %Xh\n", link->io.BasePort1);
dev_dbg(&link->dev, "baseport1 is %Xh\n",
(unsigned int) link->resource[0]->start);
i = -ENODEV;
if (!link->io.BasePort1)
link->io_lines = 16;
if (!link->resource[0]->start)
{
for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
{
link->io.BasePort1 = ioaddr;
i = pcmcia_request_io(link, &link->io);
link->resource[0]->start = ioaddr;
i = pcmcia_request_io(link);
if (i == 0)
break;
}
}
else
i = pcmcia_request_io(link, &link->io);
i = pcmcia_request_io(link);
if (i != 0)
{


+ 16
- 15
drivers/net/pcmcia/fmvj18x_cs.c View File

@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
lp->base = NULL;
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 5;
link->resource[0]->end = 32;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link)
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
for (i = 0; i < 5; i++) {
link->io.BasePort2 = serial_base[i];
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
if (link->io.BasePort2 == 0) {
link->io.NumPorts2 = 0;
link->resource[1]->start = serial_base[i];
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
if (link->resource[1]->start == 0) {
link->resource[1]->end = 0;
printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
}
ret = pcmcia_request_io(link, &link->io);
ret = pcmcia_request_io(link);
if (ret == 0)
return ret;
}
@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
0x380,0x3c0 only for ioport.
*/
for (ioaddr = 0x300; ioaddr < 0x3e0; ioaddr += 0x20) {
link->io.BasePort1 = ioaddr;
ret = pcmcia_request_io(link, &link->io);
link->resource[0]->start = ioaddr;
ret = pcmcia_request_io(link);
if (ret == 0) {
/* calculate ConfigIndex value */
link->conf.ConfigIndex =
@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "fmvj18x_config\n");
link->io_lines = 5;
len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
kfree(buf);
@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)
/* MultiFunction Card */
link->conf.ConfigBase = 0x800;
link->conf.ConfigIndex = 0x47;
link->io.NumPorts2 = 8;
link->resource[1]->end = 8;
}
break;
case MANFID_NEC:
cardtype = NEC; /* MultiFunction Card */
link->conf.ConfigBase = 0x800;
link->conf.ConfigIndex = 0x47;
link->io.NumPorts2 = 8;
link->resource[1]->end = 8;
break;
case MANFID_KME:
cardtype = KME; /* MultiFunction Card */
link->conf.ConfigBase = 0x800;
link->conf.ConfigIndex = 0x47;
link->io.NumPorts2 = 8;
link->resource[1]->end = 8;
break;
case MANFID_CONTEC:
cardtype = CONTEC;
@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
}
}
if (link->io.NumPorts2 != 0) {
if (link->resource[1]->end != 0) {
ret = mfc_try_io_port(link);
if (ret != 0) goto failed;
} else if (cardtype == UNGERMANN) {
ret = ungermann_try_io_port(link);
if (ret != 0) goto failed;
} else {
ret = pcmcia_request_io(link, &link->io);
ret = pcmcia_request_io(link);
if (ret)
goto failed;
}


+ 7
- 7
drivers/net/pcmcia/ibmtr_cs.c View File

@ -151,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
link->priv = info;
info->ti = netdev_priv(dev);
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 4;
link->io.IOAddrLines = 16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 4;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;
@ -218,16 +217,17 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "ibmtr_config\n");
link->conf.ConfigIndex = 0x61;
link->io_lines = 16;
/* Determine if this is PRIMARY or ALTERNATE. */
/* Try PRIMARY card at 0xA20-0xA23 */
link->io.BasePort1 = 0xA20;
i = pcmcia_request_io(link, &link->io);
link->resource[0]->start = 0xA20;
i = pcmcia_request_io(link);
if (i != 0) {
/* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
link->io.BasePort1 = 0xA24;
ret = pcmcia_request_io(link, &link->io);
link->resource[0]->start = 0xA24;
ret = pcmcia_request_io(link);
if (ret)
goto failed;
}


+ 4
- 4
drivers/net/pcmcia/nmclan_cs.c View File

@ -458,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link)
link->priv = dev;
spin_lock_init(&lp->bank_lock);
link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 5;
link->resource[0]->end = 32;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
@ -644,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "nmclan_config\n");
ret = pcmcia_request_io(link, &link->io);
link->io_lines = 5;
ret = pcmcia_request_io(link);
if (ret)
goto failed;
ret = pcmcia_request_exclusive_irq(link, mace_interrupt);


+ 21
- 19
drivers/net/pcmcia/pcnet_cs.c View File

@ -477,29 +477,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
static int try_io_port(struct pcmcia_device *link)
{
int j, ret;
if (link->io.NumPorts1 == 32) {
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (link->io.NumPorts2 > 0) {
link->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
link->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
if (link->resource[0]->end == 32) {
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
if (link->resource[1]->end > 0) {
/* for master/slave multifunction cards */
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
}
} else {
/* This should be two 16-port windows */
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
}
if (link->io.BasePort1 == 0) {
link->io.IOAddrLines = 16;
if (link->resource[0]->start == 0) {
for (j = 0; j < 0x400; j += 0x20) {
link->io.BasePort1 = j ^ 0x300;
link->io.BasePort2 = (j ^ 0x300) + 0x10;
ret = pcmcia_request_io(link, &link->io);
link->resource[0]->start = j ^ 0x300;
link->resource[1]->start = (j ^ 0x300) + 0x10;
link->io_lines = 16;
ret = pcmcia_request_io(link);
if (ret == 0)
return ret;
}
return ret;
} else {
return pcmcia_request_io(link, &link->io);
return pcmcia_request_io(link);
}
}
@ -520,18 +522,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,
network function with window 0, and serial with window 1 */
if (io->nwin > 1) {
i = (io->win[1].len > io->win[0].len);
p_dev->io.BasePort2 = io->win[1-i].base;
p_dev->io.NumPorts2 = io->win[1-i].len;
p_dev->resource[1]->start = io->win[1-i].base;
p_dev->resource[1]->end = io->win[1-i].len;
} else {
i = p_dev->io.NumPorts2 = 0;
i = p_dev->resource[1]->end = 0;
}
*has_shmem = ((cfg->mem.nwin == 1) &&
(cfg->mem.win[0].len >= 0x4000));
p_dev->io.BasePort1 = io->win[i].base;
p_dev->io.NumPorts1 = io->win[i].len;
p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >= 32)
p_dev->resource[0]->start = io->win[i].base;
p_dev->resource[0]->end = io->win[i].len;
p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
if (p_dev->resource[0]->end + p_dev->resource[1]->end >= 32)
return try_io_port(p_dev);
return 0;


+ 21
- 22
drivers/net/pcmcia/smc91c92_cs.c View File

@ -324,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
link->priv = dev;
spin_lock_init(&smc->lock);
link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 4;
link->resource[0]->end = 16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@ -427,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev,
void *priv_data)
{
int k;
p_dev->io.BasePort2 = cf->io.win[0].base;
p_dev->resource[1]->start = cf->io.win[0].base;
for (k = 0; k < 0x400; k += 0x10) {
if (k & 0x80)
continue;
p_dev->io.BasePort1 = k ^ 0x300;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[0]->start = k ^ 0x300;
p_dev->io_lines = 16;
if (!pcmcia_request_io(p_dev))
return 0;
}
return -ENODEV;
@ -448,9 +448,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA;
link->io.IOAddrLines = 16;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts2 = 8;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[1]->end = 8;
/* The Megahertz combo cards have modem-like CIS entries, so
we have to explicitly try a bunch of port combinations. */
@ -601,9 +600,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev,
unsigned int vcc,
void *priv_data)
{
p_dev->io.BasePort1 = cf->io.win[0].base;
p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev, &p_dev->io);
p_dev->resource[0]->start = cf->io.win[0].base;
p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
}
static int smc_config(struct pcmcia_device *link)
@ -611,7 +610,7 @@ static int smc_config(struct pcmcia_device *link)
struct net_device *dev = link->priv;
int i;
link->io.NumPorts1 = 16;
link->resource[0]->end = 16;
i = pcmcia_loop_config(link, smc_configcheck, NULL);
if (!i)
dev->base_addr = link->resource[0]->start;
@ -646,25 +645,25 @@ static int osi_config(struct pcmcia_device *link)
link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA;
link->io.NumPorts1 = 64;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts2 = 8;
link->io.IOAddrLines = 16;
link->resource[0]->end = 64;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[1]->end = 8;
/* Enable Hard Decode, LAN, Modem */
link->conf.ConfigIndex = 0x23;
link->io_lines = 16;
for (i = j = 0; j < 4; j++) {
link->io.BasePort2 = com[j];
i = pcmcia_request_io(link, &link->io);
link->resource[1]->start = com[j];
i = pcmcia_request_io(link);
if (i == 0)
break;
}
if (i != 0) {
/* Fallback: turn off hard decode */
link->conf.ConfigIndex = 0x03;
link->io.NumPorts2 = 0;
i = pcmcia_request_io(link, &link->io);
link->resource[1]->end = 0;
i = pcmcia_request_io(link);
}
dev->base_addr = link->resource[0]->start + 0x10;
return i;
@ -803,7 +802,7 @@ static int check_sig(struct pcmcia_device *link)
}
/* Try setting bus width */
width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO);
width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO);
s = inb(ioaddr + CONFIG);
if (width)
s |= CFG_16BIT;


+ 17
- 17
drivers/net/pcmcia/xirc2ps_cs.c View File

@ -677,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev,
if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
p_dev->io.BasePort2 = cf->io.win[0].base;
p_dev->io.BasePort1 = ioaddr;
if (!pcmcia_request_io(p_dev, &p_dev->io))
p_dev->resource[1]->start = cf->io.win[0].base;
p_dev->resource[0]->start = ioaddr;
if (!pcmcia_request_io(p_dev))
return 0;
}
}
@ -696,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,
int *pass = priv_data;
if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {
p_dev->io.BasePort2 = cf->io.win[0].base;
p_dev->io.BasePort1 = p_dev->io.BasePort2
p_dev->resource[1]->start = cf->io.win[0].base;
p_dev->resource[0]->start = p_dev->resource[1]->start
+ (*pass ? (cf->index & 0x20 ? -24:8)
: (cf->index & 0x20 ? 8:-24));
if (!pcmcia_request_io(p_dev, &p_dev->io))
if (!pcmcia_request_io(p_dev))
return 0;
}
return -ENODEV;
@ -807,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link)
goto failure;
}
link->io.IOAddrLines =10;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
if (local->modem) {
int pass;
@ -816,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link)
link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status |= CCSR_AUDIO_ENA;
}
link->io.NumPorts2 = 8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->resource[1]->end = 8;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
if (local->dingo) {
/* Take the Modem IO port from the CIS and scan for a free
* Ethernet port */
link->io.NumPorts1 = 16; /* no Mako stuff anymore */
link->resource[0]->end = 16; /* no Mako stuff anymore */
if (!pcmcia_loop_config(link, xirc2ps_config_modem, NULL))
goto port_found;
} else {
link->io.NumPorts1 = 18;
link->resource[0]->end = 18;
/* We do 2 passes here: The first one uses the regular mapping and
* the second tries again, thereby considering that the 32 ports are
* mirrored every 32 bytes. Actually we use a mirrored port for
@ -840,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link)
}
printk(KNOT_XIRC "no ports available\n");
} else {
link->io.NumPorts1 = 16;
link->io_lines = 10;
link->resource[0]->end = 16;
for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
link->io.BasePort1 = ioaddr;
if (!(err=pcmcia_request_io(link, &link->io)))
link->resource[0]->start = ioaddr;
if (!(err = pcmcia_request_io(link)))
goto port_found;
}
link->io.BasePort1 = 0; /* let CS decide */
if ((err=pcmcia_request_io(link, &link->io)))
link->resource[0]->start = 0; /* let CS decide */
if ((err = pcmcia_request_io(link)))
goto config_error;
}
port_found:


+ 10
- 12
drivers/net/wireless/airo_cs.c View File

@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if (!(io->flags & CISTPL_IO_8BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
if (!(io->flags & CISTPL_IO_16BIT))
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.BasePort1 = io->win[0].base;
p_dev->io.NumPorts1 = io->win[0].len;
p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
p_dev->resource[0]->flags |=
pcmcia_io_cfg_data_width(io->flags);
p_dev->resource[0]->start = io->win[0].base;
p_dev->resource[0]->end = io->win[0].len;
if (io->nwin > 1) {
p_dev->io.Attributes2 = p_dev->io.Attributes1;
p_dev->io.BasePort2 = io->win[1].base;
p_dev->io.NumPorts2 = io->win[1].len;
p_dev->resource[1]->flags = p_dev->resource[0]->flags;
p_dev->resource[1]->start = io->win[1].base;
p_dev->resource[1]->end = io->win[1].len;
}
}
/* This reserves IO space but doesn't actually enable it */
if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
if (pcmcia_request_io(p_dev) != 0)
return -ENODEV;
/*


+ 10
- 12
drivers/net/wireless/atmel_cs.c View File

@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
/* IO window settings */
p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin<