Unix Technical Forum

attaching PCMCIA cards

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:30 AM
Marc Winiger
 
Posts: n/a
Default attaching PCMCIA cards

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com