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
...@@ -325,6 +325,8 @@ ...@@ -325,6 +325,8 @@
* - Some Benq, Genius and Plustek ids are identified now. * - Some Benq, Genius and Plustek ids are identified now.
* - Accept scanners with only one bulk (in) endpoint (thanks to Sergey * - Accept scanners with only one bulk (in) endpoint (thanks to Sergey
* Vlasov <vsu@mivlgu.murom.ru>). * Vlasov <vsu@mivlgu.murom.ru>).
* - Accept devices with more than one interface. Only use interfaces that
* look like belonging to scanners.
* *
* TODO * TODO
* - Remove the 2/3 endpoint limitation * - Remove the 2/3 endpoint limitation
...@@ -907,13 +909,15 @@ probe_scanner(struct usb_interface *intf, ...@@ -907,13 +909,15 @@ probe_scanner(struct usb_interface *intf,
return -ENODEV; return -ENODEV;
} }
if (dev->config[0].desc.bNumInterfaces != 1) { interface = intf->altsetting;
info("probe_scanner: Only one device interface is supported.");
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; return -ENODEV;
} }
interface = intf->altsetting;
/* /*
* Start checking for one or two bulk endpoints and an optional * Start checking for one or two bulk endpoints and an optional
* interrupt endpoint. If we have an interrupt endpoint go ahead and * 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