diff options
author | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2001-10-04 22:55:57 +0000 |
---|---|---|
committer | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2001-10-04 22:55:57 +0000 |
commit | 73b01e34455fb7dbd454ac7e68ccae879e8d7496 (patch) | |
tree | 0d0ef12109d8e029fb670e2bb3964a7982c87bac /sys | |
parent | de966b36a6fa6a4f5d790b9334f559a8929e336f (diff) |
Match a IEEE 1284.4 protocol. We do not support this protocol directly,
but USB_ATTACH will switch printer to bidirectional protocol.
Read status from printer. From NetBSD.
This forces newest usb printers works.
Tested by drahn@ (Epson 740) and me (HP LaserJet 2200).
Ok aaron@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/ulpt.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/usb.h | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 3769a2a2e29..8f166c9cded 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.7 2001/05/03 02:20:34 aaron Exp $ */ +/* $OpenBSD: ulpt.c,v 1.8 2001/10/04 22:55:56 gluk Exp $ */ /* $NetBSD: ulpt.c,v 1.42 2001/04/16 00:18:06 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -40,7 +40,7 @@ */ /* - * Printer Class spec: http://www.usb.org/developers/data/devclass/usbprint109.PDF + * Printer Class spec: http://www.usb.org/developers/data/devclass/usbprint11.pdf */ #include <sys/param.h> @@ -180,8 +180,9 @@ USB_MATCH(ulpt) if (id != NULL && id->bInterfaceClass == UICLASS_PRINTER && id->bInterfaceSubClass == UISUBCLASS_PRINTER && - (id->bInterfaceProtocol == UIPROTO_PRINTER_UNI || - id->bInterfaceProtocol == UIPROTO_PRINTER_BI)) + ((id->bInterfaceProtocol == UIPROTO_PRINTER_UNI) || + (id->bInterfaceProtocol == UIPROTO_PRINTER_BI) || + (id->bInterfaceProtocol == UIPROTO_PRINTER_IEEE_1284_4))) return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO); return (UMATCH_NONE); } @@ -413,6 +414,7 @@ ulpt_status(struct ulpt_softc *sc) usbd_status err; u_char status; + req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UR_GET_PORT_STATUS; USETW(req.wValue, 0); USETW(req.wIndex, sc->sc_ifaceno); diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index a02573c4d9a..2e93c2ea22e 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.h,v 1.12 2001/01/28 09:43:42 aaron Exp $ */ +/* $OpenBSD: usb.h,v 1.13 2001/10/04 22:55:56 gluk Exp $ */ /* $NetBSD: usb.h,v 1.50 2000/06/01 15:43:32 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */ @@ -379,6 +379,7 @@ typedef struct { #define UISUBCLASS_PRINTER 1 #define UIPROTO_PRINTER_UNI 1 #define UIPROTO_PRINTER_BI 2 +#define UIPROTO_PRINTER_IEEE_1284_4 3 #define UICLASS_MASS 0x08 #define UISUBCLASS_RBC 1 |