Initial import from FreeBSD RELENG_4:
[games.git] / share / man / man4 / man4.i386 / asc.4
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 .Dd January 19, 1995
34 .Dt ASC 4 i386
35 .Os
36 .Sh NAME
37 .Nm asc
38 .Nd device driver for a GI1904-based hand scanner
39 .Sh SYNOPSIS
40 .Cd "device asc0 at isa? port IO_ASC1 drq 3 irq 10"
41 .Sh DESCRIPTION
42 The
43 .Nm
44 character device driver currently handles the
45 .Tn GI1904 Ns -based
46 hand scanner (e.g. Trust Amiscan Grey).
47 It uses DMA and interrupts.
48 Up to 50 lines of scanned input data are buffered in the driver.
49 .Pp
50 The device can operate at four different resolutions: 100, 200, 300
51 and 400 dots per inch.
52 It produces a simple bitmap with the most
53 significant bit at the left side.  The driver can optionally output
54 the simple portable bitmap file format
55 .Xr pbm 5 ;
56 thus the scans can easily processed by most graphics packages.
57 .Pp
58 The width of the output bitmap is fixed as given by the
59 resolution value.  However, the height of the bitmap must be
60 supplied when in
61 .Xr pbm 5
62 mode, since the driver must know at what time the
63 `end-of-file' shall be reached.  The default is to produce a
64 square image; i.e., height equals width.
65 With this feature one is able to
66 directly copy the scanner output into a
67 .Xr pbm 5
68 file using
69 .Xr cat 1 .
70 One can obtain a similar effect by using
71 .Xr dd 1
72 with the driver
73 in raw mode.
74 .Sh IOCTLS
75 The
76 .Xr ioctl 2
77 commands applicable to
78 .Nm
79 are listed below.
80 The
81 .Xr sasc 1
82 provides user-level access to these commands.
83 .Bl -tag -width "ASC_GHEIGHT"
84 .It Dv ASC_GRES
85 .Pq Li int
86 Get current resolution in dots per inch (dpi).
87 .It Dv ASC_GWIDTH
88 .Pq Li int
89 Get current width of the bitmap in pixels.
90 .It Dv ASC_SHEIGHT
91 .Pq Li int
92 Set the height of the bitmap in
93 .Xr pbm 5
94 mode.  This is actually
95 a limit on the amount of lines scannable after the first read
96 operation.  When the limit is reached, read will return 0. However, the
97 device is turned off only when the last open file descriptor is closed.
98 .It Dv ASC_GHEIGHT
99 .Pq Li int
100 Get the current height of the bitmap.
101 .It Dv ASC_SBLEN
102 .Pq Li int
103 Set the length of the buffer used internally to do the DMA transfer.
104 The buffer length is supplied in lines of the bitmap.
105 Since the buffer
106 size limit is (currently) 0x3000 bytes, the maximum number of lines
107 allowed will vary with the width of each line.  An
108 .Er ENOMEM
109 error is returned if the requested length would exceed this limit.
110 .It Dv ASC_GBLEN
111 .Pq Li int
112 Get the current buffer length in lines.
113 .It Dv ASC_SBTIME
114 .Pq Li int
115 Set the timeout for the completion of reading one buffer.
116 Since a
117 handy scanner is a human/computer interface timeout values are usually
118 higher than those of a flat scanner; the default is 15 seconds.  After
119 timeout is reached the read operation will fail with
120 .Er EBUSY .
121 Note that
122 the timeout timer starts anew for each buffer to be read and thus
123 reducing it does not result in faster scans for longer images.
124 .It Dv ASC_GBTIME
125 .Pq Li int
126 Get the current buffer timeout.
127 .El
128 .Pp
129 All
130 .Fn ioctl
131 requests that modify a parameter except
132 .Dv ASC_SBTIME
133 do not have an effect on an ongoing scan process.  The user must close
134 the device and open it again for the new selections to take effect.
135 Consequently, the selections are
136 .Em not
137 reset when the device is opened or closed.
138 .Pp
139 Similarly, requests that read a value do not report the value that is
140 used for the ongoing scan process.  The values needed during the scan
141 process are saved when it starts and thus are not accessed by
142 .Fn ioctl
143 requests.
144 .Pp
145 The
146 .Dv ASC_SBTIME
147 value does, however, have an immediate effect on the ongoing scan.
148 Thus the timeout can, for example, be set to a large value until the
149 user starts scanning, and then set to a small value to react
150 (nearly) immediately when the user stops.
151 .Pp
152 Note that the
153 .Xr pbm 5
154 versus raw mode selection is done by the
155 minor number, not by
156 .Fn ioctl
157 requests.  In raw mode, the selected
158 height of the bitmap will have no effect.
159 .Sh FILES
160 .Bl -tag -width /dev/asc0pd -compact
161 .It Pa /dev/asc0
162 device node for raw output
163 .It Pa /dev/asc0d
164 device node for raw output, emitting debug messages if the
165 .Dv ASCDEBUG
166 option was given in the kernel configuration file
167 .It Pa /dev/asc0p
168 device node for output in
169 .Xr pbm 5
170 file format
171 .It Pa /dev/asc0pd
172 device node for
173 .Xr pbm 5
174 and debug mode
175 .El
176 .\"
177 .\" .Sh DIAGNOSTICS
178 .\"
179 .Sh SEE ALSO
180 .Xr sasc 1 ,
181 .Xr pbm 5
182 .Sh BUGS
183 Ioctl support is not working yet.
184 .Sh AUTHORS
185 The
186 .Nm
187 driver was written by
188 .An Luigi Rizzo .
189 .Sh HISTORY
190 The
191 .Nm
192 driver first appeared in
193 .Fx 2.1 .