Linux Kernel Patches

Linux Kernel Patches

This is my small collection of patches against different kernel version or kernel modules. Not all are working yet, so feedback and comments are wellcome.

Note that these patches just "made it work for me", so they may not completly fix a problem, or even worse, introduce new. Please use them at your own risk.

Application Panel Driver

Fujitsu-Siemens Lifebooks come with a so-called "Application Panel", four keys and one led. You can associate nearly arbitrary actions to the buttons and the LED... using a Windows driver.

To be able to use this Application Panel in Linux, I wrote a small kernel module and some user space utilities. This module and the tools (as well as a module for FreeBSD) are available from http://apanel.sourceforge.net/.

Linux 2.4.x

Download the latest version from SourceForge, and unpack it. To compile the kernel module, give

        $ make -C linux
      

The Makefile assumes your kernel sources are installed under /usr/src/linux and you are using the i2c version that came with your kernel. If your kernel sources are installed somewhere else, define the symbol LINUX:

        $ make -C linux LINUX=/usr/src/linux-2.4.25
      

If you are using a different version of i2c, you also need to define the location of the correct i2c headers, commonly installed in /usr/include:

        $ make -C linux I2C=/usr/include
      

Linux 2.6.x

If you are running Linux 2.6 or later, you have to compile the module like this

        $ cd linux
        $ mv -f Makefile-2.6 Makefile
        $ make KERNEL_SOURCE=/usr/src/linux-2.6.7
      

Common steps

After compiling the kernel module, you can compile the utilities that come with it:

        $ make -C utils
      

You should install the binary fjkeyd into /usr/sbin and the binary apanelc into /usr/bin. The sources include a sample rc script for distributions like RedHat, SuSE, Debian, or Mandrake.

Create those aliases in /etc/modules.conf (your distribution may be using some scripts to create this file from files /etc/modules.d/, check your distributions documentation):

        alias /dev/misc/apanel          apanel
        alias /dev/fujitsu/apanel       apanel
      

If you are not using devfs or udev, you have to create a device node:

        # mkdir /dev/fujitsu
        # mknod /dev/fujitsu/apanel c 10 216
      

If you are using devfs, create a file /etc/devfs.d/apanel with the following contents:

        # /dev/fujitsu/apanel symbolic links to /dev/misc/apanel
        REGISTER        ^misc/apanel$   CFUNCTION GLOBAL mksymlink ${mntpnt}/$devname fujitsu/apanel
        UNREGISTER      ^misc/apanel$   CFUNCTION GLOBAL unlink fujitsu/apanel
      

If you are using udev, create a file /etc/udev/rules.d/99-apanel.rules with the following contents:

        KERNEL="apanel", NAME="misc/%k", SYMLINK="fujitsu/%k"
      

Gentoo users are lucky... I'm using gentoo on my laptop at the moment, and so I made an ebuild for compiling and installing the application panel driver. The ebuild also installs some scripts for the fjkeyd which execute mozilla when the "Internet" or "E-mail" button is pressed.

You can define other actions to be executed, by creating shell scripts in /etc/apanel named like the buttons (A, B, internet, email, ...) See the utils/fjkeydscripts sub-directories for various examples.

NSC FastIR driver for "hidden" chips

My laptop here has a NSC PC97338 SuperIO chipset which should be supported by the nsc-ircc IRDA driver. However, the chip build into my laptop somehow doesn't respond on its configuration ports (at least not those given in the specification for this chipset).

Since the chip doesn't respond on its configuration ports, the nsc-ircc driver cannot detect it. To be able to use it anyway, I have added an option noprobe to the driver which tells it to just attach to the given IO port, IRQ, and DMA channel.

If you have multiple chips you need to specify the IO ports, etc.. for you can give the noprobe for each individual group of paramters. Assuming you have only one chip, you can now load the module using

        # insmod nsc-ircc io=0x2e8 irq=3 dma=3 noprobe=1
      

Of course you have to configure the parameters for the SuperIO chip in your BIOS now.

ppSCSI suite of drivers for 2.6 series

I'm not using ppSCSI myself, however many people are asking about a port of the ppSCSI suite for 2.6 kernel series in order to use their scanners.

So far this patch just compiles without warnings, but I could not test it myself. If somebody is willing to try this patch out, it be grateful to receive feedback on it.

For more information about the ppSCSI suite, see the official homepage at http://cyberelk.net/tim/parport/ppscsi.html or the README.ppscsi that comes with the patch.

New: the ppSCSI driver suite is now also available as stand-alone package that does not require patching your kernel.

Texas Instruments UltraMedia Firmware Loader

The tiumfwl module loads the firmware into the TI UltraMedia PCI chipset required to access the ultra-media slots. Please note however, that the firmware file included with the Windows driver is encrypted. In order to use the firmware loader, you will need to supply the correct key. Please understand that I cannot provide this key without a proper permission from Texas Instruments.

To compile the driver, you need your kernel sources, the Makefile and the tiumfwl.c sources. When loading the module, the driver expects the firmware in your firmware directory, normally /lib/firmware. The files should named <chipset>.bin, i.e. pci7510.bin.

If you have an encrypted firmware file (that's commonly the case), you need to supply the key as module parameter (replace ?? with the key for your firmware):

        # insmod tiumfwl key=0x??
      

To use your ultra-media slot you still need an appropriate driver - in the case of the smartcard reader, such a driver does not exist yet.