Commit 7feabb64 authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: move config_{base,index,regs} to struct pcmcia_device

Several drivers prefer to explicitly set config_{base,index,regs},
formerly known as ConfigBase, ConfigIndex and Present. Instead of
passing these values inside config_req_t, store it in struct
pcmcia_device.

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: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 37979e15
...@@ -885,7 +885,7 @@ static int bluecard_config(struct pcmcia_device *link) ...@@ -885,7 +885,7 @@ static int bluecard_config(struct pcmcia_device *link)
bluecard_info_t *info = link->priv; bluecard_info_t *info = link->priv;
int i, n; int i, n;
link->conf.ConfigIndex = 0x20; link->config_index = 0x20;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 64; link->resource[0]->end = 64;
......
...@@ -92,7 +92,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, ...@@ -92,7 +92,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
/* 0x40 causes it to generate level mode interrupts. */ /* 0x40 causes it to generate level mode interrupts. */
/* 0x04 enables IREQ pin. */ /* 0x04 enables IREQ pin. */
p_dev->conf.ConfigIndex = cfg->index | 0x44; p_dev->config_index = cfg->index | 0x44;
p_dev->io_lines = 16; p_dev->io_lines = 16;
ret = pcmcia_request_io(p_dev); ret = pcmcia_request_io(p_dev);
if (ret) if (ret)
......
...@@ -594,8 +594,8 @@ static int mgslpc_config(struct pcmcia_device *link) ...@@ -594,8 +594,8 @@ static int mgslpc_config(struct pcmcia_device *link)
goto failed; goto failed;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.ConfigIndex = 8; link->config_index = 8;
link->conf.Present = PRESENT_OPTION; link->config_regs = PRESENT_OPTION;
ret = pcmcia_request_irq(link, mgslpc_isr); ret = pcmcia_request_irq(link, mgslpc_isr);
if (ret) if (ret)
...@@ -608,7 +608,7 @@ static int mgslpc_config(struct pcmcia_device *link) ...@@ -608,7 +608,7 @@ static int mgslpc_config(struct pcmcia_device *link)
info->irq_level = link->irq; info->irq_level = link->irq;
dev_info(&link->dev, "index 0x%02x:", dev_info(&link->dev, "index 0x%02x:",
link->conf.ConfigIndex); link->config_index);
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq); printk(", irq %d", link->irq);
if (link->resource[0]) if (link->resource[0])
......
...@@ -227,8 +227,7 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev, ...@@ -227,8 +227,7 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK; pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
pdev->config_index = cfg->index;
pdev->conf.ConfigIndex = cfg->index;
pdev->resource[0]->start = io->win[0].base; pdev->resource[0]->start = io->win[0].base;
if (!(io->flags & CISTPL_IO_16BIT)) { if (!(io->flags & CISTPL_IO_16BIT)) {
pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
......
...@@ -80,8 +80,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev) ...@@ -80,8 +80,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.ConfigIndex = 1; p_dev->config_index = 1;
p_dev->conf.Present = PRESENT_OPTION; p_dev->config_regs = PRESENT_OPTION;
return avmcs_config(p_dev); return avmcs_config(p_dev);
} /* avmcs_attach */ } /* avmcs_attach */
......
...@@ -85,8 +85,8 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev) ...@@ -85,8 +85,8 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.ConfigIndex = 1; p_dev->config_index = 1;
p_dev->conf.Present = PRESENT_OPTION; p_dev->config_regs = PRESENT_OPTION;
return avma1cs_config(p_dev); return avma1cs_config(p_dev);
} /* avma1cs_attach */ } /* avma1cs_attach */
......
...@@ -211,7 +211,7 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link) ...@@ -211,7 +211,7 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x: ", dev_info(&link->dev, "index 0x%02x: ",
link->conf.ConfigIndex); link->config_index);
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq); printk(", irq %d", link->irq);
if (link->resource[0]) if (link->resource[0])
......
...@@ -253,7 +253,7 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link) ...@@ -253,7 +253,7 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x:", dev_info(&link->dev, "index 0x%02x:",
link->conf.ConfigIndex); link->config_index);
if (link->vpp) if (link->vpp)
printk(", Vpp %d.%d", link->vpp/10, link->vpp%10); printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
......
...@@ -191,7 +191,7 @@ static int __devinit teles_cs_config(struct pcmcia_device *link) ...@@ -191,7 +191,7 @@ static int __devinit teles_cs_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x:", dev_info(&link->dev, "index 0x%02x:",
link->conf.ConfigIndex); link->config_index);
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq); printk(", irq %d", link->irq);
if (link->resource[0]) if (link->resource[0])
......
...@@ -575,7 +575,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) ...@@ -575,7 +575,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
link->vpp = 0; link->vpp = 0;
} }
link->conf.ConfigIndex = 0; link->config_index = 0;
DEBUG(2, "Setting Configuration"); DEBUG(2, "Setting Configuration");
ret = pcmcia_request_configuration(link, &link->conf); ret = pcmcia_request_configuration(link, &link->conf);
if (ret != 0) { if (ret != 0) {
......
...@@ -281,7 +281,7 @@ static int tc574_probe(struct pcmcia_device *link) ...@@ -281,7 +281,7 @@ static int tc574_probe(struct pcmcia_device *link)
link->resource[0]->end = 32; link->resource[0]->end = 32;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.ConfigIndex = 1; link->config_index = 1;
dev->netdev_ops = &el3_netdev_ops; dev->netdev_ops = &el3_netdev_ops;
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
......
...@@ -217,7 +217,7 @@ static int tc589_probe(struct pcmcia_device *link) ...@@ -217,7 +217,7 @@ static int tc589_probe(struct pcmcia_device *link)
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16; link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.ConfigIndex = 1; link->config_index = 1;
dev->netdev_ops = &el3_netdev_ops; dev->netdev_ops = &el3_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
......
...@@ -230,7 +230,7 @@ static int get_prom(struct pcmcia_device *link) ...@@ -230,7 +230,7 @@ static int get_prom(struct pcmcia_device *link)
}; };
/* Not much of a test, but the alternatives are messy */ /* Not much of a test, but the alternatives are messy */
if (link->conf.ConfigBase != 0x03c0) if (link->config_base != 0x03c0)
return 0; return 0;
axnet_reset_8390(dev); axnet_reset_8390(dev);
...@@ -297,7 +297,7 @@ static int axnet_configcheck(struct pcmcia_device *p_dev, ...@@ -297,7 +297,7 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,
if (cfg->index == 0 || cfg->io.nwin == 0) if (cfg->index == 0 || cfg->io.nwin == 0)
return -ENODEV; return -ENODEV;
p_dev->conf.ConfigIndex = 0x05; p_dev->config_index = 0x05;
/* For multifunction cards, by convention, we configure the /* For multifunction cards, by convention, we configure the
network function with window 0, and serial with window 1 */ network function with window 0, and serial with window 1 */
if (io->nwin > 1) { if (io->nwin > 1) {
...@@ -325,7 +325,7 @@ static int axnet_config(struct pcmcia_device *link) ...@@ -325,7 +325,7 @@ static int axnet_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "axnet_config(0x%p)\n", link); dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
/* don't trust the CIS on this; Linksys got it wrong */ /* don't trust the CIS on this; Linksys got it wrong */
link->conf.Present = 0x63; link->config_regs = 0x63;
ret = pcmcia_loop_config(link, axnet_configcheck, NULL); ret = pcmcia_loop_config(link, axnet_configcheck, NULL);
if (ret != 0) if (ret != 0)
goto failed; goto failed;
......
...@@ -312,7 +312,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link) ...@@ -312,7 +312,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
ret = pcmcia_request_io(link); ret = pcmcia_request_io(link);
if (ret == 0) { if (ret == 0) {
/* calculate ConfigIndex value */ /* calculate ConfigIndex value */
link->conf.ConfigIndex = link->config_index =
((link->resource[0]->start & 0x0f0) >> 3) | 0x22; ((link->resource[0]->start & 0x0f0) >> 3) | 0x22;
return ret; return ret;
} }
...@@ -361,28 +361,28 @@ static int fmvj18x_config(struct pcmcia_device *link) ...@@ -361,28 +361,28 @@ static int fmvj18x_config(struct pcmcia_device *link)
link->card_id == PRODID_TDK_NP9610 || link->card_id == PRODID_TDK_NP9610 ||
link->card_id == PRODID_TDK_MN3200) { link->card_id == PRODID_TDK_MN3200) {
/* MultiFunction Card */ /* MultiFunction Card */
link->conf.ConfigBase = 0x800; link->config_base = 0x800;
link->conf.ConfigIndex = 0x47; link->config_index = 0x47;
link->resource[1]->end = 8; link->resource[1]->end = 8;
} }
break; break;
case MANFID_NEC: case MANFID_NEC:
cardtype = NEC; /* MultiFunction Card */ cardtype = NEC; /* MultiFunction Card */
link->conf.ConfigBase = 0x800; link->config_base = 0x800;
link->conf.ConfigIndex = 0x47; link->config_index = 0x47;
link->resource[1]->end = 8; link->resource[1]->end = 8;
break; break;
case MANFID_KME: case MANFID_KME:
cardtype = KME; /* MultiFunction Card */ cardtype = KME; /* MultiFunction Card */
link->conf.ConfigBase = 0x800; link->config_base = 0x800;
link->conf.ConfigIndex = 0x47; link->config_index = 0x47;
link->resource[1]->end = 8; link->resource[1]->end = 8;
break; break;
case MANFID_CONTEC: case MANFID_CONTEC:
cardtype = CONTEC; cardtype = CONTEC;
break; break;
case MANFID_FUJITSU: case MANFID_FUJITSU:
if (link->conf.ConfigBase == 0x0fe0) if (link->config_base == 0x0fe0)
cardtype = MBH10302; cardtype = MBH10302;
else if (link->card_id == PRODID_FUJITSU_MBH10302) else if (link->card_id == PRODID_FUJITSU_MBH10302)
/* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302), /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
...@@ -402,10 +402,10 @@ static int fmvj18x_config(struct pcmcia_device *link) ...@@ -402,10 +402,10 @@ static int fmvj18x_config(struct pcmcia_device *link)
case MANFID_FUJITSU: case MANFID_FUJITSU:
if (link->card_id == PRODID_FUJITSU_MBH10304) { if (link->card_id == PRODID_FUJITSU_MBH10304) {
cardtype = XXX10304; /* MBH10304 with buggy CIS */ cardtype = XXX10304; /* MBH10304 with buggy CIS */
link->conf.ConfigIndex = 0x20; link->config_index = 0x20;
} else { } else {
cardtype = MBH10302; /* NextCom NC5310, etc. */ cardtype = MBH10302; /* NextCom NC5310, etc. */
link->conf.ConfigIndex = 1; link->config_index = 1;
} }
break; break;
case MANFID_UNGERMANN: case MANFID_UNGERMANN:
...@@ -413,7 +413,7 @@ static int fmvj18x_config(struct pcmcia_device *link) ...@@ -413,7 +413,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
break; break;
default: default:
cardtype = MBH10302; cardtype = MBH10302;
link->conf.ConfigIndex = 1; link->config_index = 1;
} }
} }
......
...@@ -153,7 +153,7 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) ...@@ -153,7 +153,7 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 4; link->resource[0]->end = 4;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Present = PRESENT_OPTION; link->config_regs = PRESENT_OPTION;
info->dev = dev; info->dev = dev;
...@@ -212,8 +212,8 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ...@@ -212,8 +212,8 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "ibmtr_config\n"); dev_dbg(&link->dev, "ibmtr_config\n");
link->conf.ConfigIndex = 0x61;
link->io_lines = 16; link->io_lines = 16;
link->config_index = 0x61;
/* Determine if this is PRIMARY or ALTERNATE. */ /* Determine if this is PRIMARY or ALTERNATE. */
......
...@@ -461,8 +461,8 @@ static int nmclan_probe(struct pcmcia_device *link) ...@@ -461,8 +461,8 @@ static int nmclan_probe(struct pcmcia_device *link)
link->resource[0]->end = 32; link->resource[0]->end = 32;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.ConfigIndex = 1; link->config_index = 1;
link->conf.Present = PRESENT_OPTION; link->config_regs = PRESENT_OPTION;
lp->tx_free_frames=AM2150_MAX_TX_FRAMES; lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
......
...@@ -420,7 +420,7 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link) ...@@ -420,7 +420,7 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link)
int i, j; int i, j;
/* Not much of a test, but the alternatives are messy */ /* Not much of a test, but the alternatives are messy */
if (link->conf.ConfigBase != 0x03c0) if (link->config_base != 0x03c0)
return NULL; return NULL;
outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */ outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */
...@@ -564,7 +564,7 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link, ...@@ -564,7 +564,7 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
if ((link->manf_id == MANFID_IBM) && if ((link->manf_id == MANFID_IBM) &&
(link->card_id == PRODID_IBM_HOME_AND_AWAY)) (link->card_id == PRODID_IBM_HOME_AND_AWAY))
link->conf.ConfigIndex |= 0x10; link->config_index |= 0x10;
ret = pcmcia_request_configuration(link, &link->conf); ret = pcmcia_request_configuration(link, &link->conf);
if (ret) if (ret)
...@@ -581,7 +581,7 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link, ...@@ -581,7 +581,7 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
} else } else
dev->if_port = 0; dev->if_port = 0;
if ((link->conf.ConfigBase == 0x03c0) && if ((link->config_base == 0x03c0) &&
(link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
dev_info(&link->dev, dev_info(&link->dev,
"this is an AX88190 card - use axnet_cs instead.\n"); "this is an AX88190 card - use axnet_cs instead.\n");
......
...@@ -411,9 +411,9 @@ static int mhz_3288_power(struct pcmcia_device *link) ...@@ -411,9 +411,9 @@ static int mhz_3288_power(struct pcmcia_device *link)
mdelay(200); mdelay(200);
/* Now read and write the COR... */ /* Now read and write the COR... */
tmp = readb(smc->base + link->conf.ConfigBase + CISREG_COR); tmp = readb(smc->base + link->config_base + CISREG_COR);
udelay(5); udelay(5);
writeb(tmp, smc->base + link->conf.ConfigBase + CISREG_COR); writeb(tmp, smc->base + link->config_base + CISREG_COR);
return 0; return 0;
} }
...@@ -464,7 +464,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) ...@@ -464,7 +464,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
smc->base = ioremap(link->resource[2]->start, smc->base = ioremap(link->resource[2]->start,
resource_size(link->resource[2])); resource_size(link->resource[2]));
offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0; offset = (smc->manfid == MANFID_MOTOROLA) ? link->config_base : 0;
i = pcmcia_map_mem_page(link, link->resource[2], offset); i = pcmcia_map_mem_page(link, link->resource[2], offset);
if ((i == 0) && if ((i == 0) &&
(smc->manfid == MANFID_MEGAHERTZ) && (smc->manfid == MANFID_MEGAHERTZ) &&
...@@ -643,8 +643,8 @@ static int osi_config(struct pcmcia_device *link) ...@@ -643,8 +643,8 @@ static int osi_config(struct pcmcia_device *link)
link->resource[1]->end = 8; link->resource[1]->end = 8;
/* Enable Hard Decode, LAN, Modem */ /* Enable Hard Decode, LAN, Modem */
link->conf.ConfigIndex = 0x23;
link->io_lines = 16; link->io_lines = 16;
link->config_index = 0x23;
for (i = j = 0; j < 4; j++) { for (i = j = 0; j < 4; j++) {
link->resource[1]->start = com[j]; link->resource[1]->start = com[j];
...@@ -654,7 +654,7 @@ static int osi_config(struct pcmcia_device *link) ...@@ -654,7 +654,7 @@ static int osi_config(struct pcmcia_device *link)
} }
if (i != 0) { if (i != 0) {
/* Fallback: turn off hard decode */ /* Fallback: turn off hard decode */
link->conf.ConfigIndex = 0x03; link->config_index = 0x03;
link->resource[1]->end = 0; link->resource[1]->end = 0;
i = pcmcia_request_io(link); i = pcmcia_request_io(link);
} }
......
...@@ -530,7 +530,7 @@ xirc2ps_probe(struct pcmcia_device *link) ...@@ -530,7 +530,7 @@ xirc2ps_probe(struct pcmcia_device *link)
/* General socket configuration */ /* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.ConfigIndex = 1; link->config_index = 1;
/* Fill in card specific entries */ /* Fill in card specific entries */
dev->netdev_ops = &netdev_ops; dev->netdev_ops = &netdev_ops;
......
...@@ -240,7 +240,7 @@ static int airo_config(struct pcmcia_device *link) ...@@ -240,7 +240,7 @@ static int airo_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x: ", dev_info(&link->dev, "index 0x%02x: ",
link->conf.ConfigIndex); link->config_index);
if (link->vpp) if (link->vpp)
printk(", Vpp %d.%d", link->vpp/10, link->vpp%10); printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
printk(", irq %d", link->irq); printk(", irq %d", link->irq);
......
...@@ -601,7 +601,7 @@ static int prism2_config(struct pcmcia_device *link) ...@@ -601,7 +601,7 @@ static int prism2_config(struct pcmcia_device *link)
/* Finally, report what we've done */ /* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x: ", printk(KERN_INFO "%s: index 0x%02x: ",
dev_info, link->conf.ConfigIndex); dev_info, link->config_index);
if (link->vpp) if (link->vpp)
printk(", Vpp %d.%d", link->vpp / 10, printk(", Vpp %d.%d", link->vpp / 10,
link->vpp % 10); link->vpp % 10);
......
...@@ -319,7 +319,7 @@ static int ray_probe(struct pcmcia_device *p_dev) ...@@ -319,7 +319,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.ConfigIndex = 1; p_dev->config_index = 1;
p_dev->priv = dev; p_dev->priv = dev;
......
...@@ -1889,7 +1889,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev) ...@@ -1889,7 +1889,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.ConfigIndex = 1; p_dev->config_index = 1;
dev = alloc_etherdev(sizeof(struct wl3501_card)); dev = alloc_etherdev(sizeof(struct wl3501_card));
if (!dev) if (!dev)
......
...@@ -144,7 +144,7 @@ static int parport_config_check(struct pcmcia_device *p_dev, ...@@ -144,7 +144,7 @@ static int parport_config_check(struct pcmcia_device *p_dev,
cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
if (epp_mode) if (epp_mode)
p_dev->conf.ConfigIndex |= FORCE_EPP_MODE; p_dev->config_index |= FORCE_EPP_MODE;
p_dev->resource[0]->start = io->win[0].base; p_dev->resource[0]->start = io->win[0].base;
p_dev->resource[0]->end = io->win[0].len; p_dev->resource[0]->end = io->win[0].len;
if (io->nwin == 2) { if (io->nwin == 2) {
......
...@@ -34,9 +34,6 @@ typedef struct config_t { ...@@ -34,9 +34,6 @@ typedef struct config_t {
struct kref ref; struct kref ref;
unsigned int state; unsigned int state;
unsigned int Attributes; unsigned int Attributes;
unsigned int ConfigBase;
unsigned char Option;
unsigned int CardValues;
struct resource io[MAX_IO_WIN]; /* io ports */ struct resource io[MAX_IO_WIN]; /* io ports */
struct resource mem[MAX_WIN]; /* mem areas */ struct resource mem[MAX_WIN]; /* mem areas */
......
...@@ -276,13 +276,13 @@ static int pcmcia_device_probe(struct device *dev) ...@@ -276,13 +276,13 @@ static int pcmcia_device_probe(struct device *dev)
ret = pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_CONFIG, ret = pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_CONFIG,
&cis_config); &cis_config);
if (!ret) { if (!ret) {
p_dev->conf.ConfigBase = cis_config.base; p_dev->config_base = cis_config.base;
p_dev->conf.Present = cis_config.rmask[0]; p_dev->config_regs = cis_config.rmask[0];
} else { } else {
dev_printk(KERN_INFO, dev, dev_printk(KERN_INFO, dev,
"pcmcia: could not parse base and rmask0 of CIS\n"); "pcmcia: could not parse base and rmask0 of CIS\n");
p_dev->conf.ConfigBase = 0; p_dev->config_base = 0;
p_dev->conf.Present = 0; p_dev->config_regs = 0;
} }
ret = p_drv->probe(p_dev); ret = p_drv->probe(p_dev);
......
...@@ -151,7 +151,7 @@ static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv) ...@@ -151,7 +151,7 @@ static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv)
struct pcmcia_cfg_mem *cfg_mem = priv; struct pcmcia_cfg_mem *cfg_mem = priv;
/* default values */ /* default values */
cfg_mem->p_dev->conf.ConfigIndex = cfg->index; cfg_mem->p_dev->config_index = cfg->index;
if (cfg->flags & CISTPL_CFTABLE_DEFAULT) if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
cfg_mem->dflt = *cfg; cfg_mem->dflt = *cfg;
......
...@@ -168,7 +168,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, ...@@ -168,7 +168,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev,
return -EACCES; return -EACCES;
} }
addr = (c->ConfigBase + where) >> 1; addr = (p_dev->config_base + where) >> 1;
ret = accessf(s, 1, addr, 1, val); ret = accessf(s, 1, addr, 1, val);
...@@ -443,6 +443,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, ...@@ -443,6 +443,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
pccard_io_map iomap; pccard_io_map iomap;
unsigned char status = 0; unsigned char status = 0;
unsigned char ext_status = 0; unsigned char ext_status = 0;
unsigned char option = 0;
if (!(s->state & SOCKET_PRESENT)) if (!(s->state & SOCKET_PRESENT))
return -ENODEV; return -ENODEV;
...@@ -473,7 +474,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, ...@@ -473,7 +474,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
if (req->Attributes & CONF_ENABLE_SPKR) { if (req->Attributes & CONF_ENABLE_SPKR) {
s->socket.flags |= SS_SPKR_ENA; s->socket.flags |= SS_SPKR_ENA;
status = CCSR_AUDIO_ENA; status = CCSR_AUDIO_ENA;
if (!(req->Present & PRESENT_STATUS)) if (!(p_dev->config_regs & PRESENT_STATUS))
dev_warn(&p_dev->dev, "speaker requested, but " dev_warn(&p_dev->dev, "speaker requested, but "
"PRESENT_STATUS not set!\n"); "PRESENT_STATUS not set!\n");
} }
...@@ -482,54 +483,53 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, ...@@ -482,54 +483,53 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
else else
s->socket.io_irq = 0; s->socket.io_irq = 0;
if (req->Attributes & CONF_ENABLE_ESR) { if (req->Attributes & CONF_ENABLE_ESR) {
req->Present |= PRESENT_EXT_STATUS; p_dev->config_regs |= PRESENT_EXT_STATUS;
ext_status = ESR_REQ_ATTN_ENA; ext_status = ESR_REQ_ATTN_ENA;
} }
s->ops->set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
s->lock_count++; s->lock_count++;
/* Set up CIS configuration registers */ /* Set up CIS configuration registers */
base = c->ConfigBase = req->ConfigBase; base = p_dev->config_base;
c->CardValues = req->Present; if (p_dev->config_regs & PRESENT_COPY) {
if (req->Present & PRESENT_COPY) {
u16 tmp = 0; u16 tmp = 0;
dev_dbg(&p_dev->dev, "clearing CISREG_SCR\n"); dev_dbg(&p_dev->dev, "clearing CISREG_SCR\n");
pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &tmp); pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &tmp);
} }
if (req->Present & PRESENT_PIN_REPLACE) { if (p_dev->config_regs & PRESENT_PIN_REPLACE) {