The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/scsipi/ssvar.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: ssvar.h,v 1.10.2.1 2004/09/11 12:58:07 he Exp $        */
    2 
    3 /*
    4  * Copyright (c) 1995 Kenneth Stailey.  All rights reserved.
    5  *   modified for configurable scanner support by Joachim Koenig
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   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.
   20  *
   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.
   31  */
   32 
   33 /*
   34  * SCSI scanner interface description
   35  */
   36 
   37 /*
   38  * Special handlers for impractically different scanner types.
   39  * Register NULL for a function if you want to try the real SCSI code
   40  * (with quirks table)
   41  */
   42 struct ss_softc;
   43 struct scan_io;
   44 
   45 struct ss_special {
   46         int     (*set_params) __P((struct ss_softc *, struct scan_io *));
   47         int     (*trigger_scanner) __P((struct ss_softc *));
   48         int     (*get_params) __P((struct ss_softc *));
   49         /* some scanners only send line-multiples */
   50         void    (*minphys) __P((struct ss_softc *, struct buf *));
   51         int     (*read) __P((struct ss_softc *, struct buf *));
   52         int     (*rewind_scanner) __P((struct ss_softc *));
   53         int     (*load_adf) __P((struct ss_softc *));
   54         int     (*unload_adf) __P((struct ss_softc *));
   55 };
   56 
   57 /*
   58  * ss_softc has to be declared here, because the device dependant
   59  * modules include it
   60  */
   61 struct ss_softc {
   62         struct device sc_dev;
   63 
   64         int flags;
   65 #define SSF_TRIGGERED   0x01    /* read operation has been primed */
   66 #define SSF_LOADED      0x02    /* parameters loaded */
   67 #define SSF_AUTOCONF    0x04    /* set during auto-configuration */
   68         struct scsipi_periph *sc_periph; /* contains our targ, lun, etc. */
   69         struct scan_io sio;
   70         struct bufq_state buf_queue;    /* the queue of pending IO operations */
   71         struct callout sc_callout;      /* to restart the buf queue */
   72         u_int quirks;                   /* scanner is only mildly twisted */
   73 #define SS_Q_GET_BUFFER_SIZE    0x0001  /* poll for available data in ssread() */
   74 /* truncate to byte boundary is assumed by default unless one of these is set */
   75 #define SS_Q_PAD_TO_BYTE        0x0002  /* pad monochrome data to byte boundary */
   76 #define SS_Q_PAD_TO_WORD        0x0004  /* pad monochrome data to word boundary */
   77 #define SS_Q_THRESHOLD_FOLLOWS_BRIGHTNESS 0x0008
   78         struct ss_special *special;     /* special handlers for spec. devices */
   79 };
   80 
   81 void    ssrestart(void *); 
   82 
   83 /*
   84  * define the special attach routines if configured
   85  */
   86 void mustek_attach __P((struct ss_softc *, struct scsipibus_attach_args *));
   87 void scanjet_attach __P((struct ss_softc *, struct scsipibus_attach_args *));

Cache object: 3ec905bcc67cb114bc0a9b24f964b0b5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.