


sane-scsi(5)                                         sane-scsi(5)


NNAAMMEE
       sane-scsi - SCSI adapter tips for scanners

DDEESSCCRRIIPPTTIIOONN
       This  manual  page  contains various operating-system spe-
       cific tips and tricks on how to get scanners with  a  SCSI
       interface working.

GGEENNEERRAALL IINNFFOO
       For  scanners  with  a  SCSI interface, it is necessary to
       edit the appropriate  backend  configuration  file  before
       using SANE for the first time.  For most systems, the con-
       figuration file should list the name of the  generic  SCSI
       device  that  the  scanner  is  connected  to (e.g., under
       Linux, //ddeevv//ssggee is such a generic  SCSI  device).   It  is
       customary  to  create  a  symlink from //ddeevv//ssccaannnneerr to the
       generic SCSI device that the scanner is connected to.   In
       this  case,  the  configuration file simply lists the line
       //ddeevv//ssccaannnneerr.  For a detailed description  of  each  back-
       end's  configuration  file,  please  refer to the relevant
       backend manual page (e.g., sane-epson(5) for  Epson  scan-
       ners, sane-hp(5) for HP scanners, etc.).

       For Linux, there is an alternate way of specifying scanner
       devices (beginning with SANE version 0.73).   This  alter-
       nate  way  is based on /proc/scsi/scsi and allows to iden-
       tify scanners by the SCSI vendor and model  string  and/or
       by  the  SCSI  device  address  (consisting of bus number,
       channel number, id, and logical unit number).  The  syntax
       for specifying a scanner in this way is:

              scsi _V_E_N_D_O_R _M_O_D_E_L _T_Y_P_E _B_U_S _C_H_A_N_N_E_L _I_D _L_U_N

       where  _V_E_N_D_O_R is the SCSI vendor string, _M_O_D_E_L is the SCSI
       model string, _T_Y_P_E is type SCSI device type string, _B_U_S is
       the  SCSI  bus number, _C_H_A_N_N_E_L is the SCSI channel number,
       _I_D is the SCSI id, and _L_U_N is the logical unit  number  of
       the  scanner  device.   The  first  two fields are strings
       which must be enclosed in double-quotes  if  they  contain
       any  whitespace.   The remaining four fields are non-nega-
       tive integer numbers.  The correct values for these fields
       can  be found by looking at the output of the command "cat
       /proc/scsi/scsi".  To simplify  configuration,  a  field's
       value can be replaced with an asterisk symbol (``*'').  An
       asterisk has the effect that any value is allowed for that
       particular  field.  This can have the effect that a single
       scsi-line matches multiple devices.   When  this  happens,
       each  matching device will be probed by the backend one by
       one and registered if the backend thinks it is a  compati-
       ble device.  For example, the line

              scsi MUSTEK * * * * * *

       would  have the effect that all SCSI devices in the system



                           13 May 1998                          1





sane-scsi(5)                                         sane-scsi(5)


       with a vendor string of MUSTEK would be probed and  recog-
       nized by the backend.

       If  the  remainder  of a scsi-string consists of asterisks
       only, the asterisks can be omitted.  For example, the fol-
       lowing line is equivalent to the one specified previously:

              scsi MUSTEK

       On some platforms (e.g., OpenStep), SANE device names take
       a  special  form.  This is explained below in the relevant
       platform-specific section.

       When using a SCSI scanner, ensure that the access  permis-
       sion for the generic SCSI device is set appropriately.  We
       recommend to add a group  "scanner"  to  /etc/group  which
       contains all users that should have access to the scanner.
       The permission of the device should then be set  to  allow
       group  read and write access.  For example, if the scanner
       is at generic SCSI device //ddeevv//ssggee, then the following two
       commands would set the permission correctly:

              $ chgrp scanner /dev/sge
              $ chmod 660 /dev/sge

FFrreeeeBBSSDD
              Adaptec AHA1542CF
                     Reported  to  work fine under FreeBSD 2.2.2R
                     with the aahhaa driver.

              Adaptec 2940
                     Reported to work fine under FreeBSD 2.2.2.

              Adaptec 1522
                     The scanner probes ok  but  any  attempt  to
                     access  it _h_a_n_g_s the entire system. It looks
                     like something is disabling  interrupts  and
                     then not reenabling them, so it looks like a
                     bug in the FreeBSD aaiicc driver.

              Adaptec 1505
                     Works on FreeBSD 2.2.5R and  3.0  using  the
                     aaiicc driver, provided that Plug-and-Play sup-
                     port is disabled on the card.  If there  are
                     no  _u_k devices, just do a ``sh MAKEDEV uk0''
                     in the //ddeevv directory.  The  scanner  should
                     then  be  accessible  as  //ddeevv//uukk00 iiff iitt wwaass
                     pprroobbeedd during boot.

              Tekram DC390
                     Reported to work fine under  FreeBSD  2.2.2R
                     with the aammdd driver.





                           13 May 1998                          2





sane-scsi(5)                                         sane-scsi(5)


LLIINNUUXX
       First,  make  sure  your  kernel  has SCSI generic support
       enabled.  In ``make xconfig'', this shows up under  ``SCSI
       support->SCSI generic support''.

       To keep scanning times to a minimum, it is strongly recom-
       mended to use a large buffer size  for  the  generic  SCSI
       driver.   By  default,  Linux  uses a buffer of size 32KB.
       This works, but for  many  cheaper  scanners  this  causes
       scanning  to be slower by about a factor of four than when
       using a size of 127KB.  Linux defines  the  size  of  this
       buffer    by    macro    SSGG__BBIIGG__BBUUFFFF    in   header   file
       _/_u_s_r_/_i_n_c_l_u_d_e_/_s_c_s_i_/_s_g_._h.   Unless  a  system  is  seriously
       short  on memory, it is recommended to increase this value
       to the maximum legal value of  128*1024-512=130560  bytes.
       After  changing  this  value, it is necessary to recompile
       both the kernel (or the SCSI generic module) and the  SCSI
       backends.

       A  common  issue with SCSI scanners is what to do when you
       booted the system while the scanner was  turned  off?   In
       such a case, the scanner won't be recognized by the kernel
       and SANE won't be able to access it.   Fortunately,  Linux
       provides  a  simple  mechanism  to  probe a SCSI device on
       demand.  Suppose you have a scanner connected to SCSI  bus
       2  and the scanner has a SCSI id of 5.  When the system is
       up and running and the scanner is turned on, you can issue
       the command:

              echo   "scsi   add-single-device   2   0   5  0"  >
              /proc/scsi/scsi

       and the kernel will probe and recognize your scanner (this
       needs  to be done as root).  It's also possible to dynami-
       cally remove a SCSI device by using  the  ``remove-single-
       device''  command.   For  details,  please refer to to the
       SCSI-Programming-HOWTO.

       Scanners  are  known  to  work  with  the  following  SCSI
       adapters under Linux:


              Adaptec AHA-1505/AHA-1542/AHA-2940
                     Reported to work fine with Linux v2.0.

              ASUS SC200
                     Reported to work fine with Linux v2.0.

              BusLogic  BT958  To  configure the BusLogic card,
                     you may need to follow
                     these  instructions  (contributed  by Jeremy
                     <jeremy@xxedgexx.com>):  During  boot,  when
                     your  BusLogic adapter is being initialized,
                     press Ctrl-B to enter your BusLogic  adapter



                           13 May 1998                          3





sane-scsi(5)                                         sane-scsi(5)


                     setup.   Choose  the address which your Bus-
                     Logic containing your  scanner  is  located.
                     Choose    ``SCSI   Device   Configuration''.
                     Choose ``Scan SCSI Bus''.   Choose  whatever
                     SCSI  id that contains your scanner and then
                     choose ``View/Modify  SCSI  configuration''.
                     Change   ``Negotiation''  to  ``async''  and
                     change ``Disconnect'' to ``off''. Press Esc,
                     save,  and  Esc again until you are asked to
                     reboot.

              Mustek 53c400/DTCT436 or DTC3181E ISA SCSI card
                     If your card is jumper-less (plug and  pray)
                     and the Linux kernel fails to recognize your
                     card, then you may need  the  patch  _m_u_s_t_e_k_-
                     _s_c_s_i_-_0_._2_._p_a_t_c_h_._g_z   which  is  available  at
                     _f_t_p_:_/_/_f_t_p_._m_o_s_t_a_n_g_._c_o_m_/_p_u_b_/_s_a_n_e_/.   Once  the
                     kernel  detects the card, it should work all
                     right.  However, while it  should  work,  do
                     not  expect  good  performance  out  of this
                     card---it has no interrupt line  and  there-
                     fore while a scan is in progress, the system
                     becomes almost unusable.

              ncr810 For this card, make sure the SCSI timeout is
                     reasonably  big; the default timeout for the
                     Linux kernels before 2.0.33 is  10  seconds,
                     which  is  way  too  low when scanning large
                     area.  If  you  get  messages  of  the  form
                     ``restart    (ncr    dead   ?)''   in   your
                     /var/log/messages file or on the system con-
                     sole, it's an indication that the timeout is
                     too short.  In this case, find the line ``if
                     (np->latetime>10)''   in   file  ncr53c8xx.c
                     (normally            in            directory
                     /usr/src/linux/drivers/scsi)  and change the
                     constant 10 to, say, 60 (one minute).   Then
                     rebuild the kernel/module and try again.

              Tekram DC390
                     Version  1.11  of the Tekram driver seems to
                     work fine mostly, except that the scan  does
                     not  terminate  properly  (it  causes a SCSI
                     timeout  after  10  minutes).   The  generic
                     AM53C974  also  seems  to work fine and does
                     not suffer from the timeout problems.

SSoollaarriiss,, OOppeennSStteepp aanndd NNeeXXTTSStteepp
       Under Solaris, OpenStep and  NeXTStep,  the  generic  SCSI
       device  name  refers  to  a SCSI bus, not to an individual
       device.  For example, //ddeevv//ssgg00 refers to  the  first  SCSI
       bus.  To tell SANE which device to use, append the charac-
       ter 'a'+target-id to the special device name.   For  exam-
       ple,   the   SCSI  device  connected  to  the  first  SCSI



                           13 May 1998                          4





sane-scsi(5)                                         sane-scsi(5)


       controller and with target-id 0 would be called //ddeevv//ssgg00aa,
       and  the device with target-id 1 on that same bus would be
       called //ddeevv//ssgg00bb,, and so on.

EENNVVIIRROONNMMEENNTT
       SSAANNEE__DDEEBBUUGG__SSAANNEEII__SSCCSSII
              If the library  was  compiled  with  debug  support
              enabled,  this  environment  variable  controls the
              debug level for the  generic  SCSI  I/O  subsystem.
              E.g.,  a  value of 128 requests all debug output to
              be printed.  Smaller levels reduce verbosity.

SSEEEE AALLSSOO
       sane-dmc(5), sane-epson(5), sane-hp(5), sane-microtek(5),
        sane-microtek2(5), sane-mustek(5), sane-umax(5)

AAUUTTHHOORR
       David Mosberger







































                           13 May 1998                          5


