ChangeSet 1.946.3.2, 2002/12/23 11:21:38-08:00, henning@meier-geinitz.de [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). diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c --- a/drivers/usb/image/scanner.c Fri Dec 27 23:58:20 2002 +++ b/drivers/usb/image/scanner.c Fri Dec 27 23:58:20 2002 @@ -321,10 +321,12 @@ * "Jaeger, Gerhard" , Ira Childress * , Till Kamppeter , * Ed Hamrick , Oliver Schwartz - * and everyone else who sent ids. + * 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 ). + * - Accept devices with more than one interface. Only use interfaces that + * look like belonging to scanners. * * TODO * - Remove the 2/3 endpoint limitation @@ -907,12 +909,14 @@ 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