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