Hello, t...@!

Since a lot of HP usb printers work badly (or do not work at all)
with ulpt and they want all cups and hplip goo, I've added a
new UQ_SHOULD_UGEN quirk to let ulpt(4) know when to skip the device.

As a bonus, a usbdevs 0X->0x consistency conversion.

Index: ulpt.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ulpt.c,v
retrieving revision 1.37
diff -u -p -r1.37 ulpt.c
--- ulpt.c      24 Sep 2010 08:33:59 -0000      1.37
+++ ulpt.c      18 Dec 2010 08:06:12 -0000
@@ -153,8 +153,12 @@ ulpt_match(struct device *parent, void *
            id->bInterfaceSubClass == UISUBCLASS_PRINTER &&
            ((id->bInterfaceProtocol == UIPROTO_PRINTER_UNI) ||
             (id->bInterfaceProtocol == UIPROTO_PRINTER_BI) ||
-            (id->bInterfaceProtocol == UIPROTO_PRINTER_1284)))
+            (id->bInterfaceProtocol == UIPROTO_PRINTER_1284))) {
+               if (usbd_get_quirks(uaa->device)->uq_flags & UQ_SHOULD_UGEN)
+                       return (UMATCH_NONE);
+
                return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
+       }
        return (UMATCH_NONE);
 }
 
Index: usb_quirks.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb_quirks.c,v
retrieving revision 1.63
diff -u -p -r1.63 usb_quirks.c
--- usb_quirks.c        2 Dec 2010 06:39:09 -0000       1.63
+++ usb_quirks.c        18 Dec 2010 08:06:12 -0000
@@ -104,6 +104,7 @@ const struct usbd_quirk_entry {
  { USB_VENDOR_HP, USB_PRODUCT_HP_816C,             ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_959C,             ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_HP, USB_PRODUCT_HP_1220C,                    ANY,   { 
UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_HP, USB_PRODUCT_HP_LJ1010,           ANY,   { UQ_SHOULD_UGEN  }},
  { USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY900,       ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY760,       ANY,   { UQ_BROKEN_BIDIR }},
  { USB_VENDOR_NEC, USB_PRODUCT_NEC_PICTY920,       ANY,   { UQ_BROKEN_BIDIR }},
Index: usb_quirks.h
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb_quirks.h,v
retrieving revision 1.16
diff -u -p -r1.16 usb_quirks.h
--- usb_quirks.h        19 Jul 2010 05:08:37 -0000      1.16
+++ usb_quirks.h        18 Dec 2010 08:06:12 -0000
@@ -49,6 +49,8 @@ struct usbd_quirks {
 #define UQ_MS_LEADING_BYTE     0x00010000 /* mouse sends unknown leading byte 
*/
 #define UQ_EHCI_NEEDTO_DISOWN  0x00020000 /* must hand device over to USB 1.1
                                                if attached to EHCI */
+#define UQ_SHOULD_UGEN         0x00040000 /* device should not be matched by 
any
+                                               specific driver */
 };
 
 extern const struct usbd_quirks usbd_no_quirk;
Index: usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.533
diff -u -p -r1.533 usbdevs
--- usbdevs     17 Dec 2010 21:00:13 -0000      1.533
+++ usbdevs     18 Dec 2010 08:06:13 -0000
@@ -1913,6 +1913,7 @@ product HP 840C                   0x0604  DeskJet 840c
 product HP 2200C               0x0605  ScanJet 2200C
 product HP 5300C               0x0701  Scanjet 5300C
 product HP 816C                        0x0804  DeskJet 816C
+product HP LJ1010              0x0c17  LaserJet 1010
 product HP 970CSE              0x1004  Deskjet 970Cse
 product HP 5400C               0x1005  Scanjet 5400C
 product HP 2215                        0x1016  iPAQ 22xx/Jornada 548
@@ -3270,30 +3271,30 @@ product SEALEVEL 2403_1         0x2413  SeaPORT+
 product SEALEVEL 2403_2                0x2423  SeaPORT+4 (2403) Port 2
 product SEALEVEL 2403_3                0x2433  SeaPORT+4 (2403) Port 3
 product SEALEVEL 2403_4                0x2443  SeaPORT+4 (2403) Port 4
-product SEALEVEL 2801_1                0X2811  SeaLINK+8/232 (2801) Port 1
-product SEALEVEL 2801_2                0X2821  SeaLINK+8/232 (2801) Port 2
-product SEALEVEL 2801_3                0X2831  SeaLINK+8/232 (2801) Port 3
-product SEALEVEL 2801_4                0X2841  SeaLINK+8/232 (2801) Port 4
-product SEALEVEL 2801_5                0X2851  SeaLINK+8/232 (2801) Port 5
-product SEALEVEL 2801_6                0X2861  SeaLINK+8/232 (2801) Port 6
-product SEALEVEL 2801_7                0X2871  SeaLINK+8/232 (2801) Port 7
-product SEALEVEL 2801_8                0X2881  SeaLINK+8/232 (2801) Port 8
-product SEALEVEL 2802_1                0X2812  SeaLINK+8/485 (2802) Port 1
-product SEALEVEL 2802_2                0X2822  SeaLINK+8/485 (2802) Port 2
-product SEALEVEL 2802_3                0X2832  SeaLINK+8/485 (2802) Port 3
-product SEALEVEL 2802_4                0X2842  SeaLINK+8/485 (2802) Port 4
-product SEALEVEL 2802_5                0X2852  SeaLINK+8/485 (2802) Port 5
-product SEALEVEL 2802_6                0X2862  SeaLINK+8/485 (2802) Port 6
-product SEALEVEL 2802_7                0X2872  SeaLINK+8/485 (2802) Port 7
-product SEALEVEL 2802_8                0X2882  SeaLINK+8/485 (2802) Port 8
-product SEALEVEL 2803_1                0X2813  SeaLINK+8 (2803) Port 1
-product SEALEVEL 2803_2                0X2823  SeaLINK+8 (2803) Port 2
-product SEALEVEL 2803_3                0X2833  SeaLINK+8 (2803) Port 3
-product SEALEVEL 2803_4                0X2843  SeaLINK+8 (2803) Port 4
-product SEALEVEL 2803_5                0X2853  SeaLINK+8 (2803) Port 5
-product SEALEVEL 2803_6                0X2863  SeaLINK+8 (2803) Port 6
-product SEALEVEL 2803_7                0X2873  SeaLINK+8 (2803) Port 7
-product SEALEVEL 2803_8                0X2883  SeaLINK+8 (2803) Port 8
+product SEALEVEL 2801_1                0x2811  SeaLINK+8/232 (2801) Port 1
+product SEALEVEL 2801_2                0x2821  SeaLINK+8/232 (2801) Port 2
+product SEALEVEL 2801_3                0x2831  SeaLINK+8/232 (2801) Port 3
+product SEALEVEL 2801_4                0x2841  SeaLINK+8/232 (2801) Port 4
+product SEALEVEL 2801_5                0x2851  SeaLINK+8/232 (2801) Port 5
+product SEALEVEL 2801_6                0x2861  SeaLINK+8/232 (2801) Port 6
+product SEALEVEL 2801_7                0x2871  SeaLINK+8/232 (2801) Port 7
+product SEALEVEL 2801_8                0x2881  SeaLINK+8/232 (2801) Port 8
+product SEALEVEL 2802_1                0x2812  SeaLINK+8/485 (2802) Port 1
+product SEALEVEL 2802_2                0x2822  SeaLINK+8/485 (2802) Port 2
+product SEALEVEL 2802_3                0x2832  SeaLINK+8/485 (2802) Port 3
+product SEALEVEL 2802_4                0x2842  SeaLINK+8/485 (2802) Port 4
+product SEALEVEL 2802_5                0x2852  SeaLINK+8/485 (2802) Port 5
+product SEALEVEL 2802_6                0x2862  SeaLINK+8/485 (2802) Port 6
+product SEALEVEL 2802_7                0x2872  SeaLINK+8/485 (2802) Port 7
+product SEALEVEL 2802_8                0x2882  SeaLINK+8/485 (2802) Port 8
+product SEALEVEL 2803_1                0x2813  SeaLINK+8 (2803) Port 1
+product SEALEVEL 2803_2                0x2823  SeaLINK+8 (2803) Port 2
+product SEALEVEL 2803_3                0x2833  SeaLINK+8 (2803) Port 3
+product SEALEVEL 2803_4                0x2843  SeaLINK+8 (2803) Port 4
+product SEALEVEL 2803_5                0x2853  SeaLINK+8 (2803) Port 5
+product SEALEVEL 2803_6                0x2863  SeaLINK+8 (2803) Port 6
+product SEALEVEL 2803_7                0x2873  SeaLINK+8 (2803) Port 7
+product SEALEVEL 2803_8                0x2883  SeaLINK+8 (2803) Port 8
 
 /* Senao products */
 product SENAO RT2870_3         0x0605  RT2870

Reply via email to