aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_cs.c')
-rw-r--r--drivers/serial/serial_cs.c67
1 files changed, 39 insertions, 28 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 00f9ffd69489..431433f4dd6d 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -723,7 +723,7 @@ static int serial_config(struct pcmcia_device * link)
723 u_char *buf; 723 u_char *buf;
724 cisparse_t *parse; 724 cisparse_t *parse;
725 cistpl_cftable_entry_t *cf; 725 cistpl_cftable_entry_t *cf;
726 int i, last_ret, last_fn; 726 int i;
727 727
728 DEBUG(0, "serial_config(0x%p)\n", link); 728 DEBUG(0, "serial_config(0x%p)\n", link);
729 729
@@ -740,15 +740,6 @@ static int serial_config(struct pcmcia_device * link)
740 tuple->TupleOffset = 0; 740 tuple->TupleOffset = 0;
741 tuple->TupleDataMax = 255; 741 tuple->TupleDataMax = 255;
742 tuple->Attributes = 0; 742 tuple->Attributes = 0;
743 /* Get configuration register information */
744 tuple->DesiredTuple = CISTPL_CONFIG;
745 last_ret = first_tuple(link, tuple, parse);
746 if (last_ret != CS_SUCCESS) {
747 last_fn = ParseTuple;
748 goto cs_failed;
749 }
750 link->conf.ConfigBase = parse->config.base;
751 link->conf.Present = parse->config.rmask[0];
752 743
753 /* Is this a compliant multifunction card? */ 744 /* Is this a compliant multifunction card? */
754 tuple->DesiredTuple = CISTPL_LONGLINK_MFC; 745 tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
@@ -757,27 +748,25 @@ static int serial_config(struct pcmcia_device * link)
757 748
758 /* Is this a multiport card? */ 749 /* Is this a multiport card? */
759 tuple->DesiredTuple = CISTPL_MANFID; 750 tuple->DesiredTuple = CISTPL_MANFID;
760 if (first_tuple(link, tuple, parse) == CS_SUCCESS) { 751 info->manfid = link->manf_id;
761 info->manfid = parse->manfid.manf; 752 info->prodid = link->card_id;
762 info->prodid = parse->manfid.card; 753
763 754 for (i = 0; i < ARRAY_SIZE(quirks); i++)
764 for (i = 0; i < ARRAY_SIZE(quirks); i++) 755 if ((quirks[i].manfid == ~0 ||
765 if ((quirks[i].manfid == ~0 || 756 quirks[i].manfid == info->manfid) &&
766 quirks[i].manfid == info->manfid) && 757 (quirks[i].prodid == ~0 ||
767 (quirks[i].prodid == ~0 || 758 quirks[i].prodid == info->prodid)) {
768 quirks[i].prodid == info->prodid)) { 759 info->quirk = &quirks[i];
769 info->quirk = &quirks[i]; 760 break;
770 break; 761 }
771 }
772 }
773 762
774 /* Another check for dual-serial cards: look for either serial or 763 /* Another check for dual-serial cards: look for either serial or
775 multifunction cards that ask for appropriate IO port ranges */ 764 multifunction cards that ask for appropriate IO port ranges */
776 tuple->DesiredTuple = CISTPL_FUNCID; 765 tuple->DesiredTuple = CISTPL_FUNCID;
777 if ((info->multi == 0) && 766 if ((info->multi == 0) &&
778 ((first_tuple(link, tuple, parse) != CS_SUCCESS) || 767 (link->has_func_id) &&
779 (parse->funcid.func == CISTPL_FUNCID_MULTI) || 768 ((link->func_id == CISTPL_FUNCID_MULTI) ||
780 (parse->funcid.func == CISTPL_FUNCID_SERIAL))) { 769 (link->func_id == CISTPL_FUNCID_SERIAL))) {
781 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 770 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;
782 if (first_tuple(link, tuple, parse) == CS_SUCCESS) { 771 if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
783 if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0)) 772 if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0))
@@ -814,8 +803,6 @@ static int serial_config(struct pcmcia_device * link)
814 kfree(cfg_mem); 803 kfree(cfg_mem);
815 return 0; 804 return 0;
816 805
817 cs_failed:
818 cs_error(link, last_fn, last_ret);
819 failed: 806 failed:
820 serial_remove(link); 807 serial_remove(link);
821 kfree(cfg_mem); 808 kfree(cfg_mem);
@@ -925,6 +912,30 @@ static struct pcmcia_device_id serial_ids[] = {
925 PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), 912 PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"),
926 PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"), 913 PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"),
927 PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"), 914 PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"),
915 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100 1.00.",0x19ca78af,0xf964f42b),
916 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100",0x19ca78af,0x71d98e83),
917 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL232 1.00.",0x19ca78af,0x69fb7490),
918 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL232",0x19ca78af,0xb6bc0235),
919 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.","SERIAL CARD: CF232",0x63f2e0bd,0xb9e175d3),
920 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.","SERIAL CARD: CF232-5",0x63f2e0bd,0xfce33442),
921 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF232",0x3beb8cf2,0x171e7190),
922 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF232-5",0x3beb8cf2,0x20da4262),
923 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF428",0x3beb8cf2,0xea5dd57d),
924 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF500",0x3beb8cf2,0xd77255fa),
925 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: IC232",0x3beb8cf2,0x6a709903),
926 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: SL232",0x3beb8cf2,0x18430676),
927 PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: XL232",0x3beb8cf2,0x6f933767),
928 PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: CF332",0x3beb8cf2,0x16dc1ba7),
929 PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL332",0x3beb8cf2,0x19816c41),
930 PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL385",0x3beb8cf2,0x64112029),
931 PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
932 PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc),
933 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: CF332",0x3beb8cf2,0x16dc1ba7),
934 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL332",0x3beb8cf2,0x19816c41),
935 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL385",0x3beb8cf2,0x64112029),
936 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
937 PCMCIA_MFC_DEVICE_PROD_ID12(2,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
938 PCMCIA_MFC_DEVICE_PROD_ID12(3,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
928 /* too generic */ 939 /* too generic */
929 /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */ 940 /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */
930 /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */ 941 /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */