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