sanei_scsi.h

Go to the documentation of this file.
00001 /* sane - Scanner Access Now Easy.
00002    Copyright (C) 1996, 1997 David Mosberger-Tang
00003    This file is part of the SANE package.
00004 
00005    SANE is free software; you can redistribute it and/or modify it
00006    under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    SANE is distributed in the hope that it will be useful, but WITHOUT
00011    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00012    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00013    License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with sane; see the file COPYING.  If not, write to the Free
00017    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019    As a special exception, the authors of SANE give permission for
00020    additional uses of the libraries contained in this release of SANE.
00021 
00022    The exception is that, if you link a SANE library with other files
00023    to produce an executable, this does not by itself cause the
00024    resulting executable to be covered by the GNU General Public
00025    License.  Your use of that executable is in no way restricted on
00026    account of linking the SANE library code into it.
00027 
00028    This exception does not, however, invalidate any other reasons why
00029    the executable file might be covered by the GNU General Public
00030    License.
00031 
00032    If you submit changes to SANE to the maintainers to be included in
00033    a subsequent release, you agree by submitting the changes that
00034    those changes may be distributed with this exception intact.
00035 
00036    If you write modifications of your own for SANE, it is your choice
00037    whether to permit this exception to apply to your modifications.
00038    If you do not wish that, delete this exception notice.
00039 */
00040 
00047 #ifndef sanei_scsi_h
00048 #define sanei_scsi_h
00049 
00050 #include <sys/types.h>
00051 
00052 #include <sane/sane.h>
00053 
00067 typedef SANE_Status (*SANEI_SCSI_Sense_Handler) (int fd,
00068                                                  u_char *sense_buffer,
00069                                                  void *arg);
00072 extern int sanei_scsi_max_request_size;
00073 
00093 extern void sanei_scsi_find_devices (const char *vendor, const char *model,
00094                                      const char *type,
00095                                      int bus, int channel, int id, int lun,
00096                                      SANE_Status (*attach) (const char *dev));
00097 
00098 
00119 extern SANE_Status sanei_scsi_open (const char * device_name, int * fd,
00120                                     SANEI_SCSI_Sense_Handler sense_handler,
00121                                     void *sense_arg);
00122 
00150 extern SANE_Status sanei_scsi_open_extended (
00151        const char * device_name, int * fd,
00152        SANEI_SCSI_Sense_Handler sense_handler,
00153        void *sense_arg, int *buffersize);
00154 
00164 #define HAVE_SANEI_SCSI_OPEN_EXTENDED
00165 
00192 extern SANE_Status sanei_scsi_req_enter (int fd,
00193                                          const void * src, size_t src_size,
00194                                          void * dst, size_t * dst_size,
00195                                          void **idp);
00196 
00229 extern SANE_Status sanei_scsi_req_enter2 (int fd,
00230                                          const void * cmd, size_t cmd_size,
00231                                          const void * src, size_t src_size,
00232                                          void * dst, size_t * dst_size,
00233                                          void **idp);
00234 
00246 extern SANE_Status sanei_scsi_req_wait (void *id);
00247 
00270 extern SANE_Status sanei_scsi_cmd (int fd,
00271                                    const void * src, size_t src_size,
00272                                    void * dst, size_t * dst_size);
00273 
00297 extern SANE_Status sanei_scsi_cmd2 (int fd,
00298                                    const void * cmd, size_t cmd_size,
00299                                    const void * src, size_t src_size,
00300                                    void * dst, size_t * dst_size);
00301 
00309 extern void sanei_scsi_req_flush_all (void);
00310 
00319 extern void sanei_scsi_req_flush_all_extended (int fd);
00320 
00326 extern void sanei_scsi_close (int fd);
00327 
00328 #endif /* sanei_scsi_h */

Generated on Sat Jul 26 05:45:27 2008 for SANEI by  doxygen 1.5.1