Subject: pcmcia stuff
To: None <tech-kern@NetBSD.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 02/16/2006 07:59:44
Hey.

A few questions.

First (and foremost!), I want to add a member to struct
pcmcia_io_handle.  Basically, I need an opaque handle for use by the
chipset.  Much like struct pcmcia_mem_handle has an "mhandle" field, I
would declare an "ihandle" field.   I would declare it as void *, or
intptr_t.

This brings us to the 2nd issue.  struct pcmcia_mem_handle has a member
called "mhandle" which is just an opaque field for use by the chipset. 
Right now it is declared as "pcmcia_mem_handle_t", which is typedef'd to
"int".

There are two problems with this:

    1) on a 64-bit machine (LP model), mhandle is too small to hold a
pointer

    2) the type pcmcia_mem_handle_t is pretty confusing because it is
different than the structure "struct pcmcia_mem_handle".   I think it is
a reasonable convention that typedefs that end in xxx_t should be the
same as the struct xxx (assuming that there is such a struct).

I propose to solve both problems by changing the typedef to void *, or
if an integer type is preferred, I can use intptr_t.  (intptr_t might be
attractive because it means I don't have to add casts to pcic, which
assumes mhandle is an integral type.)

Does anyone out there feel any ownership for the pcmcia framework? 
There are other "issues" with the framework (e.g. inconsistency in the
handling of IO vs. memory vs. attribute space), but the above issues are
the most annoying.

I only need an answer to the first item (new ihandle member of struct
pcmcia_io_handle) right now.

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191