On Thu, 8 Mar 2007, Linos wrote:

> Wow your trick save my life :), it works like a charm, it detects now
> and print very well in cups hehehe, many thanks Alan. The problem i have
> now it is that i will have to patch any new kernel version with this
> hack and i will have to admin about 70 Debian machines with different
> hardware, i think that without debian binary kernels can be like live in
> the hell. Do you know any way to try that it would be patched in
> mainstream linux kernel? 

Okay, below is a patch you should test.  If it works, I will submit it to 
be included in the kernel.

Alan Stern


Index: usb-2.6/drivers/usb/class/usblp.c
===================================================================
--- usb-2.6.orig/drivers/usb/class/usblp.c
+++ usb-2.6/drivers/usb/class/usblp.c
@@ -202,6 +202,7 @@ struct quirk_printer_struct {
 
 #define USBLP_QUIRK_BIDIR      0x1     /* reports bidir but requires 
unidirectional mode (no INs/reads) */
 #define USBLP_QUIRK_USB_INIT   0x2     /* needs vendor USB init string */
+#define USBLP_QUIRK_BAD_CLASS  0x4     /* descriptor uses vendor-specific 
Class or SubClass */
 
 static const struct quirk_printer_struct quirk_printers[] = {
        { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
@@ -218,6 +219,7 @@ static const struct quirk_printer_struct
        { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
        { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
        { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut 
<[EMAIL PROTECTED]> */
+       { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt 
Printer M129C */
        { 0, 0 }
 };
 
@@ -1048,7 +1050,8 @@ static int usblp_select_alts(struct usbl
                ifd = &if_alt->altsetting[i];
 
                if (ifd->desc.bInterfaceClass != 7 || 
ifd->desc.bInterfaceSubClass != 1)
-                       continue;
+                       if (!(usblp->quirks & USBLP_QUIRK_BAD_CLASS))
+                               continue;
 
                if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL ||
                    ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL)


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to