- Kai Germaschewski: ymfpci cleanups and resource leak fixes
[davej-history.git] / Documentation / computone.txt
blobde281aa84464faf1f418cbb123f27e92d3ba040a
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.9
10 Date: 04/12/2000
11 Author: Andrew Manison <amanison@america.net>
12 Testing: larryg@computone.com
13 Support: support@computone.com
14 Fixes and Updates: Doug McNash <dougm@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.14; 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/modules.conf, or for specification on the modprobe
47                 command line.
49         Note that the /etc/modules.conf file is named /etc/conf.modules
50                 with older versions of the module utilities.
52 Software -
54 Module installation:
56 a) Determine free irq/address to use if any (configure BIOS if need be)
57 b) Run "make config" or "make menuconfig" or "make xconfig"
58    Select (m) module for CONFIG_COMPUTONE under character
59    devices.  CONFIG_PCI and CONFIG_MODULES also may need to be set.
60 c) Set address on ISA cards then:
61    edit /usr/src/linux/drivers/char/ip2/ip2.h if needed 
62         or
63    edit /etc/modules.conf if needed (module).
64         or both to match this setting.
65 d) Run "make dep"
66 e) Run "make modules"
67 f) Run "make modules_install"
68 g) Run "/sbin/depmod -a"
69 h) install driver using `modprobe ip2 <options>` (options listed below)
70 i) run ip2mkdev (either the script below or the binary version)
73 Kernel installation:
75 a) Determine free irq/address to use if any (configure BIOS if need be)
76 b) Run "make config" or "make menuconfig" or "make xconfig"
77    Select (y) kernel for CONFIG_COMPUTONE under character
78    devices.  CONFIG_PCI may need to be set if you have PCI bus.
79 c) Set address on ISA cards then:
80            edit /usr/src/linux/drivers/char/ip2/ip2.h  
81 d) Run "make dep"
82 e) Run "make zImage" or whatever target you prefer.
83 f) mv /usr/src/linux/arch/i386/boot/zImage to /boot.
84 g) Add new config for this kernel into /etc/lilo.conf, run "lilo"
85         or copy to a floppy disk and boot from that floppy disk.
86 h) Reboot using this kernel
87 i) run ip2mkdev (either the script below or the binary version)
90 3. INSTALLATION
92 Previously, the driver sources were packaged with a set of patch files
93 to update the character drivers' makefile and configuration file, and other 
94 kernel source files. A build script (ip2build) was included which applies 
95 the patches if needed, and build any utilities needed.
96 What you receive may be a single patch file in conventional kernel
97 patch format build script. That form can also be applied by
98 running patch -p1 < ThePatchFile.  Otherwise run ip2build.
100 The driver can be installed as a module (recommended) or built into the 
101 kernel. This is selected as for other drivers through the `make config`
102 command from the root of the Linux source tree. If the driver is built 
103 into the kernel you will need to edit the file ip2.h to match the boards 
104 you are installing. See that file for instructions. If the driver is 
105 installed as a module the configuration can also be specified on the
106 modprobe command line as follows:
108         modprobe ip2 irq=irq1,irq2,irq3,irq4 io=addr1,addr2,addr3,addr4
110 where irqnum is one of the valid Intelliport II interrupts (3,4,5,7,10,11,
111 12,15) and addr1-4 are the base addresses for up to four controllers. If 
112 the irqs are not specified the driver uses the default in ip2/ip2.h (which 
113 selects polled mode). If no base addresses are specified the defaults in 
114 ip2.h are used. If you are autoloading the driver module with kerneld or
115 kmod the base addresses and interrupt number must also be set in ip2/ip2.h
116 and recompile or just insert and options line in /etc/modules.conf or both. 
117 The options line is equivalent to the command line and takes precidence over 
118 what is in ip2.h. 
120 /etc/modules.conf sample:
121         options ip2 io=1,0x328 irq=1,10
122         alias char-major-71 ip2
123         alias char-major-72 ip2
124         alias char-major-73 ip2
126 equivelant ip2.h:
127 static ip2config_t ip2config =
129         {1,10,0,0},
130         {
131                 0x0001,    // Board 0, ttyF0   - ttyF63         /* PCI card */
132                 0x0328,    // Board 1, ttyF64  - ttyF127        /* ISA card */
133                 0x0000,    // Board 2, ttyF128 - ttyF191        /* empty */
134                 0x0000     // Board 3, ttyF192 - ttyF255        /* empty */
135         }
139 Note:   Both io and irq should be updated to reflect YOUR system.  An "io"
140         address of "1/2" indicates a PCI/EISA card in the board table.  The
141         PCI or EISA irq will be assigned automatically.
143 Specifying an invalid or in-use irq will default the driver into
144 running in polled mode for that card.  If all irq entries are 0 then
145 all cards will operate in polled mode.
147 If you select the driver as part of the kernel run :
149         make depend
150         make zlilo (or whatever you do to create a bootable kernel)
152 If you selected a module run :
154         make modules && make modules_install
156 The utility ip2mkdev (see 5 and 7 below) creates all the device nodes
157 required by the driver.  For a device to be created it must be configured
158 in the driver and the board must be installed. Only devices corresponding
159 to real IntelliPort II ports are created. With multiple boards and expansion
160 boxes this will leave gaps in the sequence of device names. ip2mkdev uses
161 Linux tty naming conventions: ttyF0 - ttyF255 for normal devices, and
162 cuf0 - cuf255 for callout devices.
164 If you are using devfs, existing devices are automatically created within
165 the devfs name space.  Normal devices will be ttf/0 - ttf/255 and callout
166 devices will be cuf/0 - cuf/255.  With devfs installed, ip2mkdev will
167 create symbolic links in /dev from the old conventional names to the newer
168 devfs names as follows:
170         /dev/ip2ipl[n]  -> /dev/ip2/ipl[n]      n = 0 - 3
171         /dev/ip2stat[n] -> /dev/ip2/stat[n]     n = 0 - 3
172         /dev/ttyF[n]    -> /dev/ttf/[n]         n = 0 - 255
173         /dev/cuf[n]     -> /dev/cuf/[n]         n = 0 - 255
175 Only devices for existing ports and boards will be created.
177 You do not need to run ip2mkdev if you are using devfs and only want to
178 use the devfs native device names.
181 4. USING THE DRIVERS
183 As noted above, the driver implements the ports in accordance with Linux
184 conventions, and the devices should be interchangeable with the standard
185 serial devices. (This is a key point for problem reporting: please make
186 sure that what you are trying do works on the ttySx/cuax ports first; then 
187 tell us what went wrong with the ip2 ports!)
189 Higher speeds can be obtained using the setserial utility which remaps 
190 38,400 bps (extb) to 57,600 bps, 115,200 bps, or a custom speed. 
191 Intelliport II installations using the PowerPort expansion module can
192 use the custom speed setting to select the highest speeds: 153,600 bps,
193 230,400 bps, 307,200 bps, 460,800bps and 921,600 bps. The base for
194 custom baud rate configuration is fixed at 921,600 for cards/expansion
195 modules with ST654's and 115200 for those with Cirrus CD1400's.  This
196 corresponds to the maximum bit rates those chips are capable.  
197 For example if the baud base is 921600 and the baud divisor is 18 then
198 the custom rate is 921600/18 = 51200 bps.  See the setserial man page for
199 complete details. Of course if stty accepts the higher rates now you can
200 use that as well as the standard ioctls().
203 5. ip2mkdev and assorted utilities...
205 Several utilities, including the source for a binary ip2mkdev utility are
206 available under .../drivers/char/ip2.  These can be build by changing to
207 that directory and typing "make" after the kernel has be built.  If you do
208 not wish to compile the binary utilities, the shell script below can be
209 cut out and run as "ip2mkdev" to create the necessary device files.  To
210 use the ip2mkdev script, you must have procfs enabled and the proc file
211 system mounted on /proc.
213 You do not need to run ip2mkdev if you are using devfs and only want to
214 use the devfs native device names.
217 6. DEVFS
219 DEVFS is the DEVice File System available as an add on package for the
220 2.2.x kernels and available as a configuration option in 2.3.46 and higher.
221 Devfs allows for the automatic creation and management of device names
222 under control of the device drivers themselves.  The Devfs namespace is
223 hierarchical and reduces the clutter present in the normal flat /dev
224 namespace.  Devfs names and conventional device names may be intermixed.
225 A userspace daemon, devfsd, exists to allow for automatic creation and
226 management of symbolic links from the devfs name space to the conventional
227 names.  More details on devfs can be found on the DEVFS home site at
228 <http://www.atnf.csiro.au/~rgooch/linux/> or in the file kernel
229 documentation files, .../linux/Documentation/filesystems/devfs/REAME.
231 If you are using devfs, existing devices are automatically created within
232 the devfs name space.  Normal devices will be ttf/0 - ttf/255 and callout
233 devices will be cuf/0 - cuf/255.  With devfs installed, ip2mkdev will
234 create symbolic links in /dev from the old conventional names to the newer
235 devfs names as follows:
237         /dev/ip2ipl[n]  -> /dev/ip2/ipl[n]      n = 0 - 3
238         /dev/ip2stat[n] -> /dev/ip2/stat[n]     n = 0 - 3
239         /dev/ttyF[n]    -> /dev/ttf/[n]         n = 0 - 255
240         /dev/cuf[n]     -> /dev/cuf/[n]         n = 0 - 255
242 Only devices for existing ports and boards will be created.
244 You do not need to run ip2mkdev if you are using devfs and only want to
245 use the devfs native device names.
248 7. NOTES
250 This is a release version of the driver, but it is impossible to test it
251 in all configurations of Linux. If there is any anomalous behaviour that 
252 does not match the standard serial port's behaviour please let us know.
255 8. ip2mkdev shell script
257 Previously, this script was simply attached here.  It is now attached as a
258 shar archive to make it easier to extract the script from the documentation.
259 To create the ip2mkdev shell script change to a convenient directory (/tmp
260 works just fine) and run the following command:
262         unshar /usr/src/linux/Documentation/computone.txt
263                 (This file)
265 You should now have a file ip2mkdev in your current working directory with
266 permissions set to execute.  Running that script with then create the
267 necessary devices for the Computone boards, interfaces, and ports which
268 are present on you system at the time it is run.
271 #!/bin/sh
272 # This is a shell archive (produced by GNU sharutils 4.2).
273 # To extract the files from this archive, save it to some FILE, remove
274 # everything before the `!/bin/sh' line above, then type `sh FILE'.
276 # Made on 2000-03-10 11:55 EST by <root@wittsend.wittsend.com>.
277 # Source directory was `/mnt1/src/linux-2.3.50c/Documentation'.
279 # Existing files will *not* be overwritten unless `-c' is specified.
281 # This shar contains:
282 # length mode       name
283 # ------ ---------- ------------------------------------------
284 #   4061 -rwxr-xr-x ip2mkdev
286 save_IFS="${IFS}"
287 IFS="${IFS}:"
288 gettext_dir=FAILED
289 locale_dir=FAILED
290 first_param="$1"
291 for dir in $PATH
293   if test "$gettext_dir" = FAILED && test -f $dir/gettext \
294      && ($dir/gettext --version >/dev/null 2>&1)
295   then
296     set `$dir/gettext --version 2>&1`
297     if test "$3" = GNU
298     then
299       gettext_dir=$dir
300     fi
301   fi
302   if test "$locale_dir" = FAILED && test -f $dir/shar \
303      && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
304   then
305     locale_dir=`$dir/shar --print-text-domain-dir`
306   fi
307 done
308 IFS="$save_IFS"
309 if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
310 then
311   echo=echo
312 else
313   TEXTDOMAINDIR=$locale_dir
314   export TEXTDOMAINDIR
315   TEXTDOMAIN=sharutils
316   export TEXTDOMAIN
317   echo="$gettext_dir/gettext -s"
319 touch -am 1231235999 $$.touch >/dev/null 2>&1
320 if test ! -f 1231235999 && test -f $$.touch; then
321   shar_touch=touch
322 else
323   shar_touch=:
324   echo
325   $echo 'WARNING: not restoring timestamps.  Consider getting and'
326   $echo "installing GNU \`touch', distributed in GNU File Utilities..."
327   echo
329 rm -f 1231235999 $$.touch
331 if mkdir _sh17088; then
332   $echo 'x -' 'creating lock directory'
333 else
334   $echo 'failed to create lock directory'
335   exit 1
337 # ============= ip2mkdev ==============
338 if test -f 'ip2mkdev' && test "$first_param" != -c; then
339   $echo 'x -' SKIPPING 'ip2mkdev' '(file already exists)'
340 else
341   $echo 'x -' extracting 'ip2mkdev' '(text)'
342   sed 's/^X//' << 'SHAR_EOF' > 'ip2mkdev' &&
343 #!/bin/sh -
345 #       ip2mkdev
347 #       Make or remove devices as needed for Computone Intelliport drivers
349 #       First rule!  If the dev file exists and you need it, don't mess
350 #       with it.  That prevents us from screwing up open ttys, ownership
351 #       and permissions on a running system!
353 #       This script will NOT remove devices that no longer exist if their
354 #       board or interface box has been removed.  If you want to get rid
355 #       of them, you can manually do an "rm -f /dev/ttyF* /dev/cuaf*"
356 #       before running this script.  Running this script will then recreate
357 #       all the valid devices.
359 #       =mhw=
360 #       Michael H. Warfield
361 #       mhw@wittsend.com
363 #       Updated 03/09/2000 for devfs support in ip2 drivers. =mhw=
366 if test -d /dev/ip2 ; then
367 #       This is devfs mode...  We don't do anything except create symlinks
368 #       from the real devices to the old names!
369 X       cd /dev
370 X       echo "Creating symbolic links to devfs devices"
371 X       for i in `ls ip2` ; do
372 X               if test ! -L ip2$i ; then
373 X                       # Remove it incase it wasn't a symlink (old device)
374 X                       rm -f ip2$i
375 X                       ln -s ip2/$i ip2$i
376 X               fi
377 X       done
378 X       for i in `ls ttf` ; do
379 X               if test ! -L ttyF$i ; then
380 X                       # Remove it incase it wasn't a symlink (old device)
381 X                       rm -f ttyF$i
382 X                       ln -s ttyf/$i ttyF$i
383 X               fi
384 X       done
385 X       for i in `ls cuf` ; do
386 X               if test ! -L cuf$i ; then
387 X                       # Remove it incase it wasn't a symlink (old device)
388 X                       rm -f cuf$i
389 X                       ln -s cuf/$i cuf$i
390 X               fi
391 X       done
392 X       exit 0
395 if test ! -f /proc/tty/drivers
396 then
397 X       echo "\
398 Unable to check driver status.
399 Make sure proc file system is mounted."
401 X       exit 255
404 if test ! -f /proc/tty/driver/ip2
405 then
406 X       echo "\
407 Unable to locate ip2 proc file.
408 Attempting to load driver"
410 X       if /sbin/insmod ip2
411 X       then
412 X               if test ! -f /proc/tty/driver/ip2
413 X               then
414 X                       echo "\
415 Unable to locate ip2 proc file after loading driver.
416 Driver initialization failure or driver version error.
418 X               exit 255
419 X               fi
420 X       else
421 X               echo "Unable to load ip2 driver."
422 X               exit 255
423 X       fi
426 # Ok...  So we got the driver loaded and we can locate the procfs files.
427 # Next we need our major numbers.
429 TTYMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/tt/!d' -e 's/.*tt[^     ]*[     ]*\([0-9]*\)[   ]*.*/\1/' < /proc/tty/drivers`
430 CUAMAJOR=`sed -e '/^ip2/!d' -e '/\/dev\/cu/!d' -e 's/.*cu[^     ]*[     ]*\([0-9]*\)[   ]*.*/\1/' < /proc/tty/drivers`
431 BRDMAJOR=`sed -e '/^Driver: /!d' -e 's/.*IMajor=\([0-9]*\)[     ]*.*/\1/' < /proc/tty/driver/ip2`
433 echo "\
434 TTYMAJOR = $TTYMAJOR
435 CUAMAJOR = $CUAMAJOR
436 BRDMAJOR = $BRDMAJOR
439 # Ok...  Now we should know our major numbers, if appropriate...
440 # Now we need our boards and start the device loops.
442 grep '^Board [0-9]:' /proc/tty/driver/ip2 | while read token number type alltherest
444 X       # The test for blank "type" will catch the stats lead-in lines
445 X       # if they exist in the file
446 X       if test "$type" = "vacant" -o "$type" = "Vacant" -o "$type" = ""
447 X       then
448 X               continue
449 X       fi
451 X       BOARDNO=`expr "$number" : '\([0-9]\):'`
452 X       PORTS=`expr "$alltherest" : '.*ports=\([0-9]*\)' | tr ',' ' '`
453 X       MINORS=`expr "$alltherest" : '.*minors=\([0-9,]*\)' | tr ',' ' '`
455 X       if test "$BOARDNO" = "" -o "$PORTS" = ""
456 X       then
457 #       This may be a bug.  We should at least get this much information
458 X               echo "Unable to process board line"
459 X               continue
460 X       fi
462 X       if test "$MINORS" = ""
463 X       then
464 #       Silently skip this one.  This board seems to have no boxes
465 X               continue
466 X       fi
468 X       echo "board $BOARDNO: $type ports = $PORTS; port numbers = $MINORS"
470 X       if test "$BRDMAJOR" != ""
471 X       then
472 X               BRDMINOR=`expr $BOARDNO \* 4`
473 X               STSMINOR=`expr $BRDMINOR + 1`
474 X               if test ! -c /dev/ip2ipl$BOARDNO ; then
475 X                       mknod /dev/ip2ipl$BOARDNO c $BRDMAJOR $BRDMINOR
476 X               fi
477 X               if test ! -c /dev/ip2stat$BOARDNO ; then
478 X                       mknod /dev/ip2stat$BOARDNO c $BRDMAJOR $STSMINOR
479 X               fi
480 X       fi
482 X       if test "$TTYMAJOR" != ""
483 X       then
484 X               PORTNO=$BOARDBASE
486 X               for PORTNO in $MINORS
487 X               do
488 X                       if test ! -c /dev/ttyF$PORTNO ; then
489 X                               # We got the harware but no device - make it
490 X                               mknod /dev/ttyF$PORTNO c $TTYMAJOR $PORTNO
491 X                       fi      
492 X               done
493 X       fi
495 X       if test "$CUAMAJOR" != ""
496 X       then
497 X               PORTNO=$BOARDBASE
499 X               for PORTNO in $MINORS
500 X               do
501 X                       if test ! -c /dev/cuf$PORTNO ; then
502 X                               # We got the harware but no device - make it
503 X                               mknod /dev/cuf$PORTNO c $CUAMAJOR $PORTNO
504 X                       fi      
505 X               done
506 X       fi
507 done
509 Xexit 0
510 SHAR_EOF
511   $shar_touch -am 03101153100 'ip2mkdev' &&
512   chmod 0755 'ip2mkdev' ||
513   $echo 'restore of' 'ip2mkdev' 'failed'
514   if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
515   && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
516     md5sum -c << SHAR_EOF >/dev/null 2>&1 \
517     || $echo 'ip2mkdev:' 'MD5 check failed'
518 b0671abeba07b0a9266b70aaf24509b3  ip2mkdev
519 SHAR_EOF
520   else
521     shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'ip2mkdev'`"
522     test 4061 -eq "$shar_count" ||
523     $echo 'ip2mkdev:' 'original size' '4061,' 'current size' "$shar_count!"
524   fi
526 rm -fr _sh17088
527 exit 0