[PATCH] Support Omnikey CardMan 4040

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Support Omnikey CardMan 4040

Harald Welte
Hi!

The attached patch adds Omnikey CardMan 4040 Support to openct.  

The device is a bit ugly, basically it seems like somebody attached a
USB CCID reader to some IO-mapped FIFO.  It doesn't generate FIFO status
interrupts, so it needs to be polled.

Omnikey provides a Dual BSD/GPL licensed kernel driver that provides a
/dev/cmxN interface for the CardMan 4040 [1].  Unfortunately they only
provide a x86-binary-only PC/SC ifdhandler on top of that driver.

Using the patch below, you can use OpenCT with the original omnikey
driver, as well as my re-vamped 2.6.13-merged and cleaned up version
[2].

The changes to ifd-ccid.c are:
1) make usb config descriptor parsing conditional to USB
2) add initialization for PCMCIA variant
3) Only ask for 10 bytes when issuing CCID_CMD_GETSLOTSTAT (which is
   fixed size of 10 bytes according to ccid spec 1.00a anyway)

We cannot re-use the existing pcmcia.c routines, since the latter is
character-oriented (i.e. if you write 100 bytes, it loops until those
100 bytes are written).  This doesn't work with the cm4040 kernel
driver, since it is more block-oriented (or better: packet oriented).

Please review, comment (or event apply!).  Thanks!

[1] http://www.omnikey.com/index.php?id=5
[2] http://svn.gnumonks.org/trunk/omnikey_cardman/new/kernel/cm4040/

--
- Harald Welte <[hidden email]>                  http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

cm4040.patch (13K) Download Attachment
attachment1 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Support Omnikey CardMan 4040

Andreas Jellinghaus-2
On Sunday 04 September 2005 11:23, Harald Welte wrote:

> The changes to ifd-ccid.c are:
> 1) make usb config descriptor parsing conditional to USB
> 2) add initialization for PCMCIA variant
> 3) Only ask for 10 bytes when issuing CCID_CMD_GETSLOTSTAT (which is
>    fixed size of 10 bytes according to ccid spec 1.00a anyway)
>
> We cannot re-use the existing pcmcia.c routines, since the latter is
> character-oriented (i.e. if you write 100 bytes, it loops until those
> 100 bytes are written).  This doesn't work with the cm4040 kernel
> driver, since it is more block-oriented (or better: packet oriented).
>
> Please review, comment (or event apply!).  Thanks!

thanks, acked by chaskiel and commited.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Support Omnikey CardMan 4040

Harald Welte
On Sun, Sep 04, 2005 at 03:42:39PM +0200, Andreas Jellinghaus wrote:
> > Please review, comment (or event apply!).  Thanks!
>
> thanks, acked by chaskiel and commited.

Great!

Now I am cleaning up the modifications required for my librfid to
interact with OpenCT.  It again requires some ifd-ccid.c hacks,
basically I need to expose the host_to_rdr_escape.

I'll write up a small document describing the whole openct/librfid
integration, since it's not trivial.

Stay tuned.

--
- Harald Welte <[hidden email]>                  http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

attachment0 (196 bytes) Download Attachment