1995-09-08 03:10:51 +00:00
|
|
|
.\" asc(4) - manual page for the scanner device driver `asc'
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1995 Gunther Schadow, Luigi Rizzo. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgements:
|
|
|
|
.\" This product includes software developed by Gunther Schadow.
|
|
|
|
.\" This product includes software developed by Luigi Rizzo.
|
|
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1996-09-23 22:24:39 +00:00
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1996-01-19 22:17:57 +00:00
|
|
|
.Dd January 19, 1995
|
|
|
|
.Dt ASC 4 i386
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1996-01-19 22:17:57 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm asc
|
|
|
|
.Nd device driver for a GI1904-based hand scanner
|
|
|
|
.Sh SYNOPSIS
|
2000-01-23 18:30:17 +00:00
|
|
|
.Cd "device asc0 at isa? port IO_ASC1 drq 3 irq 10"
|
1996-01-19 22:17:57 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
character device driver currently handles the
|
|
|
|
.Tn GI1904 Ns -based
|
|
|
|
hand scanner (e.g. Trust Amiscan Grey).
|
|
|
|
It uses DMA and interrupts.
|
|
|
|
Up to 50 lines of scanned input data are buffered in the driver.
|
|
|
|
.Pp
|
|
|
|
The device can operate at four different resolutions: 100, 200, 300
|
2000-03-03 14:05:08 +00:00
|
|
|
and 400 dots per inch.
|
|
|
|
It produces a simple bitmap with the most
|
1996-01-19 22:17:57 +00:00
|
|
|
significant bit at the left side. The driver can optionally output
|
|
|
|
the simple portable bitmap file format
|
|
|
|
.Xr pbm 5 ;
|
|
|
|
thus the scans can easily processed by most graphics packages.
|
|
|
|
.Pp
|
|
|
|
The width of the output bitmap is fixed as given by the
|
|
|
|
resolution value. However, the height of the bitmap must be
|
|
|
|
supplied when in
|
|
|
|
.Xr pbm 5
|
|
|
|
mode, since the driver must know at what time the
|
|
|
|
`end-of-file' shall be reached. The default is to produce a
|
|
|
|
square image; i.e., height equals width.
|
|
|
|
With this feature one is able to
|
|
|
|
directly copy the scanner output into a
|
|
|
|
.Xr pbm 5
|
|
|
|
file using
|
|
|
|
.Xr cat 1 .
|
|
|
|
One can obtain a similar effect by using
|
|
|
|
.Xr dd 1
|
|
|
|
with the driver
|
|
|
|
in raw mode.
|
|
|
|
.Sh IOCTLS
|
|
|
|
The
|
|
|
|
.Xr ioctl 2
|
|
|
|
commands applicable to
|
|
|
|
.Nm
|
|
|
|
are listed below.
|
|
|
|
The
|
|
|
|
.Xr sasc 1
|
|
|
|
provides user-level access to these commands.
|
|
|
|
.Bl -tag -width "ASC_GHEIGHT"
|
|
|
|
.It Dv ASC_GRES
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Get current resolution in dots per inch (dpi).
|
1996-01-19 22:17:57 +00:00
|
|
|
.It Dv ASC_GWIDTH
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Get current width of the bitmap in pixels.
|
1996-01-19 22:17:57 +00:00
|
|
|
.It Dv ASC_SHEIGHT
|
|
|
|
.Pq Li int
|
|
|
|
Set the height of the bitmap in
|
|
|
|
.Xr pbm 5
|
|
|
|
mode. This is actually
|
1995-09-08 03:10:51 +00:00
|
|
|
a limit on the amount of lines scannable after the first read
|
1996-01-19 22:17:57 +00:00
|
|
|
operation. When the limit is reached, read will return 0. However, the
|
|
|
|
device is turned off only when the last open file descriptor is closed.
|
|
|
|
.It Dv ASC_GHEIGHT
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Get the current height of the bitmap.
|
1996-01-19 22:17:57 +00:00
|
|
|
.It Dv ASC_SBLEN
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Set the length of the buffer used internally to do the DMA transfer.
|
2000-03-03 14:05:08 +00:00
|
|
|
The buffer length is supplied in lines of the bitmap.
|
|
|
|
Since the buffer
|
1996-01-19 22:17:57 +00:00
|
|
|
size limit is (currently) 0x3000 bytes, the maximum number of lines
|
|
|
|
allowed will vary with the width of each line. An
|
|
|
|
.Er ENOMEM
|
|
|
|
error is returned if the requested length would exceed this limit.
|
|
|
|
.It Dv ASC_GBLEN
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Get the current buffer length in lines.
|
1996-01-19 22:17:57 +00:00
|
|
|
.It Dv ASC_SBTIME
|
|
|
|
.Pq Li int
|
2000-03-03 14:05:08 +00:00
|
|
|
Set the timeout for the completion of reading one buffer.
|
|
|
|
Since a
|
1995-09-08 03:10:51 +00:00
|
|
|
handy scanner is a human/computer interface timeout values are usually
|
1996-01-19 22:17:57 +00:00
|
|
|
higher than those of a flat scanner; the default is 15 seconds. After
|
|
|
|
timeout is reached the read operation will fail with
|
|
|
|
.Er EBUSY .
|
|
|
|
Note that
|
|
|
|
the timeout timer starts anew for each buffer to be read and thus
|
|
|
|
reducing it does not result in faster scans for longer images.
|
|
|
|
.It Dv ASC_GBTIME
|
|
|
|
.Pq Li int
|
1995-09-08 03:10:51 +00:00
|
|
|
Get the current buffer timeout.
|
1996-01-19 22:17:57 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
All
|
|
|
|
.Fn ioctl
|
|
|
|
requests that modify a parameter except
|
|
|
|
.Dv ASC_SBTIME
|
|
|
|
do not have an effect on an ongoing scan process. The user must close
|
|
|
|
the device and open it again for the new selections to take effect.
|
|
|
|
Consequently, the selections are
|
|
|
|
.Em not
|
|
|
|
reset when the device is opened or closed.
|
|
|
|
.Pp
|
1998-06-08 06:12:02 +00:00
|
|
|
Similarly, requests that read a value do not report the value that is
|
1996-01-19 22:17:57 +00:00
|
|
|
used for the ongoing scan process. The values needed during the scan
|
|
|
|
process are saved when it starts and thus are not accessed by
|
|
|
|
.Fn ioctl
|
1995-09-08 03:10:51 +00:00
|
|
|
requests.
|
1996-01-19 22:17:57 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv ASC_SBTIME
|
|
|
|
value does, however, have an immediate effect on the ongoing scan.
|
|
|
|
Thus the timeout can, for example, be set to a large value until the
|
|
|
|
user starts scanning, and then set to a small value to react
|
|
|
|
(nearly) immediately when the user stops.
|
|
|
|
.Pp
|
|
|
|
Note that the
|
|
|
|
.Xr pbm 5
|
|
|
|
versus raw mode selection is done by the
|
|
|
|
minor number, not by
|
|
|
|
.Fn ioctl
|
|
|
|
requests. In raw mode, the selected
|
1995-09-08 03:10:51 +00:00
|
|
|
height of the bitmap will have no effect.
|
1996-01-19 22:17:57 +00:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /dev/asc0pd -compact
|
|
|
|
.It Pa /dev/asc0
|
|
|
|
device node for raw output
|
|
|
|
.It Pa /dev/asc0d
|
|
|
|
device node for raw output, emitting debug messages if the
|
|
|
|
.Dv ASCDEBUG
|
|
|
|
option was given in the kernel configuration file
|
|
|
|
.It Pa /dev/asc0p
|
|
|
|
device node for output in
|
|
|
|
.Xr pbm 5
|
|
|
|
file format
|
|
|
|
.It Pa /dev/asc0pd
|
|
|
|
device node for
|
|
|
|
.Xr pbm 5
|
|
|
|
and debug mode
|
1999-09-22 22:23:17 +00:00
|
|
|
.El
|
1996-01-19 22:17:57 +00:00
|
|
|
.\"
|
|
|
|
.\" .Sh DIAGNOSTICS
|
|
|
|
.\"
|
|
|
|
.Sh SEE ALSO
|
1996-09-23 22:24:39 +00:00
|
|
|
.Xr sasc 1 ,
|
1996-01-19 22:17:57 +00:00
|
|
|
.Xr pbm 5
|
|
|
|
.Sh BUGS
|
1995-09-08 03:10:51 +00:00
|
|
|
Ioctl support is not working yet.
|
1999-08-15 10:48:36 +00:00
|
|
|
.Sh AUTHORS
|
1996-01-19 22:17:57 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver was written by
|
1999-08-15 10:48:36 +00:00
|
|
|
.An Luigi Rizzo .
|
1996-01-19 22:17:57 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver first appeared in
|
1996-08-22 23:51:58 +00:00
|
|
|
.Fx 2.1 .
|