Subject: Re: Smart card device support!
To: None <netbsd-help@NetBSD.org>
From: Krister Walfridsson <cato@df.lth.se>
List: netbsd-help
Date: 01/28/2007 21:43:32
On Tue, 23 Jan 2007, Marc Tooley wrote:

> Okay; so after running what I think was an exhaustive search for information 
> about drivers on NetBSD for any SmartCard device (those credit-card-sized 
> devices with the microprocessors built-in) I thought I'd try one last-ditch 
> run at the mailing list to find out if anyone here has actually gotten 
> smartcards of any sort working under NetBSD.

You should have no problem finding working readers...

Most USB readers developed for general use are using the CCID device class 
[1], and they are usually accessed through the libusb.  So you do not 
need any kernel mode drivers (more than ugen).

Serial and PCMCIA readers usually have very proprietary protocols, but 
there are some readers that have open source drivers [2].  The PCMCIA 
drivers are mostly Linux-only (as they are running in kernel mode) but the 
serial drivers are running in user space and should be trivial to get to 
work on NetBSD too.


> I know there are a tonne of smartcard devices out there but support for them 
> on Open Source platforms (aside from Linux) appears to be lacking. Aside from 
> the above, is there some technology or software that I'm just not aware of?

Have you looked at the MUSCLE stuff? [3]

The "correct" framework to use to access smart cards is the PC/SC [4]. 
The PC/SC framework is "built-in" into Windows and OS X (and Solaris?) and 
the implementation consist of a PC/SC manager daemon and the drivers are 
loaded dynamically from shared libraries.

The MUSCLE project implemented a PC/SC manager that is available in 
pkgsrc-wip as wip/pcsc-lite, and you'll find a CCID driver there too (as 
wip/ccid).  The CCID driver did not work on NetBSD last time I looked at 
it, but is should be trivial to fix. (I have been planning to fix it and 
import it in pkgsrc for some time.  I can raise its priority on my TODO in 
case you need to use it...)

    /Krister


[1] http://www.usb.org/developers/devclass_docs#approved
[2] http://www.linuxnet.com/sourcedrivers.html
[3] http://www.linuxnet.com/
[4] http://www.pcscworkgroup.com/