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.c114
1 files changed, 53 insertions, 61 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index a18b02a9a687..a4ee3057b831 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -279,8 +279,8 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002,
279/*====================================================================*/ 279/*====================================================================*/
280 280
281static void smc91c92_detach(struct pcmcia_device *p_dev); 281static void smc91c92_detach(struct pcmcia_device *p_dev);
282static void smc91c92_config(dev_link_t *link); 282static void smc91c92_config(struct pcmcia_device *link);
283static void smc91c92_release(dev_link_t *link); 283static void smc91c92_release(struct pcmcia_device *link);
284 284
285static int smc_open(struct net_device *dev); 285static int smc_open(struct net_device *dev);
286static int smc_close(struct net_device *dev); 286static int smc_close(struct net_device *dev);
@@ -309,11 +309,10 @@ static struct ethtool_ops ethtool_ops;
309 309
310======================================================================*/ 310======================================================================*/
311 311
312static int smc91c92_attach(struct pcmcia_device *p_dev) 312static int smc91c92_attach(struct pcmcia_device *link)
313{ 313{
314 struct smc_private *smc; 314 struct smc_private *smc;
315 struct net_device *dev; 315 struct net_device *dev;
316 dev_link_t *link = dev_to_instance(p_dev);
317 316
318 DEBUG(0, "smc91c92_attach()\n"); 317 DEBUG(0, "smc91c92_attach()\n");
319 318
@@ -322,7 +321,7 @@ static int smc91c92_attach(struct pcmcia_device *p_dev)
322 if (!dev) 321 if (!dev)
323 return -ENOMEM; 322 return -ENOMEM;
324 smc = netdev_priv(dev); 323 smc = netdev_priv(dev);
325 smc->p_dev = p_dev; 324 smc->p_dev = link;
326 link->priv = dev; 325 link->priv = dev;
327 326
328 spin_lock_init(&smc->lock); 327 spin_lock_init(&smc->lock);
@@ -372,9 +371,8 @@ static int smc91c92_attach(struct pcmcia_device *p_dev)
372 371
373======================================================================*/ 372======================================================================*/
374 373
375static void smc91c92_detach(struct pcmcia_device *p_dev) 374static void smc91c92_detach(struct pcmcia_device *link)
376{ 375{
377 dev_link_t *link = dev_to_instance(p_dev);
378 struct net_device *dev = link->priv; 376 struct net_device *dev = link->priv;
379 377
380 DEBUG(0, "smc91c92_detach(0x%p)\n", link); 378 DEBUG(0, "smc91c92_detach(0x%p)\n", link);
@@ -411,7 +409,7 @@ static int cvt_ascii_address(struct net_device *dev, char *s)
411 409
412/*====================================================================*/ 410/*====================================================================*/
413 411
414static int first_tuple(client_handle_t handle, tuple_t *tuple, 412static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,
415 cisparse_t *parse) 413 cisparse_t *parse)
416{ 414{
417 int i; 415 int i;
@@ -422,7 +420,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple,
422 return pcmcia_parse_tuple(handle, tuple, parse); 420 return pcmcia_parse_tuple(handle, tuple, parse);
423} 421}
424 422
425static int next_tuple(client_handle_t handle, tuple_t *tuple, 423static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
426 cisparse_t *parse) 424 cisparse_t *parse)
427{ 425{
428 int i; 426 int i;
@@ -444,7 +442,7 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple,
444 442
445======================================================================*/ 443======================================================================*/
446 444
447static int mhz_3288_power(dev_link_t *link) 445static int mhz_3288_power(struct pcmcia_device *link)
448{ 446{
449 struct net_device *dev = link->priv; 447 struct net_device *dev = link->priv;
450 struct smc_private *smc = netdev_priv(dev); 448 struct smc_private *smc = netdev_priv(dev);
@@ -466,7 +464,7 @@ static int mhz_3288_power(dev_link_t *link)
466 return 0; 464 return 0;
467} 465}
468 466
469static int mhz_mfc_config(dev_link_t *link) 467static int mhz_mfc_config(struct pcmcia_device *link)
470{ 468{
471 struct net_device *dev = link->priv; 469 struct net_device *dev = link->priv;
472 struct smc_private *smc = netdev_priv(dev); 470 struct smc_private *smc = netdev_priv(dev);
@@ -501,7 +499,7 @@ static int mhz_mfc_config(dev_link_t *link)
501 tuple->TupleDataMax = 255; 499 tuple->TupleDataMax = 255;
502 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 500 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;
503 501
504 i = first_tuple(link->handle, tuple, parse); 502 i = first_tuple(link, tuple, parse);
505 /* The Megahertz combo cards have modem-like CIS entries, so 503 /* The Megahertz combo cards have modem-like CIS entries, so
506 we have to explicitly try a bunch of port combinations. */ 504 we have to explicitly try a bunch of port combinations. */
507 while (i == CS_SUCCESS) { 505 while (i == CS_SUCCESS) {
@@ -510,11 +508,11 @@ static int mhz_mfc_config(dev_link_t *link)
510 for (k = 0; k < 0x400; k += 0x10) { 508 for (k = 0; k < 0x400; k += 0x10) {
511 if (k & 0x80) continue; 509 if (k & 0x80) continue;
512 link->io.BasePort1 = k ^ 0x300; 510 link->io.BasePort1 = k ^ 0x300;
513 i = pcmcia_request_io(link->handle, &link->io); 511 i = pcmcia_request_io(link, &link->io);
514 if (i == CS_SUCCESS) break; 512 if (i == CS_SUCCESS) break;
515 } 513 }
516 if (i == CS_SUCCESS) break; 514 if (i == CS_SUCCESS) break;
517 i = next_tuple(link->handle, tuple, parse); 515 i = next_tuple(link, tuple, parse);
518 } 516 }
519 if (i != CS_SUCCESS) 517 if (i != CS_SUCCESS)
520 goto free_cfg_mem; 518 goto free_cfg_mem;
@@ -524,7 +522,7 @@ static int mhz_mfc_config(dev_link_t *link)
524 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 522 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
525 req.Base = req.Size = 0; 523 req.Base = req.Size = 0;
526 req.AccessSpeed = 0; 524 req.AccessSpeed = 0;
527 i = pcmcia_request_window(&link->handle, &req, &link->win); 525 i = pcmcia_request_window(&link, &req, &link->win);
528 if (i != CS_SUCCESS) 526 if (i != CS_SUCCESS)
529 goto free_cfg_mem; 527 goto free_cfg_mem;
530 smc->base = ioremap(req.Base, req.Size); 528 smc->base = ioremap(req.Base, req.Size);
@@ -543,9 +541,8 @@ free_cfg_mem:
543 return i; 541 return i;
544} 542}
545 543
546static int mhz_setup(dev_link_t *link) 544static int mhz_setup(struct pcmcia_device *link)
547{ 545{
548 client_handle_t handle = link->handle;
549 struct net_device *dev = link->priv; 546 struct net_device *dev = link->priv;
550 struct smc_cfg_mem *cfg_mem; 547 struct smc_cfg_mem *cfg_mem;
551 tuple_t *tuple; 548 tuple_t *tuple;
@@ -568,13 +565,13 @@ static int mhz_setup(dev_link_t *link)
568 /* Read the station address from the CIS. It is stored as the last 565 /* Read the station address from the CIS. It is stored as the last
569 (fourth) string in the Version 1 Version/ID tuple. */ 566 (fourth) string in the Version 1 Version/ID tuple. */
570 tuple->DesiredTuple = CISTPL_VERS_1; 567 tuple->DesiredTuple = CISTPL_VERS_1;
571 if (first_tuple(handle, tuple, parse) != CS_SUCCESS) { 568 if (first_tuple(link, tuple, parse) != CS_SUCCESS) {
572 rc = -1; 569 rc = -1;
573 goto free_cfg_mem; 570 goto free_cfg_mem;
574 } 571 }
575 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ 572 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */
576 if (next_tuple(handle, tuple, parse) != CS_SUCCESS) 573 if (next_tuple(link, tuple, parse) != CS_SUCCESS)
577 first_tuple(handle, tuple, parse); 574 first_tuple(link, tuple, parse);
578 if (parse->version_1.ns > 3) { 575 if (parse->version_1.ns > 3) {
579 station_addr = parse->version_1.str + parse->version_1.ofs[3]; 576 station_addr = parse->version_1.str + parse->version_1.ofs[3];
580 if (cvt_ascii_address(dev, station_addr) == 0) { 577 if (cvt_ascii_address(dev, station_addr) == 0) {
@@ -585,11 +582,11 @@ static int mhz_setup(dev_link_t *link)
585 582
586 /* Another possibility: for the EM3288, in a special tuple */ 583 /* Another possibility: for the EM3288, in a special tuple */
587 tuple->DesiredTuple = 0x81; 584 tuple->DesiredTuple = 0x81;
588 if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) { 585 if (pcmcia_get_first_tuple(link, tuple) != CS_SUCCESS) {
589 rc = -1; 586 rc = -1;
590 goto free_cfg_mem; 587 goto free_cfg_mem;
591 } 588 }
592 if (pcmcia_get_tuple_data(handle, tuple) != CS_SUCCESS) { 589 if (pcmcia_get_tuple_data(link, tuple) != CS_SUCCESS) {
593 rc = -1; 590 rc = -1;
594 goto free_cfg_mem; 591 goto free_cfg_mem;
595 } 592 }
@@ -613,7 +610,7 @@ free_cfg_mem:
613 610
614======================================================================*/ 611======================================================================*/
615 612
616static void mot_config(dev_link_t *link) 613static void mot_config(struct pcmcia_device *link)
617{ 614{
618 struct net_device *dev = link->priv; 615 struct net_device *dev = link->priv;
619 struct smc_private *smc = netdev_priv(dev); 616 struct smc_private *smc = netdev_priv(dev);
@@ -634,7 +631,7 @@ static void mot_config(dev_link_t *link)
634 mdelay(100); 631 mdelay(100);
635} 632}
636 633
637static int mot_setup(dev_link_t *link) 634static int mot_setup(struct pcmcia_device *link)
638{ 635{
639 struct net_device *dev = link->priv; 636 struct net_device *dev = link->priv;
640 kio_addr_t ioaddr = dev->base_addr; 637 kio_addr_t ioaddr = dev->base_addr;
@@ -668,7 +665,7 @@ static int mot_setup(dev_link_t *link)
668 665
669/*====================================================================*/ 666/*====================================================================*/
670 667
671static int smc_config(dev_link_t *link) 668static int smc_config(struct pcmcia_device *link)
672{ 669{
673 struct net_device *dev = link->priv; 670 struct net_device *dev = link->priv;
674 struct smc_cfg_mem *cfg_mem; 671 struct smc_cfg_mem *cfg_mem;
@@ -693,16 +690,16 @@ static int smc_config(dev_link_t *link)
693 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 690 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;
694 691
695 link->io.NumPorts1 = 16; 692 link->io.NumPorts1 = 16;
696 i = first_tuple(link->handle, tuple, parse); 693 i = first_tuple(link, tuple, parse);
697 while (i != CS_NO_MORE_ITEMS) { 694 while (i != CS_NO_MORE_ITEMS) {
698 if (i == CS_SUCCESS) { 695 if (i == CS_SUCCESS) {
699 link->conf.ConfigIndex = cf->index; 696 link->conf.ConfigIndex = cf->index;
700 link->io.BasePort1 = cf->io.win[0].base; 697 link->io.BasePort1 = cf->io.win[0].base;
701 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK; 698 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
702 i = pcmcia_request_io(link->handle, &link->io); 699 i = pcmcia_request_io(link, &link->io);
703 if (i == CS_SUCCESS) break; 700 if (i == CS_SUCCESS) break;
704 } 701 }
705 i = next_tuple(link->handle, tuple, parse); 702 i = next_tuple(link, tuple, parse);
706 } 703 }
707 if (i == CS_SUCCESS) 704 if (i == CS_SUCCESS)
708 dev->base_addr = link->io.BasePort1; 705 dev->base_addr = link->io.BasePort1;
@@ -711,9 +708,8 @@ static int smc_config(dev_link_t *link)
711 return i; 708 return i;
712} 709}
713 710
714static int smc_setup(dev_link_t *link) 711static int smc_setup(struct pcmcia_device *link)
715{ 712{
716 client_handle_t handle = link->handle;
717 struct net_device *dev = link->priv; 713 struct net_device *dev = link->priv;
718 struct smc_cfg_mem *cfg_mem; 714 struct smc_cfg_mem *cfg_mem;
719 tuple_t *tuple; 715 tuple_t *tuple;
@@ -736,11 +732,11 @@ static int smc_setup(dev_link_t *link)
736 732
737 /* Check for a LAN function extension tuple */ 733 /* Check for a LAN function extension tuple */
738 tuple->DesiredTuple = CISTPL_FUNCE; 734 tuple->DesiredTuple = CISTPL_FUNCE;
739 i = first_tuple(handle, tuple, parse); 735 i = first_tuple(link, tuple, parse);
740 while (i == CS_SUCCESS) { 736 while (i == CS_SUCCESS) {
741 if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID) 737 if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID)
742 break; 738 break;
743 i = next_tuple(handle, tuple, parse); 739 i = next_tuple(link, tuple, parse);
744 } 740 }
745 if (i == CS_SUCCESS) { 741 if (i == CS_SUCCESS) {
746 node_id = (cistpl_lan_node_id_t *)parse->funce.data; 742 node_id = (cistpl_lan_node_id_t *)parse->funce.data;
@@ -753,7 +749,7 @@ static int smc_setup(dev_link_t *link)
753 } 749 }
754 /* Try the third string in the Version 1 Version/ID tuple. */ 750 /* Try the third string in the Version 1 Version/ID tuple. */
755 tuple->DesiredTuple = CISTPL_VERS_1; 751 tuple->DesiredTuple = CISTPL_VERS_1;
756 if (first_tuple(handle, tuple, parse) != CS_SUCCESS) { 752 if (first_tuple(link, tuple, parse) != CS_SUCCESS) {
757 rc = -1; 753 rc = -1;
758 goto free_cfg_mem; 754 goto free_cfg_mem;
759 } 755 }
@@ -771,7 +767,7 @@ free_cfg_mem:
771 767
772/*====================================================================*/ 768/*====================================================================*/
773 769
774static int osi_config(dev_link_t *link) 770static int osi_config(struct pcmcia_device *link)
775{ 771{
776 struct net_device *dev = link->priv; 772 struct net_device *dev = link->priv;
777 static const kio_addr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; 773 static const kio_addr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
@@ -791,22 +787,21 @@ static int osi_config(dev_link_t *link)
791 787
792 for (i = j = 0; j < 4; j++) { 788 for (i = j = 0; j < 4; j++) {
793 link->io.BasePort2 = com[j]; 789 link->io.BasePort2 = com[j];
794 i = pcmcia_request_io(link->handle, &link->io); 790 i = pcmcia_request_io(link, &link->io);
795 if (i == CS_SUCCESS) break; 791 if (i == CS_SUCCESS) break;
796 } 792 }
797 if (i != CS_SUCCESS) { 793 if (i != CS_SUCCESS) {
798 /* Fallback: turn off hard decode */ 794 /* Fallback: turn off hard decode */
799 link->conf.ConfigIndex = 0x03; 795 link->conf.ConfigIndex = 0x03;
800 link->io.NumPorts2 = 0; 796 link->io.NumPorts2 = 0;
801 i = pcmcia_request_io(link->handle, &link->io); 797 i = pcmcia_request_io(link, &link->io);
802 } 798 }
803 dev->base_addr = link->io.BasePort1 + 0x10; 799 dev->base_addr = link->io.BasePort1 + 0x10;
804 return i; 800 return i;
805} 801}
806 802
807static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid) 803static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)
808{ 804{
809 client_handle_t handle = link->handle;
810 struct net_device *dev = link->priv; 805 struct net_device *dev = link->priv;
811 struct smc_cfg_mem *cfg_mem; 806 struct smc_cfg_mem *cfg_mem;
812 tuple_t *tuple; 807 tuple_t *tuple;
@@ -827,12 +822,12 @@ static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid)
827 822
828 /* Read the station address from tuple 0x90, subtuple 0x04 */ 823 /* Read the station address from tuple 0x90, subtuple 0x04 */
829 tuple->DesiredTuple = 0x90; 824 tuple->DesiredTuple = 0x90;
830 i = pcmcia_get_first_tuple(handle, tuple); 825 i = pcmcia_get_first_tuple(link, tuple);
831 while (i == CS_SUCCESS) { 826 while (i == CS_SUCCESS) {
832 i = pcmcia_get_tuple_data(handle, tuple); 827 i = pcmcia_get_tuple_data(link, tuple);
833 if ((i != CS_SUCCESS) || (buf[0] == 0x04)) 828 if ((i != CS_SUCCESS) || (buf[0] == 0x04))
834 break; 829 break;
835 i = pcmcia_get_next_tuple(handle, tuple); 830 i = pcmcia_get_next_tuple(link, tuple);
836 } 831 }
837 if (i != CS_SUCCESS) { 832 if (i != CS_SUCCESS) {
838 rc = -1; 833 rc = -1;
@@ -865,9 +860,8 @@ free_cfg_mem:
865 return rc; 860 return rc;
866} 861}
867 862
868static int smc91c92_suspend(struct pcmcia_device *p_dev) 863static int smc91c92_suspend(struct pcmcia_device *link)
869{ 864{
870 dev_link_t *link = dev_to_instance(p_dev);
871 struct net_device *dev = link->priv; 865 struct net_device *dev = link->priv;
872 866
873 if ((link->state & DEV_CONFIG) && (link->open)) 867 if ((link->state & DEV_CONFIG) && (link->open))
@@ -876,9 +870,8 @@ static int smc91c92_suspend(struct pcmcia_device *p_dev)
876 return 0; 870 return 0;
877} 871}
878 872
879static int smc91c92_resume(struct pcmcia_device *p_dev) 873static int smc91c92_resume(struct pcmcia_device *link)
880{ 874{
881 dev_link_t *link = dev_to_instance(p_dev);
882 struct net_device *dev = link->priv; 875 struct net_device *dev = link->priv;
883 struct smc_private *smc = netdev_priv(dev); 876 struct smc_private *smc = netdev_priv(dev);
884 int i; 877 int i;
@@ -922,7 +915,7 @@ static int smc91c92_resume(struct pcmcia_device *p_dev)
922 915
923======================================================================*/ 916======================================================================*/
924 917
925static int check_sig(dev_link_t *link) 918static int check_sig(struct pcmcia_device *link)
926{ 919{
927 struct net_device *dev = link->priv; 920 struct net_device *dev = link->priv;
928 kio_addr_t ioaddr = dev->base_addr; 921 kio_addr_t ioaddr = dev->base_addr;
@@ -960,9 +953,9 @@ static int check_sig(dev_link_t *link)
960 }; 953 };
961 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); 954 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
962 955
963 smc91c92_suspend(link->handle); 956 smc91c92_suspend(link);
964 pcmcia_modify_configuration(link->handle, &mod); 957 pcmcia_modify_configuration(link, &mod);
965 smc91c92_resume(link->handle); 958 smc91c92_resume(link);
966 return check_sig(link); 959 return check_sig(link);
967 } 960 }
968 return -ENODEV; 961 return -ENODEV;
@@ -977,11 +970,10 @@ static int check_sig(dev_link_t *link)
977======================================================================*/ 970======================================================================*/
978 971
979#define CS_EXIT_TEST(ret, svc, label) \ 972#define CS_EXIT_TEST(ret, svc, label) \
980if (ret != CS_SUCCESS) { cs_error(link->handle, svc, ret); goto label; } 973if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; }
981 974
982static void smc91c92_config(dev_link_t *link) 975static void smc91c92_config(struct pcmcia_device *link)
983{ 976{
984 client_handle_t handle = link->handle;
985 struct net_device *dev = link->priv; 977 struct net_device *dev = link->priv;
986 struct smc_private *smc = netdev_priv(dev); 978 struct smc_private *smc = netdev_priv(dev);
987 struct smc_cfg_mem *cfg_mem; 979 struct smc_cfg_mem *cfg_mem;
@@ -1008,14 +1000,14 @@ static void smc91c92_config(dev_link_t *link)
1008 tuple->TupleDataMax = 64; 1000 tuple->TupleDataMax = 64;
1009 1001
1010 tuple->DesiredTuple = CISTPL_CONFIG; 1002 tuple->DesiredTuple = CISTPL_CONFIG;
1011 i = first_tuple(handle, tuple, parse); 1003 i = first_tuple(link, tuple, parse);
1012 CS_EXIT_TEST(i, ParseTuple, config_failed); 1004 CS_EXIT_TEST(i, ParseTuple, config_failed);
1013 link->conf.ConfigBase = parse->config.base; 1005 link->conf.ConfigBase = parse->config.base;
1014 link->conf.Present = parse->config.rmask[0]; 1006 link->conf.Present = parse->config.rmask[0];
1015 1007
1016 tuple->DesiredTuple = CISTPL_MANFID; 1008 tuple->DesiredTuple = CISTPL_MANFID;
1017 tuple->Attributes = TUPLE_RETURN_COMMON; 1009 tuple->Attributes = TUPLE_RETURN_COMMON;
1018 if (first_tuple(handle, tuple, parse) == CS_SUCCESS) { 1010 if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
1019 smc->manfid = parse->manfid.manf; 1011 smc->manfid = parse->manfid.manf;
1020 smc->cardid = parse->manfid.card; 1012 smc->cardid = parse->manfid.card;
1021 } 1013 }
@@ -1036,9 +1028,9 @@ static void smc91c92_config(dev_link_t *link)
1036 } 1028 }
1037 CS_EXIT_TEST(i, RequestIO, config_failed); 1029 CS_EXIT_TEST(i, RequestIO, config_failed);
1038 1030
1039 i = pcmcia_request_irq(link->handle, &link->irq); 1031 i = pcmcia_request_irq(link, &link->irq);
1040 CS_EXIT_TEST(i, RequestIRQ, config_failed); 1032 CS_EXIT_TEST(i, RequestIRQ, config_failed);
1041 i = pcmcia_request_configuration(link->handle, &link->conf); 1033 i = pcmcia_request_configuration(link, &link->conf);
1042 CS_EXIT_TEST(i, RequestConfiguration, config_failed); 1034 CS_EXIT_TEST(i, RequestConfiguration, config_failed);
1043 1035
1044 if (smc->manfid == MANFID_MOTOROLA) 1036 if (smc->manfid == MANFID_MOTOROLA)
@@ -1119,7 +1111,7 @@ static void smc91c92_config(dev_link_t *link)
1119 1111
1120 link->dev_node = &smc->node; 1112 link->dev_node = &smc->node;
1121 link->state &= ~DEV_CONFIG_PENDING; 1113 link->state &= ~DEV_CONFIG_PENDING;
1122 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 1114 SET_NETDEV_DEV(dev, &handle_to_dev(link));
1123 1115
1124 if (register_netdev(dev) != 0) { 1116 if (register_netdev(dev) != 0) {
1125 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); 1117 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
@@ -1172,7 +1164,7 @@ config_failed: /* CS_EXIT_TEST() calls jump to here... */
1172 1164
1173======================================================================*/ 1165======================================================================*/
1174 1166
1175static void smc91c92_release(dev_link_t *link) 1167static void smc91c92_release(struct pcmcia_device *link)
1176{ 1168{
1177 DEBUG(0, "smc91c92_release(0x%p)\n", link); 1169 DEBUG(0, "smc91c92_release(0x%p)\n", link);
1178 if (link->win) { 1170 if (link->win) {
@@ -1180,7 +1172,7 @@ static void smc91c92_release(dev_link_t *link)
1180 struct smc_private *smc = netdev_priv(dev); 1172 struct smc_private *smc = netdev_priv(dev);
1181 iounmap(smc->base); 1173 iounmap(smc->base);
1182 } 1174 }
1183 pcmcia_disable_device(link->handle); 1175 pcmcia_disable_device(link);
1184} 1176}
1185 1177
1186/*====================================================================== 1178/*======================================================================
@@ -1269,7 +1261,7 @@ static void smc_dump(struct net_device *dev)
1269static int smc_open(struct net_device *dev) 1261static int smc_open(struct net_device *dev)
1270{ 1262{
1271 struct smc_private *smc = netdev_priv(dev); 1263 struct smc_private *smc = netdev_priv(dev);
1272 dev_link_t *link = smc->p_dev; 1264 struct pcmcia_device *link = smc->p_dev;
1273 1265
1274#ifdef PCMCIA_DEBUG 1266#ifdef PCMCIA_DEBUG
1275 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n", 1267 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n",
@@ -1306,7 +1298,7 @@ static int smc_open(struct net_device *dev)
1306static int smc_close(struct net_device *dev) 1298static int smc_close(struct net_device *dev)
1307{ 1299{
1308 struct smc_private *smc = netdev_priv(dev); 1300 struct smc_private *smc = netdev_priv(dev);
1309 dev_link_t *link = smc->p_dev; 1301 struct pcmcia_device *link = smc->p_dev;
1310 kio_addr_t ioaddr = dev->base_addr; 1302 kio_addr_t ioaddr = dev->base_addr;
1311 1303
1312 DEBUG(0, "%s: smc_close(), status %4.4x.\n", 1304 DEBUG(0, "%s: smc_close(), status %4.4x.\n",