[sane-devel] Re: sane-find-scanner detects smartcard reader as
scanner
Johannes Meixner
jsmeix at suse.de
Wed Aug 9 08:37:08 UTC 2006
Hello,
On Aug 8 18:34 Parag N(????) wrote (shortened):
> On 8/8/06, Johannes Meixner <jsmeix at suse.de> wrote:
> > There are several other USB devices which are correctly not
> > shown as scanners by sane-find-scanner.
>
> Can i know which are those that you experienced are not detected
> by sane-find-scanner?
I missed this question.
See
https://bugzilla.novell.com/attachment.cgi?id=95324&action=view
for some examples.
When you save it into a file and then use for example
egrep '^bDeviceClass|^ *bInterfaceClass|^idVendor|^idProduct'
you get
---------------------------------------------------------------------
bDeviceClass 9
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9
bDeviceClass 9
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9
bDeviceClass 9
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9
bDeviceClass 0
idVendor 0x05E3
idProduct 0x0710
bInterfaceClass 8
bDeviceClass 9
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9
bDeviceClass 0
idVendor 0x0C4B
idProduct 0x0300
bInterfaceClass 255
bDeviceClass 9
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9
---------------------------------------------------------------------
Only the device with idVendor = 0x0C4B is detected as scanner, i.e.:
---------------------------------------------------------------------
bDeviceClass 0
idVendor 0x0C4B
idProduct 0x0300
bInterfaceClass 255
---------------------------------------------------------------------
but this is no scanner (but a smartcard reader).
On a second host sane-find-scanner correctly detects
only scanners (and no non-scanner USB device):
---------------------------------------------------------------------
# sane-find-scanner -q
found USB scanner (vendor=0x04b8 [EPSON],
product=0x0121 [EPSON Scanner]) at libusb:001:002
found USB scanner (vendor=0x04b8 [EPSON],
product=0x080f [USB MFP]) at libusb:002:003
# lsusb -v \
| egrep '^Bus|bDeviceClass|bInterfaceClass|idVendor|idProduct|iInterface'
Bus 001 Device 002: ID 04b8:0121 Seiko Epson Corp.
bDeviceClass 255 Vendor Specific Class
idVendor 0x04b8 Seiko Epson Corp.
idProduct 0x0121
bInterfaceClass 255 Vendor Specific Class
iInterface 0
bDeviceClass 255 Vendor Specific Class
Bus 001 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
Bus 002 Device 003: ID 04b8:080f Seiko Epson Corp.
bDeviceClass 0 (Defined at Interface level)
idVendor 0x04b8 Seiko Epson Corp.
idProduct 0x080f
bInterfaceClass 255 Vendor Specific Class
iInterface 5 EPSON Scanner
bInterfaceClass 7 Printer
iInterface 6 USB Printer
bInterfaceClass 8 Mass Storage
iInterface 7 USB Mass Storage
Bus 002 Device 002: ID 03f0:0417 Hewlett-Packard
bDeviceClass 0 (Defined at Interface level)
idVendor 0x03f0 Hewlett-Packard
idProduct 0x0417
bInterfaceClass 7 Printer
iInterface 0
bInterfaceClass 7 Printer
iInterface 0
bInterfaceClass 7 Printer
iInterface 0
Bus 002 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
---------------------------------------------------------------------
Note that the "EPSON USB MFP" is an all-in-one device
which includes a scanner (at its first interface) which has
the same bDeviceClass = 0 and bInterfaceClass = 255 as the
smartcard reader device above with idVendor = 0x0C4B
and idProduct = 0x0300.
Therefore I assume there is nothing we can do to distinguish
only by the USB class identifiers which is a scanner
and which is not.
By the way:
Note that my HP LaserJet 1220 all-in-one device with
idProduct = 0x0417 cannot be detected as a scanner
because it shows up as three printer interfaces:
---------------------------------------------------------------------
idVendor 0x03f0 Hewlett-Packard
idProduct 0x0417
bcdDevice 1.00
iManufacturer 1 HewLett Packard
iProduct 2 HP LaserJet 1220
iSerial 3 00XXXXXXXXXX
...
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
bInterfaceProtocol 3 IEEE 1284.4 compatible bidirectional
...
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
bInterfaceProtocol 2 Bidirectional
...
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
bInterfaceProtocol 1 Unidirectional
---------------------------------------------------------------------
On the first glance it might look simply wrong that there is
no scanner interface but as bInterfaceProtocol is different,
I assume that it is even 100% correct as is - I don't care as it
works perfectly well for me using HP's HPLIP driver software
(i.e. the external SANE backend hpaio).
On a third host sane-find-scanner also correctly detects
only scanners (and no non-scanner USB device):
---------------------------------------------------------------------
# sane-find-scanner -q
found SCSI processor "HP C6270A 3846" at /dev/sg0
found USB scanner (vendor=0x04b8 [EPSON],
product=0x010b [Perfection1240]) at libusb:001:004
found USB scanner (vendor=0x04a9 [Canon],
product=0x220e [CanoScan], chip=LM9832/3) at libusb:002:002
# lsusb -v | egrep
'^Bus|bDeviceClass|bInterfaceClass|idVendor|idProduct|iInterface'
Bus 005 Device 005: ID 054c:0174 Sony Corp.
bDeviceClass 0 (Defined at Interface level)
idVendor 0x054c Sony Corp.
idProduct 0x0174
bInterfaceClass 8 Mass Storage
iInterface 0
bDeviceClass 0 (Defined at Interface level)
Bus 005 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
Bus 001 Device 005: ID 03f0:3304 Hewlett-Packard DeskJet 990c
bDeviceClass 0 (Defined at Interface level)
idVendor 0x03f0 Hewlett-Packard
idProduct 0x3304 DeskJet 990c
bInterfaceClass 7 Printer
iInterface 0
Bus 001 Device 004: ID 04b8:010b Seiko Epson Corp. Perfection 1240
bDeviceClass 255 Vendor Specific Class
idVendor 0x04b8 Seiko Epson Corp.
idProduct 0x010b Perfection 1240
bInterfaceClass 255 Vendor Specific Class
iInterface 0
Bus 001 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
Bus 004 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
Bus 002 Device 002: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30
bDeviceClass 255 Vendor Specific Class
idVendor 0x04a9 Canon, Inc.
idProduct 0x220e CanoScan N1240U/LiDE 30
bInterfaceClass 255 Vendor Specific Class
iInterface 0
Bus 002 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
Bus 003 Device 001: ID 0000:0000
bDeviceClass 9 Hub
idVendor 0x0000
idProduct 0x0000
bInterfaceClass 9 Hub
iInterface 0
---------------------------------------------------------------------
Because of the above I think a reasonable way to enhance
sane-find-scanner so that it doesn't detect too much non-scanners
might be a fixed built-in list of USB vendor IDs
- which are known to make USB scanners or
- which are known to make USB scanners which are supported
directly by SANE or
- which are known to make USB scanners which are supported
by an external SANE backend.
There might be an additional command line parameter which kind
of USB scanner manufacturers are recognized by sane-find-scanner
and if this parameter is not set, it uses its current way to
detect "The Usual Suspects".
It is questionable if such an enhancement is worth the effort
as sooner or later the list of USB vendor IDs will become
outdated if it is not carefully kept up to date.
Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5 Mail: jsmeix at suse.de
90409 Nuernberg, Germany WWW: http://www.suse.de/
More information about the sane-devel
mailing list