aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/smc91c92_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/smc91c92_cs.c')
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 1b0b3230dd71..a5e47796f6ae 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -324,9 +324,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
324 link->priv = dev; 324 link->priv = dev;
325 325
326 spin_lock_init(&smc->lock); 326 spin_lock_init(&smc->lock);
327 link->io.NumPorts1 = 16; 327 link->resource[0]->end = 16;
328 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 328 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
329 link->io.IOAddrLines = 4;
330 link->conf.Attributes = CONF_ENABLE_IRQ; 329 link->conf.Attributes = CONF_ENABLE_IRQ;
331 link->conf.IntType = INT_MEMORY_AND_IO; 330 link->conf.IntType = INT_MEMORY_AND_IO;
332 331
@@ -427,12 +426,13 @@ static int mhz_mfc_config_check(struct pcmcia_device *p_dev,
427 void *priv_data) 426 void *priv_data)
428{ 427{
429 int k; 428 int k;
430 p_dev->io.BasePort2 = cf->io.win[0].base; 429 p_dev->resource[1]->start = cf->io.win[0].base;
431 for (k = 0; k < 0x400; k += 0x10) { 430 for (k = 0; k < 0x400; k += 0x10) {
432 if (k & 0x80) 431 if (k & 0x80)
433 continue; 432 continue;
434 p_dev->io.BasePort1 = k ^ 0x300; 433 p_dev->resource[0]->start = k ^ 0x300;
435 if (!pcmcia_request_io(p_dev, &p_dev->io)) 434 p_dev->io_lines = 16;
435 if (!pcmcia_request_io(p_dev))
436 return 0; 436 return 0;
437 } 437 }
438 return -ENODEV; 438 return -ENODEV;
@@ -448,9 +448,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)
448 448
449 link->conf.Attributes |= CONF_ENABLE_SPKR; 449 link->conf.Attributes |= CONF_ENABLE_SPKR;
450 link->conf.Status = CCSR_AUDIO_ENA; 450 link->conf.Status = CCSR_AUDIO_ENA;
451 link->io.IOAddrLines = 16; 451 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
452 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 452 link->resource[1]->end = 8;
453 link->io.NumPorts2 = 8;
454 453
455 /* The Megahertz combo cards have modem-like CIS entries, so 454 /* The Megahertz combo cards have modem-like CIS entries, so
456 we have to explicitly try a bunch of port combinations. */ 455 we have to explicitly try a bunch of port combinations. */
@@ -601,9 +600,9 @@ static int smc_configcheck(struct pcmcia_device *p_dev,
601 unsigned int vcc, 600 unsigned int vcc,
602 void *priv_data) 601 void *priv_data)
603{ 602{
604 p_dev->io.BasePort1 = cf->io.win[0].base; 603 p_dev->resource[0]->start = cf->io.win[0].base;
605 p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 604 p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
606 return pcmcia_request_io(p_dev, &p_dev->io); 605 return pcmcia_request_io(p_dev);
607} 606}
608 607
609static int smc_config(struct pcmcia_device *link) 608static int smc_config(struct pcmcia_device *link)
@@ -611,7 +610,7 @@ static int smc_config(struct pcmcia_device *link)
611 struct net_device *dev = link->priv; 610 struct net_device *dev = link->priv;
612 int i; 611 int i;
613 612
614 link->io.NumPorts1 = 16; 613 link->resource[0]->end = 16;
615 i = pcmcia_loop_config(link, smc_configcheck, NULL); 614 i = pcmcia_loop_config(link, smc_configcheck, NULL);
616 if (!i) 615 if (!i)
617 dev->base_addr = link->resource[0]->start; 616 dev->base_addr = link->resource[0]->start;
@@ -646,25 +645,25 @@ static int osi_config(struct pcmcia_device *link)
646 645
647 link->conf.Attributes |= CONF_ENABLE_SPKR; 646 link->conf.Attributes |= CONF_ENABLE_SPKR;
648 link->conf.Status = CCSR_AUDIO_ENA; 647 link->conf.Status = CCSR_AUDIO_ENA;
649 link->io.NumPorts1 = 64; 648 link->resource[0]->end = 64;
650 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 649 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
651 link->io.NumPorts2 = 8; 650 link->resource[1]->end = 8;
652 link->io.IOAddrLines = 16;
653 651
654 /* Enable Hard Decode, LAN, Modem */ 652 /* Enable Hard Decode, LAN, Modem */
655 link->conf.ConfigIndex = 0x23; 653 link->conf.ConfigIndex = 0x23;
654 link->io_lines = 16;
656 655
657 for (i = j = 0; j < 4; j++) { 656 for (i = j = 0; j < 4; j++) {
658 link->io.BasePort2 = com[j]; 657 link->resource[1]->start = com[j];
659 i = pcmcia_request_io(link, &link->io); 658 i = pcmcia_request_io(link);
660 if (i == 0) 659 if (i == 0)
661 break; 660 break;
662 } 661 }
663 if (i != 0) { 662 if (i != 0) {
664 /* Fallback: turn off hard decode */ 663 /* Fallback: turn off hard decode */
665 link->conf.ConfigIndex = 0x03; 664 link->conf.ConfigIndex = 0x03;
666 link->io.NumPorts2 = 0; 665 link->resource[1]->end = 0;
667 i = pcmcia_request_io(link, &link->io); 666 i = pcmcia_request_io(link);
668 } 667 }
669 dev->base_addr = link->resource[0]->start + 0x10; 668 dev->base_addr = link->resource[0]->start + 0x10;
670 return i; 669 return i;
@@ -803,7 +802,7 @@ static int check_sig(struct pcmcia_device *link)
803 } 802 }
804 803
805 /* Try setting bus width */ 804 /* Try setting bus width */
806 width = (link->io.Attributes1 == IO_DATA_PATH_WIDTH_AUTO); 805 width = (link->resource[0]->flags == IO_DATA_PATH_WIDTH_AUTO);
807 s = inb(ioaddr + CONFIG); 806 s = inb(ioaddr + CONFIG);
808 if (width) 807 if (width)
809 s |= CFG_16BIT; 808 s |= CFG_16BIT;