This is a discussion on attaching PCMCIA cards within the mailing.openbsd.tech forums, part of the OpenBSD category; --> com_pcmcia matches devices where pa->card->cis1_info[] values are NULL What do you think about that? Index: com_pcmcia.c ================================================== ================= RCS ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| com_pcmcia matches devices where pa->card->cis1_info[] values are NULL What do you think about that? Index: com_pcmcia.c ================================================== ================= RCS file: /var/cvs/src/sys/dev/pcmcia/com_pcmcia.c,v retrieving revision 1.46 diff -u -r1.46 com_pcmcia.c --- com_pcmcia.c 28 May 2006 16:49:46 -0000 1.46 +++ com_pcmcia.c 28 Jul 2007 10:03:47 -0000 @@ -183,7 +183,7 @@ { struct pcmcia_attach_args *pa = aux; struct pcmcia_config_entry *cfe; - int i, j, comportmask; + int i, comportmask; /* 1. Does it claim to be a serial device? */ if (pa->pf->function == PCMCIA_FUNCTION_SERIAL) @@ -214,13 +214,12 @@ /* 3. Is this a card we know about? */ for (i = 0; i < sizeof(com_pcmcia_prod)/sizeof(com_pcmcia_prod[0]); i++) { - for (j = 0; j < 4; j++) - if (com_pcmcia_prod[i].cis1_info[j] && - pa->card->cis1_info[j] && - strcmp(pa->card->cis1_info[j], - com_pcmcia_prod[i].cis1_info[j])) - break; - if (j == 4) + if (com_pcmcia_prod[i].cis1_info[0] && pa->card->cis1_info[0] && + com_pcmcia_prod[i].cis1_info[1] && pa->card->cis1_info[1] && + (strcmp(pa->card->cis1_info[0], + com_pcmcia_prod[i].cis1_info[0]) == 0) && + (strcmp(pa->card->cis1_info[1], + com_pcmcia_prod[i].cis1_info[1]) == 0)) return 1; } I have a Dual-UART 16c95x card, that is not yet supported because the CISTPL 3 (INDIRECT) is not handled. I think it is wrong to attach this card as pccom. See dmesg before and after my patch: cardslot_event_throw: an event 16-bit Card inserted comes cis mem map de972000 pcmcia0: CIS tuple chain: CISTPL_DEVICE type=null speed=null 01 02 00 ff unhandled CISTPL 3 03 00 CISTPL_END ff cis mem map de972000 CISTPL_LINKTARGET expected, code ff observed pccom3 at pcmcia0 function 0: can't allocate i/o space cardslot_event_throw: an event 16-bit Card inserted comes cis mem map de946000 pcmcia0: CIS tuple chain: CISTPL_DEVICE type=null speed=null 01 02 00 ff CISTPL_INDIRECT 03 00 CISTPL_END ff cis mem map de946000 CISTPL_LINKTARGET expected, code ff observed at pcmcia0 function 0 not configured |