Commit 3de01c00 authored by Henning Meier-Geinitz's avatar Henning Meier-Geinitz Committed by Vojtech Pavlik

[PATCH] scanner.c: Accept scanners with more than one interface

This patch allows the scanner driver to accept devices with more than
one interface. That's needed by some multi-function periphals (e.g.
scanner+printer).
parent edf22f51
......@@ -321,10 +321,12 @@
* "Jaeger, Gerhard" <gerhard@gjaeger.de>, Ira Childress
* <ichildress@mn.rr.com>, Till Kamppeter <till.kamppeter@gmx.net>,
* Ed Hamrick <EdHamrick@aol.com>, Oliver Schwartz
* <Oliver.Schwartz@gmx.de> and everyone else who sent ids.
* <Oliver.Schwartz@gmx.de> and everyone else who sent ids.
* - Some Benq, Genius and Plustek ids are identified now.
* - Accept scanners with only one bulk (in) endpoint (thanks to Sergey
* Vlasov <vsu@mivlgu.murom.ru>).
* - Accept devices with more than one interface. Only use interfaces that
* look like belonging to scanners.
*
* TODO
* - Remove the 2/3 endpoint limitation
......@@ -907,13 +909,15 @@ probe_scanner(struct usb_interface *intf,
return -ENODEV;
}
if (dev->config[0].desc.bNumInterfaces != 1) {
info("probe_scanner: Only one device interface is supported.");
interface = intf->altsetting;
if (interface[0].desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
interface[0].desc.bInterfaceClass != USB_CLASS_PER_INTERFACE &&
interface[0].desc.bInterfaceClass != 16) {
dbg("probe_scanner: This interface doesn't look like a scanner (class=0x%x).", interface[0].desc.bInterfaceClass);
return -ENODEV;
}
interface = intf->altsetting;
/*
* Start checking for one or two bulk endpoints and an optional
* interrupt endpoint. If we have an interrupt endpoint go ahead and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment