Hi list, here is my current OpenCT driver for an 'in system' SmartCard interface, based on a Freescale i.MX25 CPU and Linux 2.6.33. This CPU embedds an Smart/SIMcard controller which is able to control up to two physical interfaces. The hardware can control provided main clock to the attached card, uses large FIFOs for the communication from and to the card, supports various FI/DI settings and provides various power management functions (the i.MX CPU family is intended for battery driven mobile devices).
The kernel driver is not part of this patch stack. Please bear with me, if the SmartCard handling seems broken at any point. I'm not a SmartCard expert. This is my first attempt to make them work. Some notes: - I'm not sure if something like the 'src/ifd/direct.c' is really required. I wrote it to get my userland driver to work and to be able to setup my interface in the same manner like the other reader's drivers. Most functions are dead in this file, because the communication to 'in kernel' drivers is much simpler than talking to a serial or USB device. Suggestions to avoid this file are welcome. - there was the need to touch 'src/ifd/atr.c' to be able to calculate some timeout values. If there is a generic way to extract the CWI/BWI related to a specific protocol, please give me a hint. I think for the other reader devices, this kind of calculation is done in their firmware, right? - the 'src/ifd/ifd-imx.c' file is the driver itself. Maybe some communication cases are not handled. If something comes in your mind, please give me a hint. A few things I don't know how to implement in a correct manner: * what is the default 'block waiting time' for the T0 protocol? * what is the correct behaviour, if the card wants to use a specific FI/DI pair, the hardware cannot handle? Falling back to 1/1, or trying to use a FI/DI pair with slower transfer speed? I'm using the latter one, but I'm unsure if its correct. And what to do, if the FI value is supported, but the DI value is to small? (for example: Card wants FI/DI=13/1, but my interface can only handle 13/2, 13/3, ...) * I was in the hope the driver's 'activate' and 'deactivate' function are called whenever an appliction opens a channel to the attached card and closes it again later on. I need something to adjust power comsumption in conjunction with the usage of the card. If there is nobody who wants to talk to the card, I want to shut it down (using card's 'clock stop mode' for example, or poweroff the card and the interface and the processor internal logic to extend battery life). Currently the 'activate' function is only called, when the OpenCT framework starts (also if no application is attached to the card) and the 'deactivate' function is never called. * Even running "openct-control shutdown" seems not to call the driver's 'close' function. Bug or feature? Comments are welcome. Regards, Juergen -- _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel