ChangeSet 1.897.1.7, 2003/01/08 10:09:32-08:00, henning@meier-geinitz.de [PATCH] scanner.c, scanner.h: Use symbolic name for interface class Hi, On Wed, Jan 08, 2003 at 08:29:36AM -0800, Greg KH wrote: > On Tue, Dec 24, 2002 at 05:44:55PM +0100, Henning Meier-Geinitz wrote: > > Hi, > > > > On Tue, Dec 24, 2002 at 12:40:06AM +0100, Oliver Neukum wrote: > > > > > > > Well, the reason I didn't use one was that I didn't found one in > > > > usb.h/usb_ch9.h for 16. It's also not listed on www.usb.org. > > > > > > > > lsusb calls it "Data". However, I'm not sure if this is a hex/dec > > > > error and they really mean "Data" = dec 10, not 0x10 (=dec 16). > > > > > > > > Shall I define a local symbolic name (e.g. > > > > STRANGE_HP_SCANJET_INTERFACE_CLASS)? But I really don't know what this > > > > class is. I only know that it's used by a Hewlett-Packard ScanJet > > > > 3300c and Genius HR6 USB - Vivid III. > > > > > > Better that than a bare number. > > > > Patch attached. > > Applied to my 2.4 tree, sorry for the delay. Here is the same for 2.5.44: diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c --- a/drivers/usb/image/scanner.c Wed Jan 8 11:53:43 2003 +++ b/drivers/usb/image/scanner.c Wed Jan 8 11:53:43 2003 @@ -874,7 +874,7 @@ if (interface[0].desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC && interface[0].desc.bInterfaceClass != USB_CLASS_PER_INTERFACE && - interface[0].desc.bInterfaceClass != 16) { + interface[0].desc.bInterfaceClass != SCN_CLASS_SCANJET) { dbg("probe_scanner: This interface doesn't look like a scanner (class=0x%x).", interface[0].desc.bInterfaceClass); return -ENODEV; } diff -Nru a/drivers/usb/image/scanner.h b/drivers/usb/image/scanner.h --- a/drivers/usb/image/scanner.h Wed Jan 8 11:53:43 2003 +++ b/drivers/usb/image/scanner.h Wed Jan 8 11:53:43 2003 @@ -270,6 +270,9 @@ /* send/recv a control message to the scanner */ #define SCANNER_IOCTL_CTRLMSG _IOWR('U', 0x22, struct usb_ctrlrequest) +/* USB bInterfaceClass used by Hewlett-Packard ScanJet 3300c and Genius HR6 + USB - Vivid III */ +#define SCN_CLASS_SCANJET 16 #ifdef CONFIG_USB_DYNAMIC_MINORS #define SCN_MAX_MNR 256