gold: Fix hardcoded library search path
[dragonfly.git] / share / man / man4 / man4.i386 / asc.4
... / ...
CommitLineData
1.\" asc(4) - manual page for the scanner device driver `asc'
2.\"
3.\"
4.\" Copyright (c) 1995 Gunther Schadow, Luigi Rizzo. All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\" must display the following acknowledgements:
16.\" This product includes software developed by Gunther Schadow.
17.\" This product includes software developed by Luigi Rizzo.
18.\" 4. The name of the author may not be used to endorse or promote products
19.\" derived from this software without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31.\"
32.\" $FreeBSD: src/share/man/man4/man4.i386/asc.4,v 1.14.2.2 2001/08/17 13:08:45 ru Exp $
33.\" $DragonFly: src/share/man/man4/man4.i386/asc.4,v 1.5 2008/01/26 15:14:41 swildner Exp $
34.Dd January 19, 1995
35.Dt ASC 4 i386
36.Os
37.Sh NAME
38.Nm asc
39.Nd device driver for a GI1904-based hand scanner
40.Sh SYNOPSIS
41.Cd "device asc0 at isa? port IO_ASC1 drq 3 irq 10"
42.Sh DESCRIPTION
43The
44.Nm
45character device driver currently handles the
46.Tn GI1904 Ns -based
47hand scanner (e.g. Trust Amiscan Grey).
48It uses DMA and interrupts.
49Up to 50 lines of scanned input data are buffered in the driver.
50.Pp
51The device can operate at four different resolutions: 100, 200, 300
52and 400 dots per inch.
53It produces a simple bitmap with the most
54significant bit at the left side. The driver can optionally output
55the simple portable bitmap file format
56.Xr pbm 5 ;
57thus the scans can easily processed by most graphics packages.
58.Pp
59The width of the output bitmap is fixed as given by the
60resolution value. However, the height of the bitmap must be
61supplied when in
62.Xr pbm 5
63mode, since the driver must know at what time the
64`end-of-file' shall be reached. The default is to produce a
65square image; i.e., height equals width.
66With this feature one is able to
67directly copy the scanner output into a
68.Xr pbm 5
69file using
70.Xr cat 1 .
71One can obtain a similar effect by using
72.Xr dd 1
73with the driver
74in raw mode.
75.Sh IOCTLS
76The
77.Xr ioctl 2
78commands applicable to
79.Nm
80are listed below.
81The
82.Xr sasc 1
83provides user-level access to these commands.
84.Bl -tag -width ".Dv ASC_GHEIGHT"
85.It Dv ASC_GRES
86.Pq Li int
87Get current resolution in dots per inch (dpi).
88.It Dv ASC_GWIDTH
89.Pq Li int
90Get current width of the bitmap in pixels.
91.It Dv ASC_SHEIGHT
92.Pq Li int
93Set the height of the bitmap in
94.Xr pbm 5
95mode. This is actually
96a limit on the amount of lines scannable after the first read
97operation. When the limit is reached, read will return 0. However, the
98device is turned off only when the last open file descriptor is closed.
99.It Dv ASC_GHEIGHT
100.Pq Li int
101Get the current height of the bitmap.
102.It Dv ASC_SBLEN
103.Pq Li int
104Set the length of the buffer used internally to do the DMA transfer.
105The buffer length is supplied in lines of the bitmap.
106Since the buffer
107size limit is (currently) 0x3000 bytes, the maximum number of lines
108allowed will vary with the width of each line. An
109.Er ENOMEM
110error is returned if the requested length would exceed this limit.
111.It Dv ASC_GBLEN
112.Pq Li int
113Get the current buffer length in lines.
114.It Dv ASC_SBTIME
115.Pq Li int
116Set the timeout for the completion of reading one buffer.
117Since a
118handy scanner is a human/computer interface timeout values are usually
119higher than those of a flat scanner; the default is 15 seconds. After
120timeout is reached the read operation will fail with
121.Er EBUSY .
122Note that
123the timeout timer starts anew for each buffer to be read and thus
124reducing it does not result in faster scans for longer images.
125.It Dv ASC_GBTIME
126.Pq Li int
127Get the current buffer timeout.
128.El
129.Pp
130All
131.Fn ioctl
132requests that modify a parameter except
133.Dv ASC_SBTIME
134do not have an effect on an ongoing scan process. The user must close
135the device and open it again for the new selections to take effect.
136Consequently, the selections are
137.Em not
138reset when the device is opened or closed.
139.Pp
140Similarly, requests that read a value do not report the value that is
141used for the ongoing scan process. The values needed during the scan
142process are saved when it starts and thus are not accessed by
143.Fn ioctl
144requests.
145.Pp
146The
147.Dv ASC_SBTIME
148value does, however, have an immediate effect on the ongoing scan.
149Thus the timeout can, for example, be set to a large value until the
150user starts scanning, and then set to a small value to react
151(nearly) immediately when the user stops.
152.Pp
153Note that the
154.Xr pbm 5
155versus raw mode selection is done by the
156minor number, not by
157.Fn ioctl
158requests. In raw mode, the selected
159height of the bitmap will have no effect.
160.Sh FILES
161.Bl -tag -width /dev/asc0pd -compact
162.It Pa /dev/asc0
163device node for raw output
164.It Pa /dev/asc0d
165device node for raw output, emitting debug messages if the
166.Dv ASCDEBUG
167option was given in the kernel configuration file
168.It Pa /dev/asc0p
169device node for output in
170.Xr pbm 5
171file format
172.It Pa /dev/asc0pd
173device node for
174.Xr pbm 5
175and debug mode
176.El
177.\"
178.\" .Sh DIAGNOSTICS
179.\"
180.Sh SEE ALSO
181.Xr sasc 1 ,
182.Xr pbm 5 Pq Pa pkgsrc/graphics/netpbm
183.Sh HISTORY
184The
185.Nm
186driver first appeared in
187.Fx 2.1 .
188.Sh AUTHORS
189The
190.Nm
191driver was written by
192.An Luigi Rizzo .
193.Sh BUGS
194Ioctl support is not working yet.