
SUNIX Multi I/O Driver Support for Linux

Release V1.05, 28 February 2005



OVERVIEW
========

The Linux kernel contains some limited support for SUNIX multi I/O PCI cards.
However, there are many card models that are not correctly supported.
This package contains patches to the Linux kernel sources for both 2.4.x
and 2.6.x series kernels. The patch modifies the serial and parallel driver
provided by the kernel and will add an additional kernel module which handles
card detection.

After applying the patch all SUNIX multi I/O PCI cards should be supported 
correctly. For detailed instructions on how to install the patch, see below.



CARD MODELS
===========

The patch supports the following SUNIX multi I/O PCI card models:

8139
8159
8169
4008A
4018A
4018C
4027A
4037A
4037D
4056A
4056D
4066A
4066R
4079A
4079D
4079R
4089A
4096A



KERNEL VERSIONS
===============

There is a separate patch for 2.4.x and 2.6.x kernel versions.
For installation instructions, see below.

The 2.4.x patch has been tested with the Linux kernel source version 2.4.20
and 2.4.27. However, it should work with other versions as well.

The 2.6.x patch has been tested with the Linux kernel source version 2.6.8.1.
However, it should work with other versions as well.



INSTALLATION
============

In order to apply the patch the Linux kernel sources need to be installed
and the kernel needs to be compiled. Refer to the documentation that came
with your Linux distribution for information on how to do that.

Normally, the kernel sources will be installed under /usr/src/linux.
Often, this directoy is a symbolic link that points to the location
where the sources reside.

When the kernel sources are installed and you are able to successfully
build a kernel then follow the installation instructions given below 
to apply the patch.


Kernel 2.4.x
------------

1. Copy the patch file sunix_multi_io_patch_2.4.x.diff to /usr/src.

2. Change to the directory /usr/src/linux.

3. To apply the patch issue the following command:
     patch -p1 < ../sunix_multi_io_patch_2.4.x.diff
   Warnings produced by patch can be ignored.

4. To configure the kernel run the following command:
     make menuconfig
   Alternatively, you can use the command recommended by your
   Linux distribution, e.g. make xconfig

5. In the kernel configuration menus make sure that the options
   parport, parport_pc and serial are selected.
   These options can be found at the following locations:
     Parallel port support -> 
        parport
     Parallel port support -> 
        PC-style hardware ->
           parport_pc
     Character devices -> 
        Standard/generic (8250/16550 and compatible UARTs) serial support ->
           serial
   If one of these options is selected to compile as a module
   then the Sunix Multi I/O PCI card support has also to be compiled 
   as a module. See the next step for details.

6. Now the following new kernel config option is available:
     Character devices ->
        Standard/generic (8250/16550 and compatible UARTs) serial support ->
           Sunix Multi I/O PCI Card support
   Enable the option "Sunix Multi I/O PCI Card support". If one of the 
   options parport, parport_pc or serial in the previous step was selected
   to compile as a module then this option has also to be compiled 
   as a module.

7. Build and install the kernel. Refer to the documentation of your
   Linux distribution for more information on the required steps.

8. When the new kernel is running, the SUNIX driver will be automatically
   loaded and initialized if compiled as a static driver. If the SUNIX
   driver was compiled as a module then it needs to be loaded with the
   following command:
     modprobe snx_multi_io
   You can decide to add this command to an init script.

Now the SUNIX multi I/O PCI card driver should work and the serial and 
parallel ports of your card are available to the system.



Kernel 2.6.x
------------

1. Copy the patch file sunix_multi_io_patch_2.6.x.diff to /usr/src.

2. Change to the directory /usr/src/linux.

3. To apply the patch issue the following command:
     patch -p1 < ../sunix_multi_io_patch_2.6.x.diff
   Warnings produced by patch can be ignored.

4. To configure the kernel run the following command:
     make menuconfig
   Alternatively, you can use the command recommended by your
   Linux distribution, e.g. make xconfig

5. In the kernel configuration menus make sure that the options
   parport, parport_pc and serial are selected.
   These options can be found at the following locations:
     Device Drivers ->
        Parallel port support ->
           parport
     Device Drivers ->
        Parallel port support ->
           PC-style hardware ->
              parport_pc
     Device Drivers ->
        Character devices ->
           Serial drivers ->
              8250/16550 and compatible serial support ->
                 serial
   If one of these options is selected to compile as a module
   then the Sunix Multi I/O PCI card support has also to be compiled 
   as a module. See the next step for details.

6. Now the following new kernel config option is available:
     Device Drivers ->
        Character devices ->
           Serial drivers ->
              Sunix Multi I/O PCI Card support
   Enable the option "Sunix Multi I/O PCI Card support". If one of the 
   options parport, parport_pc or serial in the previous step was selected
   to compile as a module then this option has also to be compiled 
   as a module.

7. Check the following kernel configuration parameter:
     Device Drivers ->
        Character devices ->
           Serial drivers ->
             8250/16550 and compatible serial support ->
               Maximum number of non-legacy 8250/16550 serial ports
   Make sure that this parameter is set to the number of external serial 
   ports available on PCI cards + 4. For example, if you use an 4066A
   card (8 serial ports) then this paramater needs to be set to 12. 
   If you use two such cards then the parameter needs to be set to 20.

8. Build and install the kernel. Refer to the documentation of your
   Linux distribution for more information on the required steps.

9. When the new kernel is running, the SUNIX driver will be automatically
   loaded and initialized if compiled as a static driver. If the SUNIX
   driver was compiled as a module then it needs to be loaded with the
   following command:
     modprobe snx_multi_io
   You can decide to add this command to an init script.

Now the SUNIX multi I/O PCI card driver should work and the serial and 
parallel ports of your card are available to the system.



Device Files
------------
After you installed your Linux system there will be a default set of 
device files in /dev. For each serial port you plan to use there
needs to be a device file named /dev/ttySN, where N is an integer number
usually starting at zero. Issue the following command to list the 
existing serial device files:
# ls -al /dev/ttyS*
Note that usually the first 4 device files (/dev/ttyS0../dev/ttyS3) will
be assigned to on-board serial ports (COM1..COM4). External serial
ports, which include the SUNIX ports, will be assigned to /dev/ttyS4 and 
higher numbers. If there are not enough /dev/ttySN device files available
by default, you have to create further device files manually. 
For example, if you use an 4066A card (8 serial ports) then you have
to ensure that /dev/ttyS4 to /dev/ttyS11 do exist in your system.

How to create additional device files?
You should first try to use the MAKEDEV script. This script is usually 
located in /dev/MAKEDEV but might also have a copy (or a symbolic link) 
in /sbin/MAKEDEV. The command is used as follows:
# /dev/MAKEDEV -v ttyS8
Repeat this command for any device file you need to create.
Note: On some Linux distributions it may be necessary to use the 
mknod command to create device files. Consult your Linux documentation 
for information on how to do that. Using MAKEDEV is the preferred way.

After you created additional device files you should set the correct
ownership and access mode on these files. Issue an 
# ls -al /dev/ttyS0
command to see the mode set on the first device file.
Use the chown and chmod commands to set the same rights on the newly
created files, for example:
# chown root:root /dev/ttyS8
# chmod 555 /dev/ttyS8 
Repeat these commands for any device file you created.

