SS(4)                     OpenBSD Programmer's Manual                    SS(4)

NAME
     ss - SCSI Scanner device

SYNOPSIS
     ss* at scsibus? target ? lun ?

DESCRIPTION
     The ss device allows an application to set scanner parameters and re-
     trieve image data from any of the supported scanners without having to be
     concerned with details of its particular command set.

     The list of supported scanners varies from time to time; at present it
     includes HP Scanner Control Language (SCL) SCSI processor type scanners:
     Scanjet IIp, IIc, IIcx, 4p and 5p (others will probably work if the SCSI
     INQUIRY strings are added to the driver).  Not recently tested but worked
     in the past true SCSI scanners: Mustek 600CX and 1200CX (these do not do
     SCSI disconnect-reconnect they will lock up the bus during operation.
     You can use a second controller.)

KERNEL CONFIGURATION
     Obviously a SCSI host adapter must be present in the config file before
     this device can be configured.

     If a count is given, that many ss devices will be configured into the
     kernel.

IOCTLS
     This device provides the SCIOCGET and SCIOCSET ioctls, which respectively
     get and set a series of parameters describing the scan to be performed
     upon subsequent reading of the scanner.  The third argument is the ad-
     dress of a scan_io structure; details of this structure can be found in
     the header file scanio.h.

     The SCIOCRESTART ioctl ignores the third parameter, and restarts the
     scan.  The SCIOC_USE_ADF ioctl also ignores its third parameter, and
     tells the scanner to use its automatic document feeder if it has one.

EXAMPLES
     The normal use of this device in a scanner program would be something
     like this:
     #include <sys/types.h>
     #include <sys/ioctl.h>
     #include <sys/scanio.h>
     struct scan_io sp;
     fd = open the driver (/dev/ss0 for the first scanner)
     ioctl(fd, SCIOCGET, &sp) to get the scanner parameters.
     ... modify any parameters ...
     ioctl(fd, SCIOCSET, &sp) to set the changed parms;
     ioctl(fd, SCIOCGET, &sp) to see if things got rounded or truncated
     read(fd, somebuf, sp.scan_window_size);
     write the data someplace where you want it.

BUGS
     Image data should either be normalized to a particular format or some in-
     dication as to what the format is should be provided.  Currently scanners
     return data in a format similar to the data portion of a Portable Any Map
     (PNM) as produced by the pbmplus and netpbm software packages.

     Even when vendors produce compliant SCSI scanners there is much variation
     in what parameters actually work in a SCSI_SET_WINDOW command.  Back in
     March 1997 an attempt to deal with this via quirk tables was started.
     There exists some code for Ultima AT3 and A6000C Plus, Ricoh IS50, IS410,
     IBM 2456-001, UMAX UC630, and Fujitsu M3096Gm that use this approach but
     none of these scanners work yet.

     Provisional userland programs exist in the source tree in
     src/usr.sbin/ssio.  Eventually a program similar to chio or mt will be
     written.

SEE ALSO
     scsi(4)

     Documentation from the various scanner vendors.

OpenBSD 3.0                   September 28, 1998                             2
