Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Add quirk for printers that cannot handle bidir ...



details:   https://anonhg.NetBSD.org/src/rev/f4e5bd153f59
branches:  trunk
changeset: 508612:f4e5bd153f59
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun Apr 15 09:38:01 2001 +0000

description:
Add quirk for printers that cannot handle bidir mode (not used yet).

diffstat:

 sys/dev/usb/usb_quirks.c |  20 ++++++++++++++++----
 sys/dev/usb/usb_quirks.h |   3 ++-
 2 files changed, 18 insertions(+), 5 deletions(-)

diffs (67 lines):

diff -r 2eed7ed15873 -r f4e5bd153f59 sys/dev/usb/usb_quirks.c
--- a/sys/dev/usb/usb_quirks.c  Sun Apr 15 09:28:31 2001 +0000
+++ b/sys/dev/usb/usb_quirks.c  Sun Apr 15 09:38:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.c,v 1.36 2001/01/18 20:28:23 jdolecek Exp $ */
+/*     $NetBSD: usb_quirks.c,v 1.37 2001/04/15 09:38:01 augustss Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.13 1999/11/17 22:33:47 n_hibma Exp $ */
 
 /*
@@ -50,6 +50,8 @@
 extern int usbdebug;
 #endif
 
+#define NONE 0xffff
+
 Static const struct usbd_quirk_entry {
        u_int16_t idVendor;
        u_int16_t idProduct;
@@ -79,6 +81,13 @@
  { USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1,       0x009, { UQ_AU_NO_FRAC }},
  { USB_VENDOR_SILICONPORTALS, USB_PRODUCT_SILICONPORTALS_YAPPHONE,
                                                    0x100, { UQ_AU_INP_ASYNC }},
+ /* XXX These should have a revision number, but I don't know what they are. */
+ { USB_VENDOR_HP, USB_PRODUCT_HP_895C,             NONE,  { UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_HP, USB_PRODUCT_HP_880C,             NONE,  { UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_HP, USB_PRODUCT_HP_815C,             NONE,  { UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_HP, USB_PRODUCT_HP_810C,             NONE,  { UQ_BROKEN_BIDIR }},
+ { USB_VENDOR_HP, USB_PRODUCT_HP_830C,             NONE,  { UQ_BROKEN_BIDIR }},
+
  { 0, 0, 0, { 0 } }
 };
 
@@ -88,11 +97,14 @@
 usbd_find_quirk(usb_device_descriptor_t *d)
 {
        const struct usbd_quirk_entry *t;
+       u_int16_t vendor = UGETW(d->idVendor);
+       u_int16_t product = UGETW(d->idProduct);
+       u_int16_t revision = UGETW(d->bcdDevice);
 
        for (t = usb_quirks; t->idVendor != 0; t++) {
-               if (t->idVendor  == UGETW(d->idVendor) &&
-                   t->idProduct == UGETW(d->idProduct) &&
-                   t->bcdDevice == UGETW(d->bcdDevice))
+               if (t->idVendor  == vendor &&
+                   t->idProduct == product &&
+                   (t->bcdDevice == NONE || t->bcdDevice == revision))
                        break;
        }
 #ifdef USB_DEBUG
diff -r 2eed7ed15873 -r f4e5bd153f59 sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h  Sun Apr 15 09:28:31 2001 +0000
+++ b/sys/dev/usb/usb_quirks.h  Sun Apr 15 09:38:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.h,v 1.19 2001/01/18 20:28:23 jdolecek Exp $ */
+/*     $NetBSD: usb_quirks.h,v 1.20 2001/04/15 09:38:01 augustss Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_quirks.h,v 1.9 1999/11/12 23:31:03 n_hibma Exp $  */
 
 /*
@@ -53,6 +53,7 @@
 #define UQ_AU_NO_FRAC  0x0400  /* don't adjust for fractional samples */
 #define UQ_AU_INP_ASYNC        0x0800  /* input is async despite claim of adaptive */
 #define UQ_ASSUME_CM_OVER_DATA 0x1000 /* modem device breaks on cm over data */
+#define UQ_BROKEN_BIDIR        0x2000  /* printer has broken bidir mode */
 };
 
 extern const struct usbd_quirks usbd_no_quirk;



Home | Main Index | Thread Index | Old Index