diff options
author | 2001-01-28 09:43:41 +0000 | |
---|---|---|
committer | 2001-01-28 09:43:41 +0000 | |
commit | c7c0eef52352a7a1942f73770810c9560c6146a3 (patch) | |
tree | fea03472e6c232caad7e6b12e56720205ef35824 /sys/dev/usb/uhid.c | |
parent | sync (diff) | |
download | wireguard-openbsd-c7c0eef52352a7a1942f73770810c9560c6146a3.tar.xz wireguard-openbsd-c7c0eef52352a7a1942f73770810c9560c6146a3.zip |
Another USB sync with NetBSD. We are still lacking an up-to-date umass(4)
driver. I would appreciate it if someone with the hardware looked into it.
I also have to take a closer look at changes to the USB Ethernet drivers,
as well as import some drivers we are missing (uftdi, if_upl, yap, etc.)
Diffstat (limited to 'sys/dev/usb/uhid.c')
-rw-r--r-- | sys/dev/usb/uhid.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index e47a2454e3d..2730e06efd8 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.12 2000/11/08 18:10:38 aaron Exp $ */ +/* $OpenBSD: uhid.c,v 1.13 2001/01/28 09:43:42 aaron Exp $ */ /* $NetBSD: uhid.c,v 1.40 2000/10/10 12:37:01 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -40,7 +40,7 @@ */ /* - * HID spec: http://www.usb.org/developers/data/usbhid10.pdf + * HID spec: http://www.usb.org/developers/data/devclass/hid1_1.pdf */ #include <sys/param.h> @@ -69,11 +69,15 @@ #include <dev/usb/usb.h> #include <dev/usb/usbhid.h> +#include <dev/usb/usbdevs.h> #include <dev/usb/usbdi.h> #include <dev/usb/usbdi_util.h> #include <dev/usb/hid.h> #include <dev/usb/usb_quirks.h> +/* Report descriptor for broken Wacom Graphire */ +#include <dev/usb/ugraphire_rdesc.h> + #ifdef UHID_DEBUG #define DPRINTF(x) if (uhiddebug) logprintf x #define DPRINTFN(n,x) if (uhiddebug>(n)) logprintf x @@ -216,8 +220,22 @@ USB_ATTACH(uhid) sc->sc_ep_addr = ed->bEndpointAddress; - desc = NULL; - err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USBDEV); + if (uaa->vendor == USB_VENDOR_WACOM && + uaa->product == USB_PRODUCT_WACOM_GRAPHIRE /* && + uaa->revision == 0x???? */) { /* XXX should use revision */ + /* The report descriptor for the Wacom Graphire is broken. */ + size = sizeof uhid_graphire_report_descr; + desc = malloc(size, M_USBDEV, M_NOWAIT); + if (desc == NULL) + err = USBD_NOMEM; + else { + err = USBD_NORMAL_COMPLETION; + memcpy(desc, uhid_graphire_report_descr, size); + } + } else { + desc = NULL; + err = usbd_alloc_report_desc(uaa->iface, &desc, &size,M_USBDEV); + } if (err) { printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev)); sc->sc_dying = 1; |