Module Name: src
Committed By: ryoon
Date: Wed Jul 20 19:27:54 UTC 2011
Modified Files:
src/sys/dev/usb: ugraphire_rdesc.h uhidev.c
Log Message:
Fix PR kern/42570
* Graphire uses the descriptor as same as Graphire 3.
This is confirmed by USB analysis on Windows.
That is done with Wacom's official device driver and USB Snoopy.
* Old rev. 1.1 descriptor supports stylus only, probably 4D mouse
is not supported. Graphire 3's one probably supports 4D mouse.
* Graphire also needs 0x0202 sending.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/ugraphire_rdesc.h
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/uhidev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/ugraphire_rdesc.h
diff -u src/sys/dev/usb/ugraphire_rdesc.h:1.6 src/sys/dev/usb/ugraphire_rdesc.h:1.7
--- src/sys/dev/usb/ugraphire_rdesc.h:1.6 Mon Jan 22 19:48:57 2007
+++ src/sys/dev/usb/ugraphire_rdesc.h Wed Jul 20 19:27:53 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ugraphire_rdesc.h,v 1.6 2007/01/22 19:48:57 ghen Exp $ */
+/* $NetBSD: ugraphire_rdesc.h,v 1.7 2011/07/20 19:27:53 ryoon Exp $ */
/*
* Copyright (c) 2000 Nick Hibma <[email protected]>
* All rights reserved.
@@ -25,72 +25,13 @@
* SUCH DAMAGE.
*/
-static const uByte uhid_graphire_report_descr[] = {
- 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
- 0x09, 0x01, /* USAGE (Digitizer) */
- 0xa1, 0x01, /* COLLECTION (Application) */
- 0x85, 0x02, /* REPORT_ID (2) */
- 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
- 0x09, 0x01, /* USAGE (Digitizer) */
- 0xa1, 0x00, /* COLLECTION (Physical) */
- 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
- 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
- 0x09, 0x33, /* USAGE (Touch) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x09, 0x44, /* USAGE (Barrel Switch) */
- 0x95, 0x02, /* REPORT_COUNT (2) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x09, 0x00, /* USAGE (Undefined) */
- 0x95, 0x02, /* REPORT_COUNT (2) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x03, /* INPUT (Cnst,Var,Abs) */
- 0x09, 0x3c, /* USAGE (Invert) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x09, 0x38, /* USAGE (Transducer Index) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x09, 0x32, /* USAGE (In Range) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x01, /* REPORT_SIZE (1) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
- 0x09, 0x30, /* USAGE (X) */
- 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
- 0x26, 0xde, 0x27, /* LOGICAL_MAXIMUM (10206) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x10, /* REPORT_SIZE (16) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x09, 0x31, /* USAGE (Y) */
- 0x26, 0xfe, 0x1c, /* LOGICAL_MAXIMUM (7422) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x10, /* REPORT_SIZE (16) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
- 0x09, 0x30, /* USAGE (Tip Pressure) */
- 0x26, 0xff, 0x01, /* LOGICAL_MAXIMUM (511) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0x75, 0x10, /* REPORT_SIZE (16) */
- 0x81, 0x02, /* INPUT (Data,Var,Abs) */
- 0xc0, /* END_COLLECTION */
- 0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
- 0x09, 0x00, /* USAGE (Undefined) */
- 0x85, 0x02, /* REPORT_ID (2) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0xb1, 0x02, /* FEATURE (Data,Var,Abs) */
- 0x09, 0x00, /* USAGE (Undefined) */
- 0x85, 0x03, /* REPORT_ID (3) */
- 0x95, 0x01, /* REPORT_COUNT (1) */
- 0xb1, 0x02, /* FEATURE (Data,Var,Abs) */
- 0xc0, /* END_COLLECTION */
-};
-
-/* Tested with Graphire3 4x5 and 6x8, and Graphire4 4x5 */
+/* Tested with
+ * - Graphire
+ * - Graphire2
+ * - Graphire3 4x5
+ * - Graphire3 6x8
+ * - Graphire4 4x5
+ */
static const uByte uhid_graphire3_4x5_report_descr[] = {
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x02, /* USAGE (Mouse) */
Index: src/sys/dev/usb/uhidev.c
diff -u src/sys/dev/usb/uhidev.c:1.49 src/sys/dev/usb/uhidev.c:1.50
--- src/sys/dev/usb/uhidev.c:1.49 Sat Jan 29 14:20:18 2011
+++ src/sys/dev/usb/uhidev.c Wed Jul 20 19:27:53 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uhidev.c,v 1.49 2011/01/29 14:20:18 tsutsui Exp $ */
+/* $NetBSD: uhidev.c,v 1.50 2011/07/20 19:27:53 ryoon Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.49 2011/01/29 14:20:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.50 2011/07/20 19:27:53 ryoon Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -193,10 +193,6 @@
/* The report descriptor for the Wacom Graphire is broken. */
switch (uaa->product) {
case USB_PRODUCT_WACOM_GRAPHIRE:
- size = sizeof uhid_graphire_report_descr;
- descptr = uhid_graphire_report_descr;
- break;
-
case USB_PRODUCT_WACOM_GRAPHIRE2:
case USB_PRODUCT_WACOM_GRAPHIRE3_4X5:
case USB_PRODUCT_WACOM_GRAPHIRE3_6X8: