diff options
Diffstat (limited to 'drivers/net/pcmcia/smc91c92_cs.c')
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 59 |
1 files changed, 10 insertions, 49 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 20fcc3576202..530df8883fe5 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -560,16 +560,8 @@ static int mhz_setup(struct pcmcia_device *link) | |||
560 | 560 | ||
561 | /* Read the station address from the CIS. It is stored as the last | 561 | /* Read the station address from the CIS. It is stored as the last |
562 | (fourth) string in the Version 1 Version/ID tuple. */ | 562 | (fourth) string in the Version 1 Version/ID tuple. */ |
563 | tuple->DesiredTuple = CISTPL_VERS_1; | 563 | if (link->prod_id[3]) { |
564 | if (first_tuple(link, tuple, parse) != CS_SUCCESS) { | 564 | station_addr = link->prod_id[3]; |
565 | rc = -1; | ||
566 | goto free_cfg_mem; | ||
567 | } | ||
568 | /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ | ||
569 | if (next_tuple(link, tuple, parse) != CS_SUCCESS) | ||
570 | first_tuple(link, tuple, parse); | ||
571 | if (parse->version_1.ns > 3) { | ||
572 | station_addr = parse->version_1.str + parse->version_1.ofs[3]; | ||
573 | if (cvt_ascii_address(dev, station_addr) == 0) { | 565 | if (cvt_ascii_address(dev, station_addr) == 0) { |
574 | rc = 0; | 566 | rc = 0; |
575 | goto free_cfg_mem; | 567 | goto free_cfg_mem; |
@@ -744,15 +736,12 @@ static int smc_setup(struct pcmcia_device *link) | |||
744 | } | 736 | } |
745 | } | 737 | } |
746 | /* Try the third string in the Version 1 Version/ID tuple. */ | 738 | /* Try the third string in the Version 1 Version/ID tuple. */ |
747 | tuple->DesiredTuple = CISTPL_VERS_1; | 739 | if (link->prod_id[2]) { |
748 | if (first_tuple(link, tuple, parse) != CS_SUCCESS) { | 740 | station_addr = link->prod_id[2]; |
749 | rc = -1; | 741 | if (cvt_ascii_address(dev, station_addr) == 0) { |
750 | goto free_cfg_mem; | 742 | rc = 0; |
751 | } | 743 | goto free_cfg_mem; |
752 | station_addr = parse->version_1.str + parse->version_1.ofs[2]; | 744 | } |
753 | if (cvt_ascii_address(dev, station_addr) == 0) { | ||
754 | rc = 0; | ||
755 | goto free_cfg_mem; | ||
756 | } | 745 | } |
757 | 746 | ||
758 | rc = -1; | 747 | rc = -1; |
@@ -970,10 +959,6 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
970 | { | 959 | { |
971 | struct net_device *dev = link->priv; | 960 | struct net_device *dev = link->priv; |
972 | struct smc_private *smc = netdev_priv(dev); | 961 | struct smc_private *smc = netdev_priv(dev); |
973 | struct smc_cfg_mem *cfg_mem; | ||
974 | tuple_t *tuple; | ||
975 | cisparse_t *parse; | ||
976 | u_char *buf; | ||
977 | char *name; | 962 | char *name; |
978 | int i, j, rev; | 963 | int i, j, rev; |
979 | kio_addr_t ioaddr; | 964 | kio_addr_t ioaddr; |
@@ -981,30 +966,8 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
981 | 966 | ||
982 | DEBUG(0, "smc91c92_config(0x%p)\n", link); | 967 | DEBUG(0, "smc91c92_config(0x%p)\n", link); |
983 | 968 | ||
984 | cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); | 969 | smc->manfid = link->manf_id; |
985 | if (!cfg_mem) | 970 | smc->cardid = link->card_id; |
986 | goto config_failed; | ||
987 | |||
988 | tuple = &cfg_mem->tuple; | ||
989 | parse = &cfg_mem->parse; | ||
990 | buf = cfg_mem->buf; | ||
991 | |||
992 | tuple->Attributes = tuple->TupleOffset = 0; | ||
993 | tuple->TupleData = (cisdata_t *)buf; | ||
994 | tuple->TupleDataMax = 64; | ||
995 | |||
996 | tuple->DesiredTuple = CISTPL_CONFIG; | ||
997 | i = first_tuple(link, tuple, parse); | ||
998 | CS_EXIT_TEST(i, ParseTuple, config_failed); | ||
999 | link->conf.ConfigBase = parse->config.base; | ||
1000 | link->conf.Present = parse->config.rmask[0]; | ||
1001 | |||
1002 | tuple->DesiredTuple = CISTPL_MANFID; | ||
1003 | tuple->Attributes = TUPLE_RETURN_COMMON; | ||
1004 | if (first_tuple(link, tuple, parse) == CS_SUCCESS) { | ||
1005 | smc->manfid = parse->manfid.manf; | ||
1006 | smc->cardid = parse->manfid.card; | ||
1007 | } | ||
1008 | 971 | ||
1009 | if ((smc->manfid == MANFID_OSITECH) && | 972 | if ((smc->manfid == MANFID_OSITECH) && |
1010 | (smc->cardid != PRODID_OSITECH_SEVEN)) { | 973 | (smc->cardid != PRODID_OSITECH_SEVEN)) { |
@@ -1134,14 +1097,12 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
1134 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 1097 | printk(KERN_NOTICE " No MII transceivers found!\n"); |
1135 | } | 1098 | } |
1136 | } | 1099 | } |
1137 | kfree(cfg_mem); | ||
1138 | return 0; | 1100 | return 0; |
1139 | 1101 | ||
1140 | config_undo: | 1102 | config_undo: |
1141 | unregister_netdev(dev); | 1103 | unregister_netdev(dev); |
1142 | config_failed: /* CS_EXIT_TEST() calls jump to here... */ | 1104 | config_failed: /* CS_EXIT_TEST() calls jump to here... */ |
1143 | smc91c92_release(link); | 1105 | smc91c92_release(link); |
1144 | kfree(cfg_mem); | ||
1145 | return -ENODEV; | 1106 | return -ENODEV; |
1146 | } /* smc91c92_config */ | 1107 | } /* smc91c92_config */ |
1147 | 1108 | ||