From owner-freebsd-usb@FreeBSD.ORG Mon Sep 17 18:10:04 2012 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87D75106566B for ; Mon, 17 Sep 2012 18:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 61AF68FC14 for ; Mon, 17 Sep 2012 18:10:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q8HIA4HH068845 for ; Mon, 17 Sep 2012 18:10:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8HIA4RU068844; Mon, 17 Sep 2012 18:10:04 GMT (envelope-from gnats) Resent-Date: Mon, 17 Sep 2012 18:10:04 GMT Resent-Message-Id: <201209171810.q8HIA4RU068844@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vitaly Magerya Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A2C8106564A for ; Mon, 17 Sep 2012 18:04:08 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1C5CA8FC16 for ; Mon, 17 Sep 2012 18:04:08 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q8HI47uS013403 for ; Mon, 17 Sep 2012 18:04:07 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q8HI47qV013402; Mon, 17 Sep 2012 18:04:07 GMT (envelope-from nobody) Message-Id: <201209171804.q8HI47qV013402@red.freebsd.org> Date: Mon, 17 Sep 2012 18:04:07 GMT From: Vitaly Magerya To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/171721: [patch] usb_quirk(4), ums(4): add UQ_UMS_IGNORE quirk X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 18:10:04 -0000 >Number: 171721 >Category: usb >Synopsis: [patch] usb_quirk(4), ums(4): add UQ_UMS_IGNORE quirk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Sep 17 18:10:04 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Vitaly Magerya >Release: >Organization: >Environment: >Description: It appears that we have USB quirks UQ_HID_IGNORE and UQ_KBD_IGNORE that make uhid(4) and ukbd(4) to ignore a perticular device. I propose adding UQ_UMS_IGNORE that instruct ums(4) to ignore a device. The motivation for this is hardware that lists a bogus Generic_Desktop:Mouse usage in it's record descriptor thus fooling ums(4) into thinking that it is a mouse, while in reality it is something other and should be handled by uhid(4) instead (I have a graphics tablet that does this). >How-To-Repeat: >Fix: I'm attaching a patch against head. Patch attached with submission follows: Index: share/man/man4/usb_quirk.4 =================================================================== --- share/man/man4/usb_quirk.4 (revision 240607) +++ share/man/man4/usb_quirk.4 (working copy) @@ -66,6 +66,8 @@ device should be ignored by kbd class .It UQ_KBD_BOOTPROTO device should set the boot protocol +.It UQ_UMS_IGNORE +device should be ignored by ums class .It UQ_MS_BAD_CLASS doesn't identify properly .It UQ_MS_LEADING_BYTE Index: sys/dev/usb/quirk/usb_quirk.c =================================================================== --- sys/dev/usb/quirk/usb_quirk.c (revision 240607) +++ sys/dev/usb/quirk/usb_quirk.c (working copy) @@ -494,6 +494,7 @@ [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", + [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Index: sys/dev/usb/quirk/usb_quirk.h =================================================================== --- sys/dev/usb/quirk/usb_quirk.h (revision 240607) +++ sys/dev/usb/quirk/usb_quirk.h (working copy) @@ -29,7 +29,7 @@ enum { /* - * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * Keep in sync with usb_quirk_str in usb_quirk.c, and with * share/man/man4/usb_quirk.4 */ UQ_NONE, /* not a valid quirk */ @@ -49,6 +49,7 @@ UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ + UQ_UMS_IGNORE, /* device should be ignored by ums class */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ Index: sys/dev/usb/input/ums.c =================================================================== --- sys/dev/usb/input/ums.c (revision 240607) +++ sys/dev/usb/input/ums.c (working copy) @@ -381,6 +381,9 @@ if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_UMS_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) return (BUS_PROBE_DEFAULT); >Release-Note: >Audit-Trail: >Unformatted: