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