Hi Andreas,

Andreas Jellinghaus wrote:
> Thinking about it for a few more minutes, I have a much better
> advice: implement a serial port.

That was also an idea of Alax Cox. But this implies to emulate the whole 
reader in kernel land (the kernel driver must be the 'firmware' of this 
device). Than an application can work with this device like an externally 
connected one. But who wants such complex code in the kernel?

> the reader-smart card interface is not that much different from
> a serial port I guess, so in kernel land you should be able
> to look at many existing drivers for serial ports, and implement
> a simple serial port driver with some special hacks for the
> smart card specific parts.

Currently in my prototype I just use the standard IO functions like read() and 
write() to receive and send data from/to the SmartCard. Setting up 
communication parameter is done via special (=SmartCard related) IOCTLs 
(shown in the attached file in my first mail to this list). Should work in a 
way you suggest.

> and in user land: there are full drivers for serial port
> smart card readers, so you can simply re-use one of them
> and adapt it to the specifics of your serial port / reader.

Problem is, how to setup the SmartCard communication parameter via IOCTL? The 
currently implemented serial drivers changing these kind of parameters by 
sending special commands through the serial line to the reader's firmware (or 
its firmware does it by itself). They are only using IOCTLs to setup the 
serial line parameters between the host and the reader. To re-use it, I would 
need a command interpreter in the kernel driver to distinguish between 
commands to the firmware and to the SmartCard. Hmmm, I don't like this idea.

I have a working openct driver for my device (and the "home brew" API between 
userland and kernel). Should I send it to this list for discussion?

Regards,
Juergen
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to