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