There have been more incompatible changes in the PCMCIA API in newer kernel 2.6 versions so that even the modified driver below won't work with any recent kernel. I consider this project abandoned, it never worked really good anyways.
If you're looking for a PCMCIA smart card reader with decent Linux support I'd recommend you look into Omnikey devices. I now have an Omnikey Cardman 4000 working with the kernel driver posted by Harald Welte on the linux kernel mailing list on September 13th 2005.
The information below is provided merely for historic reasons.
Here you will find a Linux device driver for the Gemplus GemPC400 (aka GPR400) PCMCIA smartcard reader for use with kernel version 2.6.
![[front and back view of the GPR400]](gpr400.png)
This is simply jaiger’s driver modified enough to compile with 2.6. I am not really a kernel hacker and didn’t fully understand all of the modifications I made — some of them I ripped off of ide-cs.c — but the result compiles fine and seems to work. In fact it was a lot of fun to simply place the old driver in the new kernel tree and then slowly kill all the compile errors. Sometimes removing one error brought a new one up which needed to be handled and the moment they all were gone was filled with great joy.
Here is a rough list of what I did to version 0.9.7 of the driver:
#includes added, others removed.CardServices(DoFoo, ...) (which I found ugly anyway) into pcmcia_do_foo(...).MODULE_LICENSE, MODULE_DESCRIPTION and MODULE_AUTHOR.struct bus_operations which I couldn’t find in the new kernel. As it didn’t seem to be used anywhere I removed it.cs_error() function is now provided by the kernel PCMCIA services so it doesn’t need to be in the driver anymore.release in dev_link_t anymore. Instead I set up a timer in the driver’s private data structure.struct pcmcia_driver, so I added one.MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT are deprecated. Instead the kernel keeps track of the module use itself, which is made possible by setting the owner member of struct file_operations to THIS_MODULE.which I couldn’t resolve. Although the message seems to be harmless, I’d greatly appreciate any insight.
gpr400_cs: no version for "struct_module" found: kernel tainted.
And now for the actual code:
I have prepared a patch against jaiger’s gpr400_cs.c with all necessary modifications to get it to compile under 2.6. If you don’t care about polluting your kernel tree with it, simply apply the patch to gpr400_cs.c and place it in a location you like. I guess drivers/char/pcmcia would be appropriate, since it’s a PCMCIA driver that provides a character device. Then copy gpr400.h to include/linux, append the contents of Makefile to the Makefile of the directory you chose and insert Kconfig’s contents into the Kconfig of that same directory. Now make menuconfig, select the new driver and make modules_install.
If you don’t already have jaiger’s code or don’t want to fiddle around in your kernel tree, you might as well get my whole package:
bdb39fed7f7fbcf513f6b30c0dadae39 gpr400_cs-0.9.7-kernel-2.6.tar.gz
Unpack it and change into the created directory. Typing make should build gpr400_cs.ko. You need to have a configured kernel tree at /lib/modules/`uname -r`/build for that, otherwise you must set KDIR to the appropriate location.
Become root now and make install, which will copy the module to /lib/modules/`uname -r`/pcmcia and the needed pcmcia-cs helper files to /etc/pcmcia. Change PCMCIADIR if your config files are located somewhere else. Restart cardmgr to let the new configuration take effect.
Now you may insert the card and the module should get automagically loaded. You probably will want to install PC/SC Lite and jaiger’s IFD handler to do anything useful with it.
There is also a different GPR400/GemPC400 driver by Pierrick Hascoet who greatly improved jaiger’s driver to support memory cards. Now that I know what to do it was quite easy to port that one too. So there is a patch against version 0.9.7 of that driver, as well as a complete package:
af42e6fbfad0a559123c034e61344a70 gpr400_cs-0.9.7_ph-kernel-2.6.tar.gz
Important: This driver does not work with jaiger’s IFD handler, so it is probably only useful with custom programs that access /dev/gpr400 directly.
I found the LWN article series Porting device drivers to the 2.6 kernel extremly helpful.