1 .\" gsc.4 - manual page for the scanner device driver `gsc'
4 .\" Copyright (c) 1995 Gunther Schadow. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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 acknowledgement:
16 .\" This product includes software developed by Gunther Schadow.
17 .\" 4. The name of the author may not be used to endorse or promote products
18 .\" derived from this software without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 .\" $FreeBSD: src/share/man/man4/man4.i386/gsc.4,v 1.12.2.7 2001/12/17 11:30:13 ru Exp $
32 .\" $DragonFly: src/share/man/man4/man4.i386/gsc.4,v 1.6 2008/04/16 08:29:21 swildner Exp $
39 .Nd a device driver for a handy scanner
43 .Cd Minor number bits: Ar uu d g p ...
44 .Bl -tag -width "uu " -compact -offset indent
67 character device driver currently handles only the
68 Genius GS-4500 handy scanner.
69 It operates in pure DMA modes, although
70 the hardware could be set up to work with irq.
72 documentation nor experience in writing interrupt driven device
75 The device can operate at four different
79 It produces a simple bitmap with the most significant
81 The driver can optionally output the famous and
82 likely simple portable bitmap file format
85 Thus the scans can easily processed by any graphic package around
89 only to name some of them ...). In
92 bit which is set means a black pixel because the scanner detects black
93 points on white paper.
94 On the other hand, because pnm format describes
95 intensities of electron beams in video screens a set bit in
97 mode means a white pixel.
101 of the output bitmap is fixed as given by the
105 of the bitmap must be
108 mode since the driver must know at what time the
111 With this feature you are able to
112 directly copy the scanner output into a pbm file with
114 Of course you can obtain a similar effect by using
122 output mode is not yet implemented into the driver.
123 It is even questionable if external programs would not do this job
124 better thereby not counting to the size of the kernel.
126 do not know of tools which produce a graymap from a halftone bitmap.
128 The ioctl requests that are served by
131 There is a utility, called
133 that provides access to these
134 requests from within shell.
136 .It Dv GSC_SRES Vt int
140 If this call is made after the first
141 read access to the device there will be no effect unless the device is
142 closed and opened again.
143 .It Dv GSC_GRES Vt int
144 Get current resolution in dots per inch (dpi).
145 .It Dv GSC_SRESSW Vt void
146 Set resolution value from selector switch.
147 The driver must be in an
148 open though untouched state otherwise the request will fail and
152 .It Dv GSC_SWIDTH Vt int
156 Actually, this is an alternative
157 way of setting the resolution, since any allowed resolution matches
159 Allowed are listed in the table below.
160 .Bl -tag -width resolution -compact -offset indent
179 Values which are not reported in the above table will cause the ioctl
185 As you can see, there are width values > 1696.
186 This does, however, not
187 mean that you can obtain scanned lines longer than the width of your
188 scanner or by higher resolutions.
189 Actually, the resolution is selected
190 by only by the hardware switch.
191 Any line that is longer than what is
192 defined for the actual resolution will be undefined (usually white) on
193 the right part that is exceeding the standard line.
194 .It Dv GSC_GWIDTH Vt int
195 Get current width of the bitmap in pixels.
196 .It Dv GSC_SHEIGHT Vt int
203 a limit on the amount of lines scannable after the first read
205 When the limit is reached read will return 0. However, the
206 device is turned off only when a close is performed (either
207 explicitly or implicitly on exit of the calling process).
208 .It Dv GSC_GHEIGHT Vt int
209 Get the current height of the bitmap.
210 .It Dv GSC_SBLEN Vt int
211 Set the length of the buffer used internally to do the DMA transfer.
212 The buffer length is supplied in lines of the bitmap.
214 size limit is (currently) 0x3000 bytes the maximum number of lines
215 allowed will vary with the width of each line.
217 checked before it overwrites the current value and passes an
222 However, since the bitmap width can change
223 after a buffer length was selected a read request may fail with
225 if the buffer length turns out too high.
226 It is generally wise to
227 choose long buffers rather than go save in order to obtain better
229 .It Dv GSC_GBLEN Vt int
230 Get the current buffer length in lines.
231 .It Dv GSC_SBTIME Vt int
232 Set the timeout for the completion of reading one buffer.
234 handy scanner is a human/computer interface timeout values are usually
235 higher than those of a flat scanner.
236 Default is 15 seconds.
238 timeout is reached the read operation will fail with
241 the timeout timer starts anew for each buffer to be read and thus does
242 not cause you to scan faster for longer images.
243 BLEN/BTIME is similar
246 .It Dv GSC_GBTIME Vt int
247 Get the current buffer timeout.
250 All ioctl requests that modify a parameter except
253 have an effect on an ongoing scan process, i.e. after the first read
254 request that follows open.
255 You must close the device and open it again
256 for the new selections to take effect.
257 Consequently, the selections
258 are not reset when you close or open the device.
260 Similarly, requests that read a value do not report the value that is
261 used for the ongoing scan process.
262 The values needed during the scan
263 process are saved when it starts and thus are not accessed by ioctl
266 The BTIME value does, however, have an immediate effect on the ongoing
268 Thus the timeout can for example be set to long until the user
269 starts scanning. It can then be set to a short amount to react
270 (nearly) immediately when the user stops.
271 Note that the user should be
272 left time to at least fill one buffer without having to haste.
278 mode selection is done by the
279 minor number not by ioctl requests.
283 height of the bitmap will have no effect.
285 .Bl -tag -width /dev/gsc0pd
289 output, has minor number 0.
296 GSCDEBUG option was given at compile time, has minor number 32.
298 device node for output in
300 file format, has minor number 8.
306 mode, has minor number 40.
309 .Bd -literal -offset indent
310 dd if=/dev/gsc0 of=rawfile bs=(width/8) count=(height)
312 cat /dev/gsc0p > pbmfile
317 When you define this name as an `option' in the kernel configuration
318 you can get debug output if you access the driver with a minor number
319 whose debug bit (i.e. bit 5 out of 7) is set.
324 .Xr pbmtopgm 1 Pq Pa pkgsrc/graphics/netpbm ,
332 .Xr pbm 5 Pq Pa pkgsrc/graphics/netpbm ,
333 .Xr pnm 5 Pq Pa pkgsrc/graphics/netpbm
335 .An Gunther Schadow Aq gusw@fub46.zedat.fu-berlin.de
337 Even though the scanner device has a little switch by which you should
338 be able to select one of the four resolution modes, I could not yet
339 determine how to read its status.
340 Unless this is not fixed the driver
341 depends on the value passed by means of
344 what is selected by the hardware.