scsi_scanner.h revision 1.3.2.2 1 1.3.2.2 thorpej /*
2 1.3.2.2 thorpej * Copyright (c) 1995 Kenneth Stailey. All rights reserved.
3 1.3.2.2 thorpej * modified for configurable scanner support by Joachim Koenig
4 1.3.2.2 thorpej *
5 1.3.2.2 thorpej * Redistribution and use in source and binary forms, with or without
6 1.3.2.2 thorpej * modification, are permitted provided that the following conditions
7 1.3.2.2 thorpej * are met:
8 1.3.2.2 thorpej * 1. Redistributions of source code must retain the above copyright
9 1.3.2.2 thorpej * notice, this list of conditions and the following disclaimer.
10 1.3.2.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
11 1.3.2.2 thorpej * notice, this list of conditions and the following disclaimer in the
12 1.3.2.2 thorpej * documentation and/or other materials provided with the distribution.
13 1.3.2.2 thorpej * 3. All advertising materials mentioning features or use of this software
14 1.3.2.2 thorpej * must display the following acknowledgement:
15 1.3.2.2 thorpej * This product includes software developed by Kenneth Stailey.
16 1.3.2.2 thorpej * 4. The name of the author may not be used to endorse or promote products
17 1.3.2.2 thorpej * derived from this software without specific prior written permission.
18 1.3.2.2 thorpej *
19 1.3.2.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 1.3.2.2 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 1.3.2.2 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 1.3.2.2 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.3.2.2 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 1.3.2.2 thorpej * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 1.3.2.2 thorpej * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 1.3.2.2 thorpej * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 1.3.2.2 thorpej * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 1.3.2.2 thorpej * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 1.3.2.2 thorpej */
30 1.3.2.2 thorpej
31 1.3.2.2 thorpej /*
32 1.3.2.2 thorpej * SCSI scanner interface description
33 1.3.2.2 thorpej */
34 1.3.2.2 thorpej
35 1.3.2.2 thorpej #ifndef _SCSI_SCANNER_H_
36 1.3.2.2 thorpej #define _SCSI_SCANNER_H_
37 1.3.2.2 thorpej
38 1.3.2.2 thorpej /* SCSI scanner commands */
39 1.3.2.2 thorpej #define GET_IMAGE_STATUS 0x0f
40 1.3.2.2 thorpej #define READ_BIG 0x28
41 1.3.2.2 thorpej #define WRITE_BIG 0x2a
42 1.3.2.2 thorpej #define OBJECT_POSITION 0x31
43 1.3.2.2 thorpej #define GET_BUFFER_STATUS 0x34
44 1.3.2.2 thorpej
45 1.3.2.2 thorpej /* generic scanner command formats */
46 1.3.2.2 thorpej
47 1.3.2.2 thorpej struct scsi_rw_scanner {
48 1.3.2.2 thorpej #define READ 0x08
49 1.3.2.2 thorpej #define WRITE 0x0a
50 1.3.2.2 thorpej u_int8_t opcode;
51 1.3.2.2 thorpej u_int8_t byte2;
52 1.3.2.2 thorpej #define SRW_FIXED 0x01
53 1.3.2.2 thorpej u_int8_t len[3];
54 1.3.2.2 thorpej u_int8_t control;
55 1.3.2.2 thorpej };
56 1.3.2.2 thorpej
57 1.3.2.2 thorpej struct scsipi_start_stop {
58 1.3.2.2 thorpej u_int8_t opcode;
59 1.3.2.2 thorpej u_int8_t byte2;
60 1.3.2.2 thorpej u_int8_t unused[2];
61 1.3.2.2 thorpej u_int8_t how;
62 1.3.2.2 thorpej #define SSS_STOP 0x00
63 1.3.2.2 thorpej #define SSS_START 0x01
64 1.3.2.2 thorpej #define SSS_LOEJ 0x02
65 1.3.2.2 thorpej u_int8_t control;
66 1.3.2.2 thorpej };
67 1.3.2.2 thorpej
68 1.3.2.2 thorpej struct scsi_set_window {
69 1.3.2.2 thorpej #define SET_WINDOW 0x24 /* set params of image area and windows */
70 1.3.2.2 thorpej #define GET_WINDOW 0x25
71 1.3.2.2 thorpej u_int8_t opcode;
72 1.3.2.2 thorpej u_int8_t byte2;
73 1.3.2.2 thorpej u_int8_t reserved[4];
74 1.3.2.2 thorpej u_int8_t len[3];
75 1.3.2.2 thorpej u_int8_t control;
76 1.3.2.2 thorpej };
77 1.3.2.2 thorpej
78 1.3.2.2 thorpej struct scsi_window_header {
79 1.3.2.2 thorpej u_int8_t reserved[6];
80 1.3.2.2 thorpej u_int8_t len[2];
81 1.3.2.2 thorpej };
82 1.3.2.2 thorpej
83 1.3.2.2 thorpej struct scsi_window_data {
84 1.3.2.2 thorpej u_int8_t window_id; /* must be zero */
85 1.3.2.2 thorpej u_int8_t res1:7;
86 1.3.2.2 thorpej u_int8_t auto_bit:1;
87 1.3.2.2 thorpej u_int8_t x_res[2];
88 1.3.2.2 thorpej u_int8_t y_res[2];
89 1.3.2.2 thorpej u_int8_t x_org[4];
90 1.3.2.2 thorpej u_int8_t y_org[4];
91 1.3.2.2 thorpej u_int8_t width[4];
92 1.3.2.2 thorpej u_int8_t length[4];
93 1.3.2.2 thorpej u_int8_t brightness;
94 1.3.2.2 thorpej u_int8_t threshold;
95 1.3.2.2 thorpej u_int8_t contrast;
96 1.3.2.2 thorpej u_int8_t image_comp; /* image composition (data type) */
97 1.3.2.2 thorpej u_int8_t bits_per_pixel;
98 1.3.2.2 thorpej u_int8_t halftone_pattern[2];
99 1.3.2.2 thorpej u_int8_t rif:1; /* reverse image format (mono negative) */
100 1.3.2.2 thorpej u_int8_t res2:4;
101 1.3.2.2 thorpej u_int8_t pad_type:3;
102 1.3.2.2 thorpej u_int8_t bit_ordering[2];
103 1.3.2.2 thorpej u_int8_t compression_type;
104 1.3.2.2 thorpej u_int8_t compression_arg;
105 1.3.2.2 thorpej u_int8_t res3[6];
106 1.3.2.2 thorpej };
107 1.3.2.2 thorpej
108 1.3.2.2 thorpej /* mustek scsi commands */
109 1.3.2.2 thorpej
110 1.3.2.2 thorpej #define MUSTEK_SET_WINDOW 0x04 /* set image area and windows */
111 1.3.2.2 thorpej #define MUSTEK_ADF 0x10 /* ADF and backtracking selection */
112 1.3.2.2 thorpej #define MUSTEK_LUT 0x55 /* look up table download */
113 1.3.2.2 thorpej
114 1.3.2.2 thorpej #endif /* _SCSI_SCANNER_H_ */
115