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