Import 2.3.30pre3
[davej-history.git] / Documentation / computone.txt
blob9d39a878aaf4a9f02d5c2f6b2247257301cf78d8
2 Computone Intelliport II/Plus Multiport Serial Driver
3 -----------------------------------------------------
5 Release Notes For Linux Kernel 2.2 and higher.
6 These notes are for the drivers which have already been integrated into the
7 kernel and have been tested on Linux kernels 2.0, 2.2, and 2.3.
9 Version: 1.2.4
10 Date: 08/04/99
11 Author: Andrew Manison <amanison@america.net>
12 Testing: larryg@computone.com
13 Support: support@computone.com
14 Fixes and Updates: Doug McNash <dmcnash@computone.com>
15 Proc Filesystem and Kernel Integration: Mike Warfield <mhw@wittsend.com>
18 This file assumes that you are using the Computone drivers which are
19 integrated into the kernel sources.  For updating the drivers or installing
20 drivers into kernels which do not already have Computone drivers, please
21 refer to the instructions in the README.computone file in the driver patch.
24 1. INTRODUCTION
26 This driver supports the entire family of Intelliport II/Plus controllers
27 with the exception of the MicroChannel controllers.  It does not support
28 products previous to the Intelliport II.
30 This driver was developed on the v2.0.x Linux tree and has been tested up
31 to v2.2.9; it will probably not work with earlier v1.X kernels,.
34 2. QUICK INSTALLATION
36 Hardware - If you have an ISA card, find a free interrupt and io port. 
37                    List those in use with `cat /proc/interrupts` and 
38                    `cat /proc/ioports`.  Set the card dip switches to a free 
39                    address.  You may need to configure your BIOS to reserve an
40                    irq for an ISA card.  PCI and EISA parameters are set
41                    automagically.  Insert card into computer with the power off 
42                    before or after drivers installation.
44         Note the hardware address from the Computone ISA cards installed into
45                 the system.  These are required for editing ip2.h or editing
46                 /etc/config.modules, or for specification on the modprobe
47                 command line.
49 Software -
51 Module installation:
53 a) Obtain driver-kernel patch file
54 b) Copy to the linux source tree root, Run ip2build (if not patch)
55 c) Determine free irq/address to use if any (configure BIOS if need be)
56 d) Run "make config" or "make menuconfig" or "make xconfig"
57    Select (m) module for CONFIG_COMPUTONE under character
58    devices.  CONFIG_PCI and CONFIG_MODULES also may need to be set.
59 e) Set address on ISA cards then:
60    edit /usr/src/linux/drivers/char/ip2/ip2.h if needed 
61         or
62    edit /etc/modules.conf if needed (module).
63         or both to match this setting.
64 f) Run "make dep"
65 g) Run "make modules"
66 h) Run "make modules_install"
67 i) Run "/sbin/depmod -a"
68 j) install driver using `modprobe ip2 <options>` (options listed below)
69 k) run ip2mkdev (either the script below or the binary version)
72 Kernel installation:
74 a) Obtain driver-kernel patch file
75 b) Copy to the linux source tree root, Run ip2build (if not patch)
76 c) Determine free irq/address to use if any (configure BIOS if need be)
77 d) Run "make config" or "make menuconfig" or "make xconfig"
78    Select (y) kernel for CONFIG_COMPUTONE under character
79    devices.  CONFIG_PCI may need to be set if you have PCI bus.
80 e) Set address on ISA cards then:
81            edit /usr/src/linux/drivers/char/ip2/ip2.h  
82 f) Run "make dep"
83 g) Run "make zImage" or whatever target you prefer.
84 h) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
85 i) Add new config for this kernel into /etc/lilo.conf, run "lilo"
86         or copy to a floppy disk and boot from that floppy disk.
87 j) Reboot using this kernel
88 k) run ip2mkdev (either the script below or the binary version)
91 3. INSTALLATION
93 Previously, the driver sources were packaged with a set of patch files
94 to update the character drivers' makefile and configuration file, and other 
95 kernel source files. A build script (ip2build) was included which applies 
96 the patches if needed, and build any utilities needed.
97 What you recieve may be a single patch file in conventional kernel
98 patch format build script. That form can also be applied by
99 running patch -p1 < ThePatchFile.  Otherwise run ip2build.
101 The driver can be installed as a module (recommended) or built into the 
102 kernel. This is selected as for other drivers through the `make config`
103 command from the root of the Linux source tree. If the driver is built 
104 into the kernel you will need to edit the file ip2.h to match the boards 
105 you are installing. See that file for instructions. If the driver is 
106 installed as a module the configuration can also be specified on the
107 modprobe command line as follows:
109         modprobe ip2 irq=irq1,irq2,irq3,irq4 io=addr1,addr2,addr3,addr4
111 where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
112 12,15) and addr1-4 are the base addresses for up to four controllers. If 
113 the irqs are not specified the driver uses the default in ip2/ip2.h (which 
114 selects polled mode). If no base addresses are specified the defaults in 
115 ip2.h are used. If you are autoloading the driver module with kerneld or
116 kmod the base addresses and interrupt number must also be set in ip2/ip2.h
117 and recompile or just insert and options line in /etc/modules.conf or both. 
118 The options line is equivalent to the command line and takes precidence over 
119 what is in ip2.h. 
121 /etc/modules.conf sample:
122         options ip2 io=1,0x328 irq=1,10
123         alias char-major-71 ip2
124         alias char-major-72 ip2
125         alias char-major-73 ip2
127 equivelant ip2.h:
128 static ip2config_t ip2config =
130         {1,10,0,0},
131         {
132                 0x0001,    // Board 0, ttyF0   - ttyF63         /* PCI card */
133                 0x0328,    // Board 1, ttyF64  - ttyF127        /* ISA card */
134                 0x0000,    // Board 2, ttyF128 - ttyF191        /* empty */
135                 0x0000     // Board 3, ttyF192 - ttyF255        /* empty */
136         }
140 Note:   Both io and irq should be updated to reflect YOUR system.  An "io"
141         address of "1/2" indicates a PCI/EISA card in the board table.  The
142         PCI or EISA irq will be assigned automatically.
144 Specifying an invalid or in-use irq will default the driver into
145 running in polled mode for that card.  If all irq entries are 0 then
146 all cards will operate in polled mode.
148 If you select the driver as part of the kernel run :
150         make depend
151         make zlilo (or whatever you do to create a bootable kernel)
153 If you selected a module run :
155         make modules && make modules_install
157 The utility ip2mkdev (see 5 and 7 below) creates all the device nodes
158 required by the driver.  For a device to be created it must be configured
159 in the driver and the board must be installed. Only devices corresponding
160 to real IntelliPort II ports are created. With multiple boards and expansion
161 boxes this will leave gaps in the sequence of device names. ip2mkdev uses
162 Linux tty naming conventions: ttyF0 - ttyF255 for normal devices, and
163 cuf0 - cuf255 for callout devices.
166 4. USING THE DRIVERS
168 As noted above, the driver implements the ports in accordance with Linux
169 conventions, and the devices should be interchangeable with the standard
170 serial devices. (This is a key point for problem reporting: please make
171 sure that what you are trying do works on the ttySx/cuax ports first; then 
172 tell us what went wrong with the ip2 ports!)
174 Higher speeds can be obtained using the setserial utility which remaps 
175 38,400 bps (extb) to 57,600 bps, 115,200 bps, or a custom speed. 
176 Intelliport II installations using the PowerPort expansion module can
177 use the custom speed setting to select the highest speeds: 153,600 bps,
178 230,400 bps, 307,200 bps, 460,800bps and 921,600 bps. The base for
179 custom baud rate configuration is fixed at 921,600 for cards/expantion
180 modules with ST654's and 115200 for those with Cirrus CD1400's.  This
181 corresponds to the maximum bit rates those chips are capable.  
182 For example if the baud base is 921600 and the baud divisor is 18 then
183 the custom rate is 921600/18 = 51200 bps.  See the setserial man page for
184 complete details. Of course if stty accepts the higher rates now you can
185 use that as well as the standard ioctls().
188 5. ip2mkdev and assorted utilities...
190 Several utilities, including the source for a binary ip2mkdev utility are
191 available under .../drivers/char/ip2.  These can be build by changing to
192 that directory and typing "make" after the kernel has be built.  If you do
193 not wish to compile the binary utilities, the shell script below can be
194 cut out and run as "ip2mkdev" to create the necessary device files.  To
195 use the ip2mkdev script, you must have procfs enabled and the proc file
196 system mounted on /proc.
198 6. NOTES
200 This is a release version of the driver, but it is impossible to test it
201 in all configurations of Linux. If there is any anomalous behaviour that 
202 does not match the standard serial port's behaviour please let us know.
205 7. ip2mkdev shell script
207 ===== Cut Here ===== 
208 #!/bin/sh -
210 #       ip2mkdev
212 #       Make or remove devices as needed for Computone Intelliport drivers
214 #       First rule!  If the dev file exists and you need it, don't mess
215 #       with it.  That prevents us from screwing up open ttys, ownership
216 #       and permissions on a running system!
218 #       This script will NOT remove devices that no longer exist because
219 #       their board or interface box has been removed.  If you want to get
220 #       rid of them, you can manually do an "rm -f /dev/ttyF* /dev/cuaf*"
221 #       before running this script, which will then recreate all the valid
222 #       devices
224 #       =mhw=
225 #       Michael H. Warfield
226 #       mhw@wittsend.com
228 if test ! -f /proc/tty/drivers
229 then
230         echo "\
231 Unable to check driver status.
232 Make sure proc file system is mounted."
234         exit 255
237 if test ! -f /proc/tty/driver/ip2
238 then
239         echo "\
240 Unable to locate ip2 proc file.
241 Attempting to load driver"
243         if insmod ip2
244         then
245                 if test ! -f /proc/tty/driver/ip2
246                 then
247                         echo "\
248 Unable to locate ip2 proc file after loading driver.
249 Driver initialization failure or driver version error.
251                 exit 255
252                 fi
253         else
254                 echo "Unable to load ip2 driver."
255                 exit 255
256         fi
259 # Ok...  So we got the driver loaded and we can locate the procfs files.
260 # Next we need our major numbers.
262 TTYMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/tty/!d' -e 's/.*tty.[   ]*\([0-9]*\)[   ]*.*/\1/' < /proc/tty/drivers`
263 CUAMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/cu/!d' -e 's/.*cu.[     ]*\([0-9]*\)[   ]*.*/\1/' < /proc/tty/drivers`
264 BRDMAJOR=`sed -e '/^Driver: /!d' -e 's/.*IMajor=\([0-9]*\)[     ]*.*/\1/' < /proc/tty/driver/ip2`
266 echo "\
267 TTYMAJOR = $TTYMAJOR
268 CUAMAJOR = $CUAMAJOR
269 BRDMAJOR = $BRDMAJOR
272 # Ok...  Now we should know our major numbers, if appropriate...
273 # Now we need our boards and start the device loops.
275 grep '^Board [0-9]:' /proc/tty/driver/ip2 | while read token number type alltherest
277         # The test for blank "type" will catch the stats lead-in lines
278         # if they exist in the file
279         if test "$type" = "vacant" -o "$type" = "Vacant" -o "$type" = ""
280         then
281                 continue
282         fi
284         BOARDNO=`expr "$number" : '\([0-9]\):'`
285         PORTS=`expr "$alltherest" : '.*ports=\([0-9]*\)' | tr ',' ' '`
286         MINORS=`expr "$alltherest" : '.*minors=\([0-9,]*\)' | tr ',' ' '`
288         if test "$BOARDNO" = "" -o "$PORTS" = ""
289         then
290 #       This may be a bug.  We should at least get this much information
291                 echo "Unable to process board line"
292                 continue
293         fi
295         if test "$MINORS" = ""
296         then
297 #       Silently skip this one.  This board seems to have no boxes
298                 continue
299         fi
301         echo "board $BOARDNO: $type ports = $PORTS; port numbers = $MINORS"
303         if test "$BRDMAJOR" != ""
304         then
305                 BRDMINOR=`expr $BOARDNO \* 4`
306                 STSMINOR=`expr $BRDMINOR + 1`
307                 if test ! -c /dev/ip2ipl$BOARDNO ; then
308                         mknod /dev/ip2ipl$BOARDNO c $BRDMAJOR $BRDMINOR
309                 fi
310                 if test ! -c /dev/ip2stat$BOARDNO ; then
311                         mknod /dev/ip2stat$BOARDNO c $BRDMAJOR $STSMINOR
312                 fi
313         fi
315         if test "$TTYMAJOR" != ""
316         then
317                 PORTNO=$BOARDBASE
319                 for PORTNO in $MINORS
320                 do
321                         if test ! -c /dev/ttyF$PORTNO ; then
322                                 # We got the harware but no device - make it
323                                 mknod /dev/ttyF$PORTNO c $TTYMAJOR $PORTNO
324                         fi      
325                 done
326         fi
328         if test "$CUAMAJOR" != ""
329         then
330                 PORTNO=$BOARDBASE
332                 for PORTNO in $MINORS
333                 do
334                         if test ! -c /dev/cuf$PORTNO ; then
335                                 # We got the harware but no device - make it
336                                 mknod /dev/cuf$PORTNO c $CUAMAJOR $PORTNO
337                         fi      
338                 done
339         fi
340 done
342 exit 0
343 ===== Cut Here =====