Re: /proc/scsi/scsi

Oliver.Rauch@Wolfsburg.DE
Fri, 10 Apr 1998 11:27:13 +0200 (MET DST)

Hi Bernd,

> > I am writing a little routine that reads /proc/scsi/scsi
> > and tries to find out on which device the scanner is connected.
>
> Why you don't use the scsi inquiry command on /dev/sg* ? Is there any
> problem that I do not see?
>
> I have written (stolen ;-) a very short program under linux that uses the
> scsi generic devices /dev/sg* and lists the scsi inquiry result like the
> following example:
>
> > scsiinfo /dev/sg0
> QUANTUM LP240S GM240S01X6.4 040392 142231934661
> device is loaded
>
> > scsiinfo /dev/sg1
> QUANTUM LPS540S 590008/05/93185331053867
> device is loaded
>
> Could this solve the problem?

I know that possibilty, we already have a tool "find scanner"
that does exactly the same, but it is not very nice to ask
all scsi-devices for their vendor, model and type when you start
a scan-program.
Some systems use the scsi-ids as device-numbers, but on
other systems linke linux you only have /dev/sg0-9 or sth. like that
because there are not enough major and minor device numbers to
give all possible devices their own major and minor numbers.
In /proc/scsi/scsi there is a list which scsi-hardware is connected
to /dev/sg* (or /dev/uk* ...).

So if that works, we can enter e.g. a "UMAX" "UMAX 12-S"
in the config-files for the backends instead of /dev/sg2
and if you turn on your cd-burner that shifts your scanner
from /dev/sg2 to /dev/sg3, the backend will find it automatically
without scanning the scsi-bus for it!

Bye
Oliver

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com