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