ia64/linux-2.6.18-xen.hg

annotate Documentation/computone.txt @ 854:950b9eb27661

usbback: fix urb interval value for interrupt urbs.

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