Commit 7feabb6412ea23edd298c0fa90e5aa6733eb4a42

Authored by Dominik Brodowski
1 parent 37979e1546

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: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

Showing 45 changed files with 107 additions and 112 deletions Side-by-side Diff

drivers/bluetooth/bluecard_cs.c
... ... @@ -885,7 +885,7 @@
885 885 bluecard_info_t *info = link->priv;
886 886 int i, n;
887 887  
888   - link->conf.ConfigIndex = 0x20;
  888 + link->config_index = 0x20;
889 889  
890 890 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
891 891 link->resource[0]->end = 64;
drivers/char/pcmcia/ipwireless/main.c
... ... @@ -92,7 +92,7 @@
92 92  
93 93 /* 0x40 causes it to generate level mode interrupts. */
94 94 /* 0x04 enables IREQ pin. */
95   - p_dev->conf.ConfigIndex = cfg->index | 0x44;
  95 + p_dev->config_index = cfg->index | 0x44;
96 96 p_dev->io_lines = 16;
97 97 ret = pcmcia_request_io(p_dev);
98 98 if (ret)
drivers/char/pcmcia/synclink_cs.c
... ... @@ -594,8 +594,8 @@
594 594 goto failed;
595 595  
596 596 link->conf.Attributes = CONF_ENABLE_IRQ;
597   - link->conf.ConfigIndex = 8;
598   - link->conf.Present = PRESENT_OPTION;
  597 + link->config_index = 8;
  598 + link->config_regs = PRESENT_OPTION;
599 599  
600 600 ret = pcmcia_request_irq(link, mgslpc_isr);
601 601 if (ret)
... ... @@ -608,7 +608,7 @@
608 608 info->irq_level = link->irq;
609 609  
610 610 dev_info(&link->dev, "index 0x%02x:",
611   - link->conf.ConfigIndex);
  611 + link->config_index);
612 612 if (link->conf.Attributes & CONF_ENABLE_IRQ)
613 613 printk(", irq %d", link->irq);
614 614 if (link->resource[0])
drivers/ide/ide-cs.c
... ... @@ -227,8 +227,7 @@
227 227 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
228 228 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
229 229 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
230   -
231   - pdev->conf.ConfigIndex = cfg->index;
  230 + pdev->config_index = cfg->index;
232 231 pdev->resource[0]->start = io->win[0].base;
233 232 if (!(io->flags & CISTPL_IO_16BIT)) {
234 233 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
drivers/isdn/hardware/avm/avm_cs.c
... ... @@ -80,8 +80,8 @@
80 80  
81 81 /* General socket configuration */
82 82 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
83   - p_dev->conf.ConfigIndex = 1;
84   - p_dev->conf.Present = PRESENT_OPTION;
  83 + p_dev->config_index = 1;
  84 + p_dev->config_regs = PRESENT_OPTION;
85 85  
86 86 return avmcs_config(p_dev);
87 87 } /* avmcs_attach */
drivers/isdn/hisax/avma1_cs.c
... ... @@ -85,8 +85,8 @@
85 85  
86 86 /* General socket configuration */
87 87 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
88   - p_dev->conf.ConfigIndex = 1;
89   - p_dev->conf.Present = PRESENT_OPTION;
  88 + p_dev->config_index = 1;
  89 + p_dev->config_regs = PRESENT_OPTION;
90 90  
91 91 return avma1cs_config(p_dev);
92 92 } /* avma1cs_attach */
drivers/isdn/hisax/elsa_cs.c
... ... @@ -211,7 +211,7 @@
211 211  
212 212 /* Finally, report what we've done */
213 213 dev_info(&link->dev, "index 0x%02x: ",
214   - link->conf.ConfigIndex);
  214 + link->config_index);
215 215 if (link->conf.Attributes & CONF_ENABLE_IRQ)
216 216 printk(", irq %d", link->irq);
217 217 if (link->resource[0])
drivers/isdn/hisax/sedlbauer_cs.c
... ... @@ -253,7 +253,7 @@
253 253  
254 254 /* Finally, report what we've done */
255 255 dev_info(&link->dev, "index 0x%02x:",
256   - link->conf.ConfigIndex);
  256 + link->config_index);
257 257 if (link->vpp)
258 258 printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
259 259 if (link->conf.Attributes & CONF_ENABLE_IRQ)
drivers/isdn/hisax/teles_cs.c
... ... @@ -191,7 +191,7 @@
191 191  
192 192 /* Finally, report what we've done */
193 193 dev_info(&link->dev, "index 0x%02x:",
194   - link->conf.ConfigIndex);
  194 + link->config_index);
195 195 if (link->conf.Attributes & CONF_ENABLE_IRQ)
196 196 printk(", irq %d", link->irq);
197 197 if (link->resource[0])
drivers/mtd/maps/pcmciamtd.c
... ... @@ -575,7 +575,7 @@
575 575 link->vpp = 0;
576 576 }
577 577  
578   - link->conf.ConfigIndex = 0;
  578 + link->config_index = 0;
579 579 DEBUG(2, "Setting Configuration");
580 580 ret = pcmcia_request_configuration(link, &link->conf);
581 581 if (ret != 0) {
drivers/net/pcmcia/3c574_cs.c
... ... @@ -281,7 +281,7 @@
281 281 link->resource[0]->end = 32;
282 282 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
283 283 link->conf.Attributes = CONF_ENABLE_IRQ;
284   - link->conf.ConfigIndex = 1;
  284 + link->config_index = 1;
285 285  
286 286 dev->netdev_ops = &el3_netdev_ops;
287 287 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
drivers/net/pcmcia/3c589_cs.c
... ... @@ -217,7 +217,7 @@
217 217 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
218 218  
219 219 link->conf.Attributes = CONF_ENABLE_IRQ;
220   - link->conf.ConfigIndex = 1;
  220 + link->config_index = 1;
221 221  
222 222 dev->netdev_ops = &el3_netdev_ops;
223 223 dev->watchdog_timeo = TX_TIMEOUT;
drivers/net/pcmcia/axnet_cs.c
... ... @@ -230,7 +230,7 @@
230 230 };
231 231  
232 232 /* Not much of a test, but the alternatives are messy */
233   - if (link->conf.ConfigBase != 0x03c0)
  233 + if (link->config_base != 0x03c0)
234 234 return 0;
235 235  
236 236 axnet_reset_8390(dev);
... ... @@ -297,7 +297,7 @@
297 297 if (cfg->index == 0 || cfg->io.nwin == 0)
298 298 return -ENODEV;
299 299  
300   - p_dev->conf.ConfigIndex = 0x05;
  300 + p_dev->config_index = 0x05;
301 301 /* For multifunction cards, by convention, we configure the
302 302 network function with window 0, and serial with window 1 */
303 303 if (io->nwin > 1) {
... ... @@ -325,7 +325,7 @@
325 325 dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
326 326  
327 327 /* don't trust the CIS on this; Linksys got it wrong */
328   - link->conf.Present = 0x63;
  328 + link->config_regs = 0x63;
329 329 ret = pcmcia_loop_config(link, axnet_configcheck, NULL);
330 330 if (ret != 0)
331 331 goto failed;
drivers/net/pcmcia/fmvj18x_cs.c
... ... @@ -312,7 +312,7 @@
312 312 ret = pcmcia_request_io(link);
313 313 if (ret == 0) {
314 314 /* calculate ConfigIndex value */
315   - link->conf.ConfigIndex =
  315 + link->config_index =
316 316 ((link->resource[0]->start & 0x0f0) >> 3) | 0x22;
317 317 return ret;
318 318 }
319 319  
320 320  
321 321  
... ... @@ -361,28 +361,28 @@
361 361 link->card_id == PRODID_TDK_NP9610 ||
362 362 link->card_id == PRODID_TDK_MN3200) {
363 363 /* MultiFunction Card */
364   - link->conf.ConfigBase = 0x800;
365   - link->conf.ConfigIndex = 0x47;
  364 + link->config_base = 0x800;
  365 + link->config_index = 0x47;
366 366 link->resource[1]->end = 8;
367 367 }
368 368 break;
369 369 case MANFID_NEC:
370 370 cardtype = NEC; /* MultiFunction Card */
371   - link->conf.ConfigBase = 0x800;
372   - link->conf.ConfigIndex = 0x47;
  371 + link->config_base = 0x800;
  372 + link->config_index = 0x47;
373 373 link->resource[1]->end = 8;
374 374 break;
375 375 case MANFID_KME:
376 376 cardtype = KME; /* MultiFunction Card */
377   - link->conf.ConfigBase = 0x800;
378   - link->conf.ConfigIndex = 0x47;
  377 + link->config_base = 0x800;
  378 + link->config_index = 0x47;
379 379 link->resource[1]->end = 8;
380 380 break;
381 381 case MANFID_CONTEC:
382 382 cardtype = CONTEC;
383 383 break;
384 384 case MANFID_FUJITSU:
385   - if (link->conf.ConfigBase == 0x0fe0)
  385 + if (link->config_base == 0x0fe0)
386 386 cardtype = MBH10302;
387 387 else if (link->card_id == PRODID_FUJITSU_MBH10302)
388 388 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
389 389  
... ... @@ -402,10 +402,10 @@
402 402 case MANFID_FUJITSU:
403 403 if (link->card_id == PRODID_FUJITSU_MBH10304) {
404 404 cardtype = XXX10304; /* MBH10304 with buggy CIS */
405   - link->conf.ConfigIndex = 0x20;
  405 + link->config_index = 0x20;
406 406 } else {
407 407 cardtype = MBH10302; /* NextCom NC5310, etc. */
408   - link->conf.ConfigIndex = 1;
  408 + link->config_index = 1;
409 409 }
410 410 break;
411 411 case MANFID_UNGERMANN:
... ... @@ -413,7 +413,7 @@
413 413 break;
414 414 default:
415 415 cardtype = MBH10302;
416   - link->conf.ConfigIndex = 1;
  416 + link->config_index = 1;
417 417 }
418 418 }
419 419  
drivers/net/pcmcia/ibmtr_cs.c
... ... @@ -153,7 +153,7 @@
153 153 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
154 154 link->resource[0]->end = 4;
155 155 link->conf.Attributes = CONF_ENABLE_IRQ;
156   - link->conf.Present = PRESENT_OPTION;
  156 + link->config_regs = PRESENT_OPTION;
157 157  
158 158 info->dev = dev;
159 159  
160 160  
... ... @@ -212,8 +212,8 @@
212 212  
213 213 dev_dbg(&link->dev, "ibmtr_config\n");
214 214  
215   - link->conf.ConfigIndex = 0x61;
216 215 link->io_lines = 16;
  216 + link->config_index = 0x61;
217 217  
218 218 /* Determine if this is PRIMARY or ALTERNATE. */
219 219  
drivers/net/pcmcia/nmclan_cs.c
... ... @@ -461,8 +461,8 @@
461 461 link->resource[0]->end = 32;
462 462 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
463 463 link->conf.Attributes = CONF_ENABLE_IRQ;
464   - link->conf.ConfigIndex = 1;
465   - link->conf.Present = PRESENT_OPTION;
  464 + link->config_index = 1;
  465 + link->config_regs = PRESENT_OPTION;
466 466  
467 467 lp->tx_free_frames=AM2150_MAX_TX_FRAMES;
468 468  
drivers/net/pcmcia/pcnet_cs.c
... ... @@ -420,7 +420,7 @@
420 420 int i, j;
421 421  
422 422 /* Not much of a test, but the alternatives are messy */
423   - if (link->conf.ConfigBase != 0x03c0)
  423 + if (link->config_base != 0x03c0)
424 424 return NULL;
425 425  
426 426 outb_p(0x01, ioaddr + EN0_DCFG); /* Set word-wide access. */
... ... @@ -564,7 +564,7 @@
564 564  
565 565 if ((link->manf_id == MANFID_IBM) &&
566 566 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
567   - link->conf.ConfigIndex |= 0x10;
  567 + link->config_index |= 0x10;
568 568  
569 569 ret = pcmcia_request_configuration(link, &link->conf);
570 570 if (ret)
... ... @@ -581,7 +581,7 @@
581 581 } else
582 582 dev->if_port = 0;
583 583  
584   - if ((link->conf.ConfigBase == 0x03c0) &&
  584 + if ((link->config_base == 0x03c0) &&
585 585 (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
586 586 dev_info(&link->dev,
587 587 "this is an AX88190 card - use axnet_cs instead.\n");
drivers/net/pcmcia/smc91c92_cs.c
... ... @@ -411,9 +411,9 @@
411 411 mdelay(200);
412 412  
413 413 /* Now read and write the COR... */
414   - tmp = readb(smc->base + link->conf.ConfigBase + CISREG_COR);
  414 + tmp = readb(smc->base + link->config_base + CISREG_COR);
415 415 udelay(5);
416   - writeb(tmp, smc->base + link->conf.ConfigBase + CISREG_COR);
  416 + writeb(tmp, smc->base + link->config_base + CISREG_COR);
417 417  
418 418 return 0;
419 419 }
... ... @@ -464,7 +464,7 @@
464 464  
465 465 smc->base = ioremap(link->resource[2]->start,
466 466 resource_size(link->resource[2]));
467   - offset = (smc->manfid == MANFID_MOTOROLA) ? link->conf.ConfigBase : 0;
  467 + offset = (smc->manfid == MANFID_MOTOROLA) ? link->config_base : 0;
468 468 i = pcmcia_map_mem_page(link, link->resource[2], offset);
469 469 if ((i == 0) &&
470 470 (smc->manfid == MANFID_MEGAHERTZ) &&
471 471  
... ... @@ -643,8 +643,8 @@
643 643 link->resource[1]->end = 8;
644 644  
645 645 /* Enable Hard Decode, LAN, Modem */
646   - link->conf.ConfigIndex = 0x23;
647 646 link->io_lines = 16;
  647 + link->config_index = 0x23;
648 648  
649 649 for (i = j = 0; j < 4; j++) {
650 650 link->resource[1]->start = com[j];
... ... @@ -654,7 +654,7 @@
654 654 }
655 655 if (i != 0) {
656 656 /* Fallback: turn off hard decode */
657   - link->conf.ConfigIndex = 0x03;
  657 + link->config_index = 0x03;
658 658 link->resource[1]->end = 0;
659 659 i = pcmcia_request_io(link);
660 660 }
drivers/net/pcmcia/xirc2ps_cs.c
... ... @@ -530,7 +530,7 @@
530 530  
531 531 /* General socket configuration */
532 532 link->conf.Attributes = CONF_ENABLE_IRQ;
533   - link->conf.ConfigIndex = 1;
  533 + link->config_index = 1;
534 534  
535 535 /* Fill in card specific entries */
536 536 dev->netdev_ops = &netdev_ops;
drivers/net/wireless/airo_cs.c
... ... @@ -240,7 +240,7 @@
240 240  
241 241 /* Finally, report what we've done */
242 242 dev_info(&link->dev, "index 0x%02x: ",
243   - link->conf.ConfigIndex);
  243 + link->config_index);
244 244 if (link->vpp)
245 245 printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
246 246 printk(", irq %d", link->irq);
drivers/net/wireless/hostap/hostap_cs.c
... ... @@ -601,7 +601,7 @@
601 601  
602 602 /* Finally, report what we've done */
603 603 printk(KERN_INFO "%s: index 0x%02x: ",
604   - dev_info, link->conf.ConfigIndex);
  604 + dev_info, link->config_index);
605 605 if (link->vpp)
606 606 printk(", Vpp %d.%d", link->vpp / 10,
607 607 link->vpp % 10);
drivers/net/wireless/ray_cs.c
... ... @@ -319,7 +319,7 @@
319 319  
320 320 /* General socket configuration */
321 321 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
322   - p_dev->conf.ConfigIndex = 1;
  322 + p_dev->config_index = 1;
323 323  
324 324 p_dev->priv = dev;
325 325  
drivers/net/wireless/wl3501_cs.c
... ... @@ -1889,7 +1889,7 @@
1889 1889  
1890 1890 /* General socket configuration */
1891 1891 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
1892   - p_dev->conf.ConfigIndex = 1;
  1892 + p_dev->config_index = 1;
1893 1893  
1894 1894 dev = alloc_etherdev(sizeof(struct wl3501_card));
1895 1895 if (!dev)
drivers/parport/parport_cs.c
... ... @@ -144,7 +144,7 @@
144 144 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
145 145 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
146 146 if (epp_mode)
147   - p_dev->conf.ConfigIndex |= FORCE_EPP_MODE;
  147 + p_dev->config_index |= FORCE_EPP_MODE;
148 148 p_dev->resource[0]->start = io->win[0].base;
149 149 p_dev->resource[0]->end = io->win[0].len;
150 150 if (io->nwin == 2) {
drivers/pcmcia/cs_internal.h
... ... @@ -34,9 +34,6 @@
34 34 struct kref ref;
35 35 unsigned int state;
36 36 unsigned int Attributes;
37   - unsigned int ConfigBase;
38   - unsigned char Option;
39   - unsigned int CardValues;
40 37  
41 38 struct resource io[MAX_IO_WIN]; /* io ports */
42 39 struct resource mem[MAX_WIN]; /* mem areas */
... ... @@ -276,13 +276,13 @@
276 276 ret = pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_CONFIG,
277 277 &cis_config);
278 278 if (!ret) {
279   - p_dev->conf.ConfigBase = cis_config.base;
280   - p_dev->conf.Present = cis_config.rmask[0];
  279 + p_dev->config_base = cis_config.base;
  280 + p_dev->config_regs = cis_config.rmask[0];
281 281 } else {
282 282 dev_printk(KERN_INFO, dev,
283 283 "pcmcia: could not parse base and rmask0 of CIS\n");
284   - p_dev->conf.ConfigBase = 0;
285   - p_dev->conf.Present = 0;
  284 + p_dev->config_base = 0;
  285 + p_dev->config_regs = 0;
286 286 }
287 287  
288 288 ret = p_drv->probe(p_dev);
drivers/pcmcia/pcmcia_cis.c
... ... @@ -151,7 +151,7 @@
151 151 struct pcmcia_cfg_mem *cfg_mem = priv;
152 152  
153 153 /* default values */
154   - cfg_mem->p_dev->conf.ConfigIndex = cfg->index;
  154 + cfg_mem->p_dev->config_index = cfg->index;
155 155 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
156 156 cfg_mem->dflt = *cfg;
157 157  
drivers/pcmcia/pcmcia_resource.c
... ... @@ -168,7 +168,7 @@
168 168 return -EACCES;
169 169 }
170 170  
171   - addr = (c->ConfigBase + where) >> 1;
  171 + addr = (p_dev->config_base + where) >> 1;
172 172  
173 173 ret = accessf(s, 1, addr, 1, val);
174 174  
... ... @@ -443,6 +443,7 @@
443 443 pccard_io_map iomap;
444 444 unsigned char status = 0;
445 445 unsigned char ext_status = 0;
  446 + unsigned char option = 0;
446 447  
447 448 if (!(s->state & SOCKET_PRESENT))
448 449 return -ENODEV;
... ... @@ -473,7 +474,7 @@
473 474 if (req->Attributes & CONF_ENABLE_SPKR) {
474 475 s->socket.flags |= SS_SPKR_ENA;
475 476 status = CCSR_AUDIO_ENA;
476   - if (!(req->Present & PRESENT_STATUS))
  477 + if (!(p_dev->config_regs & PRESENT_STATUS))
477 478 dev_warn(&p_dev->dev, "speaker requested, but "
478 479 "PRESENT_STATUS not set!\n");
479 480 }
480 481  
481 482  
482 483  
483 484  
484 485  
485 486  
486 487  
487 488  
488 489  
489 490  
... ... @@ -482,54 +483,53 @@
482 483 else
483 484 s->socket.io_irq = 0;
484 485 if (req->Attributes & CONF_ENABLE_ESR) {
485   - req->Present |= PRESENT_EXT_STATUS;
  486 + p_dev->config_regs |= PRESENT_EXT_STATUS;
486 487 ext_status = ESR_REQ_ATTN_ENA;
487 488 }
488 489 s->ops->set_socket(s, &s->socket);
489 490 s->lock_count++;
490 491  
491 492 /* Set up CIS configuration registers */
492   - base = c->ConfigBase = req->ConfigBase;
493   - c->CardValues = req->Present;
494   - if (req->Present & PRESENT_COPY) {
  493 + base = p_dev->config_base;
  494 + if (p_dev->config_regs & PRESENT_COPY) {
495 495 u16 tmp = 0;
496 496 dev_dbg(&p_dev->dev, "clearing CISREG_SCR\n");
497 497 pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &tmp);
498 498 }
499   - if (req->Present & PRESENT_PIN_REPLACE) {
  499 + if (p_dev->config_regs & PRESENT_PIN_REPLACE) {
500 500 u16 tmp = 0;
501 501 dev_dbg(&p_dev->dev, "clearing CISREG_PRR\n");
502 502 pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &tmp);
503 503 }
504   - if (req->Present & PRESENT_OPTION) {
  504 + if (p_dev->config_regs & PRESENT_OPTION) {
505 505 if (s->functions == 1) {
506   - c->Option = req->ConfigIndex & COR_CONFIG_MASK;
  506 + option = p_dev->config_index & COR_CONFIG_MASK;
507 507 } else {
508   - c->Option = req->ConfigIndex & COR_MFC_CONFIG_MASK;
509   - c->Option |= COR_FUNC_ENA|COR_IREQ_ENA;
510   - if (req->Present & PRESENT_IOBASE_0)
511   - c->Option |= COR_ADDR_DECODE;
  508 + option = p_dev->config_index & COR_MFC_CONFIG_MASK;
  509 + option |= COR_FUNC_ENA|COR_IREQ_ENA;
  510 + if (p_dev->config_regs & PRESENT_IOBASE_0)
  511 + option |= COR_ADDR_DECODE;
512 512 }
513 513 if ((req->Attributes & CONF_ENABLE_IRQ) &&
514 514 !(req->Attributes & CONF_ENABLE_PULSE_IRQ))
515   - c->Option |= COR_LEVEL_REQ;
516   - pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
  515 + option |= COR_LEVEL_REQ;
  516 + pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option);
517 517 mdelay(40);
518 518 }
519   - if (req->Present & PRESENT_STATUS)
  519 + if (p_dev->config_regs & PRESENT_STATUS)
520 520 pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status);
521 521  
522   - if (req->Present & PRESENT_EXT_STATUS)
  522 + if (p_dev->config_regs & PRESENT_EXT_STATUS)
523 523 pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1,
524 524 &ext_status);
525 525  
526   - if (req->Present & PRESENT_IOBASE_0) {
  526 + if (p_dev->config_regs & PRESENT_IOBASE_0) {
527 527 u8 b = c->io[0].start & 0xff;
528 528 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_0)>>1, 1, &b);
529 529 b = (c->io[0].start >> 8) & 0xff;
530 530 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOBASE_1)>>1, 1, &b);
531 531 }
532   - if (req->Present & PRESENT_IOSIZE) {
  532 + if (p_dev->config_regs & PRESENT_IOSIZE) {
533 533 u8 b = resource_size(&c->io[0]) + resource_size(&c->io[1]) - 1;
534 534 pcmcia_write_cis_mem(s, 1, (base + CISREG_IOSIZE)>>1, 1, &b);
535 535 }
drivers/scsi/pcmcia/aha152x_stub.c
... ... @@ -103,7 +103,7 @@
103 103 link->resource[0]->end = 0x20;
104 104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
105 105 link->conf.Attributes = CONF_ENABLE_IRQ;
106   - link->conf.Present = PRESENT_OPTION;
  106 + link->config_regs = PRESENT_OPTION;
107 107  
108 108 return aha152x_config_cs(link);
109 109 } /* aha152x_attach */
drivers/scsi/pcmcia/fdomain_stub.c
... ... @@ -86,7 +86,7 @@
86 86 link->resource[0]->end = 0x10;
87 87 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
88 88 link->conf.Attributes = CONF_ENABLE_IRQ;
89   - link->conf.Present = PRESENT_OPTION;
  89 + link->config_regs = PRESENT_OPTION;
90 90  
91 91 return fdomain_config(link);
92 92 } /* fdomain_attach */
drivers/scsi/pcmcia/nsp_cs.c
... ... @@ -1745,7 +1745,7 @@
1745 1745  
1746 1746 /* Finally, report what we've done */
1747 1747 printk(KERN_INFO "nsp_cs: index 0x%02x: ",
1748   - link->conf.ConfigIndex);
  1748 + link->config_index);
1749 1749 if (link->vpp) {
1750 1750 printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
1751 1751 }
drivers/scsi/pcmcia/qlogic_stub.c
... ... @@ -159,7 +159,7 @@
159 159 link->resource[0]->end = 16;
160 160 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
161 161 link->conf.Attributes = CONF_ENABLE_IRQ;
162   - link->conf.Present = PRESENT_OPTION;
  162 + link->config_regs = PRESENT_OPTION;
163 163  
164 164 return qlogic_config(link);
165 165 } /* qlogic_attach */
drivers/serial/serial_cs.c
... ... @@ -495,7 +495,7 @@
495 495  
496 496 found_port:
497 497 if (info->multi && (info->manfid == MANFID_3COM))
498   - link->conf.ConfigIndex &= ~(0x08);
  498 + link->config_index &= ~(0x08);
499 499  
500 500 /*
501 501 * Apply any configuration quirks.
... ... @@ -591,8 +591,8 @@
591 591 info->prodid == PRODID_POSSIO_GCC)) {
592 592 int err;
593 593  
594   - if (link->conf.ConfigIndex == 1 ||
595   - link->conf.ConfigIndex == 3) {
  594 + if (link->config_index == 1 ||
  595 + link->config_index == 3) {
596 596 err = setup_serial(link, info, base2,
597 597 link->irq);
598 598 base2 = link->resource[0]->start;;
drivers/staging/comedi/drivers/cb_das16_cs.c
... ... @@ -772,7 +772,7 @@
772 772 goto failed;
773 773  
774 774 /* Finally, report what we've done */
775   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  775 + dev_info(&link->dev, "index 0x%02x", link->config_index);
776 776 if (link->conf.Attributes & CONF_ENABLE_IRQ)
777 777 printk(", irq %u", link->irq);
778 778 if (link->resource[0])
drivers/staging/comedi/drivers/das08_cs.c
... ... @@ -268,7 +268,7 @@
268 268 goto failed;
269 269  
270 270 /* Finally, report what we've done */
271   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  271 + dev_info(&link->dev, "index 0x%02x", link->config_index);
272 272 if (link->conf.Attributes & CONF_ENABLE_IRQ)
273 273 printk(", irq %u", link->irq);
274 274 if (link->resource[0])
drivers/staging/comedi/drivers/ni_daq_700.c
... ... @@ -607,7 +607,7 @@
607 607 goto failed;
608 608  
609 609 /* Finally, report what we've done */
610   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  610 + dev_info(&link->dev, "index 0x%02x", link->config_index);
611 611 if (link->conf.Attributes & CONF_ENABLE_IRQ)
612 612 printk(", irq %d", link->irq);
613 613 if (link->resource[0])
drivers/staging/comedi/drivers/ni_daq_dio24.c
... ... @@ -358,7 +358,7 @@
358 358 goto failed;
359 359  
360 360 /* Finally, report what we've done */
361   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  361 + dev_info(&link->dev, "index 0x%02x", link->config_index);
362 362 if (link->conf.Attributes & CONF_ENABLE_IRQ)
363 363 printk(", irq %d", link->irq);
364 364 if (link->resource[0])
drivers/staging/comedi/drivers/ni_labpc_cs.c
... ... @@ -336,7 +336,7 @@
336 336 goto failed;
337 337  
338 338 /* Finally, report what we've done */
339   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  339 + dev_info(&link->dev, "index 0x%02x", link->config_index);
340 340 if (link->conf.Attributes & CONF_ENABLE_IRQ)
341 341 printk(", irq %d", link->irq);
342 342 if (link->resource[0])
drivers/staging/comedi/drivers/quatech_daqp_cs.c
... ... @@ -1137,7 +1137,7 @@
1137 1137 goto failed;
1138 1138  
1139 1139 /* Finally, report what we've done */
1140   - dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
  1140 + dev_info(&link->dev, "index 0x%02x", link->config_index);
1141 1141 if (link->conf.Attributes & CONF_ENABLE_IRQ)
1142 1142 printk(", irq %u", link->irq);
1143 1143 if (link->resource[0])
drivers/staging/wlags49_h2/wl_cs.c
... ... @@ -148,8 +148,8 @@
148 148 link->resource[0]->end = HCF_NUM_IO_PORTS;
149 149 link->resource[0]->flags= IO_DATA_PATH_WIDTH_16;
150 150 link->conf.Attributes = CONF_ENABLE_IRQ;
151   - link->conf.ConfigIndex = 5;
152   - link->conf.Present = PRESENT_OPTION;
  151 + link->config_index = 5;
  152 + link->config_regs = PRESENT_OPTION;
153 153  
154 154 link->priv = dev;
155 155 lp = wl_priv(dev);
drivers/usb/host/sl811_cs.c
... ... @@ -200,7 +200,7 @@
200 200 goto failed;
201 201  
202 202 dev_info(&link->dev, "index 0x%02x: ",
203   - link->conf.ConfigIndex);
  203 + link->config_index);
204 204 if (link->vpp)
205 205 printk(", Vpp %d.%d", link->vpp/10, link->vpp%10);
206 206 printk(", irq %d", link->irq);
... ... @@ -22,9 +22,6 @@
22 22 /* For RequestConfiguration */
23 23 typedef struct config_req_t {
24 24 u_int Attributes;
25   - u_int ConfigBase;
26   - u_char ConfigIndex;
27   - u_int Present;
28 25 } config_req_t;
29 26  
30 27 /* Attributes for RequestConfiguration */
... ... @@ -34,18 +31,6 @@
34 31 #define CONF_ENABLE_PULSE_IRQ 0x08
35 32 #define CONF_ENABLE_ESR 0x10
36 33 #define CONF_VALID_CLIENT 0x100
37   -
38   -/* Configuration registers present */
39   -#define PRESENT_OPTION 0x001
40   -#define PRESENT_STATUS 0x002
41   -#define PRESENT_PIN_REPLACE 0x004
42   -#define PRESENT_COPY 0x008
43   -#define PRESENT_EXT_STATUS 0x010
44   -#define PRESENT_IOBASE_0 0x020
45   -#define PRESENT_IOBASE_1 0x040
46   -#define PRESENT_IOBASE_2 0x080
47   -#define PRESENT_IOBASE_3 0x100
48   -#define PRESENT_IOSIZE 0x200
49 34  
50 35 #endif /* _LINUX_CS_H */
... ... @@ -97,6 +97,9 @@
97 97 unsigned int vpp;
98 98  
99 99 unsigned int io_lines; /* number of I/O lines */
  100 + unsigned int config_base;
  101 + unsigned int config_index;
  102 + unsigned int config_regs; /* PRESENT_ flags below */
100 103  
101 104 /* Is the device suspended? */
102 105 u16 suspended:1;
... ... @@ -250,6 +253,17 @@
250 253 0x0c -> 2
251 254 0x10 -> 3 */
252 255  
  256 +/* config_reg{ister}s present for this PCMCIA device */
  257 +#define PRESENT_OPTION 0x001
  258 +#define PRESENT_STATUS 0x002
  259 +#define PRESENT_PIN_REPLACE 0x004
  260 +#define PRESENT_COPY 0x008
  261 +#define PRESENT_EXT_STATUS 0x010
  262 +#define PRESENT_IOBASE_0 0x020
  263 +#define PRESENT_IOBASE_1 0x040
  264 +#define PRESENT_IOBASE_2 0x080
  265 +#define PRESENT_IOBASE_3 0x100
  266 +#define PRESENT_IOSIZE 0x200
253 267  
254 268 #endif /* __KERNEL__ */
255 269  
sound/pcmcia/pdaudiocf/pdaudiocf.c
... ... @@ -143,8 +143,8 @@
143 143 link->resource[0]->end = 16;
144 144  
145 145 link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
146   - link->conf.ConfigIndex = 1;
147   - link->conf.Present = PRESENT_OPTION;
  146 + link->config_index = 1;
  147 + link->config_regs = PRESENT_OPTION;
148 148  
149 149 return pdacf_config(link);
150 150 }
... ... @@ -216,7 +216,7 @@
216 216 int ret;
217 217  
218 218 snd_printdd(KERN_DEBUG "pdacf_config called\n");
219   - link->conf.ConfigIndex = 0x5;
  219 + link->config_index = 0x5;
220 220  
221 221 ret = pcmcia_request_io(link);
222 222 if (ret)
sound/pcmcia/vx/vxpocket.c
... ... @@ -163,8 +163,8 @@
163 163 link->resource[0]->end = 16;
164 164  
165 165 link->conf.Attributes = CONF_ENABLE_IRQ;
166   - link->conf.ConfigIndex = 1;
167   - link->conf.Present = PRESENT_OPTION;
  166 + link->config_index = 1;
  167 + link->config_regs = PRESENT_OPTION;
168 168  
169 169 *chip_ret = vxp;
170 170 return 0;