[Pcsclite-muscle] OmniKey 4040 PCMCIA CCID card terminal

Marcin Cieslak saper at saper.info
Fri Nov 13 22:34:38 UTC 2015


On Fri, 13 Nov 2015, Ludovic Rousseau wrote:

> > I wish I wouldn't need to use that but my CCID PCMCIA reader is otherwise
> > not supported.
> >
> 
> I don't think it is a CCID reader if it uses PCMCIA.
> CCID is for USB (or USB over ExpressCard).

Omnikey CardMan 4040 uses CCID high-level protocol over FIFO
implemented using 3 I/O registers
(data, status and data flow/sync control register).

Basically the data read/written are standard CCID commands,
identified by their first byte:

PC_TO_RDR_SETPARAMETER (0x61), PC_TO_RDR_ICCPOWERON (0x62)
CMD_PC_TO_RDR_XFRBLOCK (0x6F) etc. etc.

Basically the kernel driver does not really know the CCID
commands, it just passes the bytes from the character
device to the I/O ports and back.

Even the datasheet says the device is "USB 2.0" compatible
(which is nonsense), and lists "CCID" as well (which is kind
of true):

https://www.hidglobal.com/sites/hidglobal.com/files/resource_files/omnikey-4040-mobile-pcmcia-ds-en.pdf

OpenCT just attaches its CCID driver (ifd-ccid.c) to
a "pcmcia_block" device:

reader cm4040 {
        driver = ccid;
        device = pcmcia_block:/dev/cmx0;
};

where /dev/cmx0 is a character device offered by the kernel.

FreeBSD kernel driver:

https://www.freebsd.org/cgi/man.cgi?query=cmx&apropos=0&sektion=0&manpath=FreeBSD+10.2-RELEASE&arch=default&format=html
https://svnweb.freebsd.org/base/head/sys/dev/cmx/

Linux kernel driver:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/pcmcia/cm4040_cs.c
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/pcmcia/cm4040_cs.h


Marcin



More information about the Pcsclite-muscle mailing list