1 /* $NetBSD: scsi_scanner.h,v 1.7.16.1 2004/12/18 09:32:21 skrll Exp $ */
4 * Copyright (c) 1995 Kenneth Stailey. All rights reserved.
5 * modified for configurable scanner support by Joachim Koenig
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Kenneth Stailey.
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.
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.
34 * SCSI scanner interface description
37 /* SCSI scanner commands */
38 #define GET_IMAGE_STATUS 0x0f
41 #define OBJECT_POSITION 0x31
42 #define GET_BUFFER_STATUS 0x34
44 /* generic scanner command formats */
46 struct scsi_rw_scanner
{
51 #define SRW_FIXED 0x01
56 struct scsi_set_window
{
57 #define SET_WINDOW 0x24 /* set params of image area and windows */
58 #define GET_WINDOW 0x25
66 struct scsi_window_header
{
71 struct scsi_window_data
{
72 u_int8_t window_id
; /* must be zero */
84 u_int8_t image_comp
; /* image composition (data type) */
85 u_int8_t bits_per_pixel
;
86 u_int8_t halftone_pattern
[2];
87 u_int8_t rif
:1; /* reverse image format (mono negative) */
90 u_int8_t bit_ordering
[2];
91 u_int8_t compression_type
;
92 u_int8_t compression_arg
;
96 /* mustek scsi commands */
98 #define MUSTEK_SET_WINDOW 0x04 /* set image area and windows */
99 #define MUSTEK_ADF 0x10 /* ADF and backtracking selection */
100 #define MUSTEK_LUT 0x55 /* look up table download */