Merge branch 'vendor/OPENSSL'
[dragonfly.git] / share / man / man4 / man4.i386 / digi.4
1 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" the Systems Programming Group of the University of Utah Computer
6 .\" Science Department.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     from: @(#)dca.4 5.2 (Berkeley) 3/27/91
36 .\"     from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
37 .\"     from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp
38 .\" $FreeBSD: src/share/man/man4/man4.i386/dgb.4,v 1.13.2.6 2001/08/17 13:08:45 ru Exp $
39 .\"
40 .Dd August 6, 2009
41 .Dt DIGI 4 i386
42 .Os
43 .Sh NAME
44 .Nm digi
45 .Nd DigiBoard intelligent serial cards driver
46 .Sh SYNOPSIS
47 To compile this driver into the kernel, place the following line in your
48 kernel configuration file:
49 .Bd -ragged -offset indent
50 .Cd "options NDGBPORTS=8"
51 .Cd "device digi0 at isa? port 0x220 iomem 0xfc0000 iosiz ? flags 0x0"
52 .Ed
53 All values are just examples.
54 .Pp
55 To load this driver as a module at boot time, place the following line in
56 .Xr loader.conf 5 :
57 .Bd -literal -offset indent
58 digi_load="YES"
59 .Ed
60 .Pp
61 The
62 .Dv NDGBPORTS
63 option defines the total number of ports on all cards
64 installed in the system.
65 When not defined the number is computed:
66 .Bd -ragged -offset 4n
67 default
68 .Dv NDGBPORTS
69 = number_of_described_DigiBoard_cards * 16
70 .Ed
71 .Pp
72 If it is less than the actual number of ports
73 the system will be able to use only the
74 first
75 .Dv NDGBPORTS
76 ports.
77 If it is greater than all ports will be usable
78 but some memory will be wasted.
79 .Pp
80 Meaning of
81 .Cm flags :
82 .Bl -tag -width indent -compact
83 .It 0x0001
84 use alternate pinout (exchange DCD and DSR lines)
85 .It 0x0002
86 don't use 8K window mode of PC/Xe
87 .El
88 .Pp
89 Device numbering:
90 .Bd -literal -compact
91 0b\fICC\fPmmmmmmmm\fIOLIPPPPP\fP
92   \fBCC\fPard number
93     \fRmmmmmmmm\fPajor number
94             call\fBO\fPut
95              \fBL\fPock
96               \fBI\fPnitial
97                \fBPPPPP\fPort number
98 .Ed
99 .Sh DESCRIPTION
100 The
101 .Nm
102 driver provides support for DigiBoard PC/Xe and PC/Xi series intelligent
103 serial multiport cards with asynchronous interfaces based on the
104 .Tn EIA
105 .Tn RS-232C
106 .Pf ( Tn CCITT
107 .Tn V.24 )
108 standard.
109 .Pp
110 Input and output for each line may set to one of following baud rates;
111 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600,
112 19200, 38400, 57600, or for newer versions of cards 115200.
113 .Pp
114 The driver doesn't use any interrupts, it is
115 .Dq polling\-based .
116 This means that
117 it uses clock interrupts instead of interrupts generated by DigiBoard cards and
118 checks the state of cards 25 times per second.
119 This is practical because the
120 DigiBoard cards have large input and output buffers (more than 1Kbyte per
121 port) and hardware that allows efficiently finding the port that needs
122 attention.
123 The only problem seen with this policy is slower
124 SLIP and PPP response.
125 .Pp
126 Each line in the kernel configuration file describes one card, not one port
127 as in the
128 .Xr sio 4
129 driver.
130 .Pp
131 The
132 .Cm flags
133 keyword may be used on each
134 .Dq Li "device digi"
135 line in the kernel configuration file
136 to change the pinout of the interface or to use new PC/Xe cards
137 which can work with an 8K memory window in compatibility mode
138 (with a 64K memory window).
139 Note
140 that using 8K memory window doesn't mean shorter input/output buffers, it means
141 only that all buffers will be mapped to the same memory address and switched as
142 needed.
143 .Pp
144 The
145 .Cm port
146 value must be the same
147 as the
148 port
149 set on the card by jumpers.
150 For PC/Xi cards the same rule is applicable to the
151 .Cm iomem
152 value.
153 It must be the same as the memory address set on the card
154 by jumpers.
155 .\"Some documentation gives the address as a ``paragraph'' or ``segment'';
156 .\"you can get the value of address by adding the digit "0" at end of
157 .\"paragraph value, e.g., 0xfc000 -> 0xfc0000.
158 For PC/Xe cards there is no need to use jumpers for this purpose.
159 In fact there are no jumpers to do it.
160 Just
161 write the address you want as the
162 .Cm iomem
163 value in kernel config file and the card will be programmed
164 to use this address.
165 .Pp
166 The same range of memory addresses may be used
167 for all the DigiBoards installed
168 (but not for any other card or real memory).
169 DigiBoards
170 with a large amount of memory (256K or 512K and perhaps
171 even 128K) must be mapped
172 to memory addresses outside of the first megabyte.
173 If the computer
174 has more than 15 megabytes of memory then there is no free address space
175 outside of the first megabyte where such DigiBoards can be mapped.
176 In this case you
177 may need to reduce the amount of memory in the computer.
178 But many machines provide a better solution.
179 They have the ability to
180 .Dq "turn off"
181 the memory in the 16th megabyte (addresses 0xF00000 - 0xFFFFFF)
182 using the
183 BIOS setup.
184 Then the DigiBoard's address space can be set to this
185 .Dq hole .
186 .\" XXX the following should be true for all serial drivers and
187 .\" should not be repeated in the man pages for all serial drivers.
188 .\" It was copied from sio.4.  The only changes were s/sio/digi/g.
189 .Pp
190 Serial ports controlled by the
191 .Nm
192 driver can be used for both
193 .Dq callin
194 and
195 .Dq callout .
196 For each port there is a callin device and a callout device.
197 The minor number of the callout device is 128 higher
198 than that of the corresponding callin port.
199 The callin device is general purpose.
200 Processes opening it normally wait for carrier
201 and for the callout device to become inactive.
202 The callout device is used to steal the port from
203 processes waiting for carrier on the callin device.
204 Processes opening it do not wait for carrier
205 and put any processes waiting for carrier on the callin device into
206 a deeper sleep so that they do not conflict with the callout session.
207 The callout device is abused for handling programs that are supposed
208 to work on general ports and need to open the port without waiting
209 but are too stupid to do so.
210 .Pp
211 The
212 .Nm
213 driver also supports an initial-state and a lock-state control
214 device for each of the callin and the callout
215 .Dq data
216 devices.
217 The minor number of the initial-state device is 32 higher
218 than that of the corresponding data device.
219 The minor number of the lock-state device is 64 higher
220 than that of the corresponding data device.
221 The termios settings of a data device are copied
222 from those of the corresponding initial-state device
223 on first opens and are not inherited from previous opens.
224 Use
225 .Xr stty 1
226 in the normal way on the initial-state devices to program
227 initial termios states suitable for your setup.
228 .Pp
229 The lock termios state acts as flags to disable changing
230 the termios state.
231 E.g., to lock a flag variable such as
232 .Dv CRTSCTS ,
233 use
234 .Dq Li "stty crtscts"
235 on the lock-state device.
236 Speeds and special characters
237 may be locked by setting the corresponding value in the lock-state
238 device to any nonzero value.
239 .Pp
240 Correct programs talking to correctly wired external devices
241 .\" XXX change next line in other man pages too, and rewrite this paragraph.
242 work with almost arbitrary initial states and no locking,
243 but other setups may benefit from changing some of the default
244 initial state and locking the state.
245 In particular, the initial states for non (POSIX) standard flags
246 should be set to suit the devices attached and may need to be
247 locked to prevent buggy programs from changing them.
248 E.g.,
249 .Dv CRTSCTS
250 should be locked on for devices that support
251 RTS/CTS handshaking at all times and off for devices that don't
252 support it at all.
253 .Dv CLOCAL
254 should be locked on for devices
255 that don't support carrier.
256 .Dv HUPCL
257 may be locked off if you don't
258 want to hang up for some reason.
259 In general, very bad things happen
260 if something is locked to the wrong state, and things should not
261 be locked for devices that support more than one setting.
262 The
263 .Dv CLOCAL
264 flag on callin ports should be locked off for logins
265 to avoid certain security holes, but this needs to be done by
266 getty if the callin port is used for anything else.
267 .Sh FILES
268 .Bl -tag -width /dev/ttyiD?? -compact
269 .It Pa /dev/ttyD??
270 for callin ports
271 .It Pa /dev/ttyiD??
272 .It Pa /dev/ttylD??
273 corresponding callin initial-state and lock-state devices
274 .Pp
275 .It Pa /dev/cuaD??
276 for callout ports
277 .It Pa /dev/cuaiD??
278 .It Pa /dev/cualD??
279 corresponding callout initial-state and lock-state devices
280 .El
281 .Pp
282 .Bl -tag -width /etc/rc.d/serial -compact
283 .It Pa /etc/rc.d/serial
284 examples of setting the initial-state and lock-state devices
285 .El
286 .Pp
287 The first question mark in these device names is short for the
288 card number
289 (a decimal number between 0 and 65535 inclusive).
290 The second question mark is short for the port number
291 (a letter in the range [0-9a-v]).
292 .Sh DIAGNOSTICS
293 You may enable extended diagnostics by defining DEBUG at the
294 start of the source file
295 .Pa digi.c .
296 .Bl -diag
297 .It digi\fIX\fP: warning: address \fIN\fP truncated to \fIM\fP
298 The memory address for the PC/Xe's 8K window is misaligned (it should be
299 on an 8K boundary) or outside of the first megabyte.
300 .It digi\fIX\fP: 1st reset failed
301 Problems with accessing I/O port of the card, probably
302 the wrong
303 .Cm port
304 value is specified in the kernel config file.
305 .It digi\fIX\fP: 2nd reset failed
306 Problems with hardware.
307 .It digi\fIX\fP: \fIN\fP[st,nd,rd,th] memory test failed
308 Problems with accessing the memory of the card, probably
309 the wrong
310 .Cm iomem
311 value is specified in the kernel config file.
312 .It digi\fIX\fP: BIOS start failed
313 Problems with starting the on-board BIOS.
314 Probably the memory addresses of the
315 DigiBoard overlap with some other device or with RAM.
316 .It digi\fIX\fP: BIOS download failed
317 Problems with the on-board BIOS.
318 Probably the memory addresses of the
319 DigiBoard overlap with some other device or with RAM.
320 .It digi\fIX\fP: FEP code download failed
321 Problems with downloading of the Front-End Processor's micro-OS.
322 Probably the memory addresses of the
323 DigiBoard overlap with some other device or with RAM.
324 .It digi\fIX\fP: FEP/OS start failed
325 Problems with starting of the Front-End Processor's micro-OS.
326 Probably the memory addresses of the
327 DigiBoard overlap with some other device or with RAM.
328 .It digi\fIX\fP: too many ports
329 This DigiBoard reports that it has more than 32 ports.
330 Perhaps a hardware problem or
331 the memory addresses of the
332 DigiBoard overlap with some other device or with RAM.
333 .It digi\fIX\fP: only \fIN\fP ports are usable
334 The
335 .Dv NDGBPORTS
336 parameter is too small and there is only enough space allocated
337 for
338 .Ar N
339 ports on this card.
340 .It digi\fIX\fP: port \fIY\fP is broken
341 The on-board diagnostic has reported that the specified port has hardware
342 problems.
343 .It digi\fIX\fP: polling of disabled board stopped
344 Internal problems in the polling logic of driver.
345 .It digi\fIX\fP: event queue's head or tail is wrong!
346 Internal problems in the driver or hardware.
347 .It digi\fIX\fP: port \fIY\fP: got event on nonexisting port
348 Some status changed on a port that is physically present but is
349 unusable due to misconfiguration.
350 .It digi\fIX\fP: port \fIY\fP: event \fIN\fP mstat \fIM\fP lstat \fIK\fP
351 The driver got a strange event from card.
352 Probably this means that you have a
353 newer card with an extended list of events or some other hardware problem.
354 .It digi\fIX\fP: port \fIY\fP: overrun
355 Input buffer has filled up.
356 Problems in polling logic of driver.
357 .It digi\fIX\fP: port \fIY\fP: FEP command on disabled port
358 Internal problems in driver.
359 .It digi\fIX\fP: port \fIY\fP: timeout on FEP command
360 Problems in hardware.
361 .El
362 .Sh SEE ALSO
363 .Xr stty 1 ,
364 .Xr termios 4 ,
365 .Xr tty 4 ,
366 .Xr comcontrol 8
367 .Sh HISTORY
368 The
369 .Nm
370 driver is derived from the
371 .Xr sio 4
372 driver and the DigiBoard driver from
373 .Tn Linux
374 and is
375 .Ud
376 .Sh BUGS
377 The implementation of sending
378 .Dv BREAK
379 is broken.
380 .Dv BREAK
381 of fixed length of \(14 s
382 is sent anyway.
383 .Pp
384 There was a bug in implementation of
385 .Xr select 2 .
386 It is fixed now but not widely tested yet.
387 .Pp
388 There is no ditty command.
389 Most of its functions (alternate pinout,
390 speed up to 115200 baud, etc.) are implemented in the driver itself.
391 Some
392 other functions are missing.