From 73b01e34455fb7dbd454ac7e68ccae879e8d7496 Mon Sep 17 00:00:00 2001 From: Grigoriy Orlov Date: Thu, 4 Oct 2001 22:55:57 +0000 Subject: 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@ --- sys/dev/usb/ulpt.c | 10 ++++++---- sys/dev/usb/usb.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'sys') 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 @@ -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 -- cgit v1.2.3