Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] send-pr report attached



  I hope this is an acceptable format... thank you.

To: FreeBSD-gnats-submit@xxxxxxxxxxx
From: Lonnie Mendez <lmendez19@xxxxxxxxxxxxx>
Reply-To: lmendez19@xxxxxxxxxxxxx
Cc: 
X-send-pr-version: 3.113
X-GNATS-Notify: 


>Submitter-Id:	current-users
>Originator:	Lonnie Mendez
>Organization:	<organization of PR author (multiple lines)>
>Confidential:	no <FreeBSD PRs are public data>
>Synopsis:	[PATCH] Add quirk for uhid to ignore certain usb devices (blacklist)
>Severity:	non-critical
>Priority:	low
>Category:	kern
>Class:		change-request
>Release:	FreeBSD 5.3-RELEASE-p10 i386
>Environment:
System: FreeBSD twind.austin.rr.com 5.3-RELEASE-p10 FreeBSD 5.3-RELEASE-p10 #3: Tue Apr 26 07:46:25 CDT 2005 root@xxxxxxxxxxxxxxxxxxx:/usr/src/sys/i386/compile/MINIME i386


	<machine, os, target, libraries (multiple lines)>
>Description:

	This patch allows uhid to leave alone devices that identify themselves as hid based, but are indeed
used via another interface.  This is very simliar in concept to the hid blacklist table found in hid-core.c
in the linux kernel.
	<precise description of the problem (multiple lines)>
>How-To-Repeat:
	
	Applies to 5.3/FreeBSD-CURRENT kernel.  Runtime tested.
	<code/input/activities to reproduce the problem (multiple lines)>
>Fix:

	<how to correct or work around the problem, if known (multiple lines)>

--- hid_blacklist.patch begins here ---
diff -u -r ./uhid.c hidpatch/uhid.c
--- ./uhid.c	Tue Oct 12 19:51:01 2004
+++ hidpatch/uhid.c	Tue Apr 26 07:40:07 2005
@@ -91,6 +91,9 @@
 /* Report descriptor for broken Wacom Graphire */
 #include <dev/usb/ugraphire_rdesc.h>
 
+/* For hid blacklist quirk */
+#include <dev/usb/usb_quirks.h>
+
 #ifdef USB_DEBUG
 #define DPRINTF(x)	if (uhiddebug) logprintf x
 #define DPRINTFN(n,x)	if (uhiddebug>(n)) logprintf x
@@ -190,6 +193,8 @@
 		return (UMATCH_NONE);
 	id = usbd_get_interface_descriptor(uaa->iface);
 	if (id == NULL || id->bInterfaceClass != UICLASS_HID)
+		return (UMATCH_NONE);
+	if (usbd_get_quirks(uaa->device)->uq_flags & UQ_HID_IGNORE)
 		return (UMATCH_NONE);
 #if 0
 	if (uaa->matchlvl)
diff -u -r ./usb_quirks.c hidpatch/usb_quirks.c
--- ./usb_quirks.c	Mon Sep 20 00:18:04 2004
+++ hidpatch/usb_quirks.c	Tue Apr 26 03:24:12 2005
@@ -101,6 +101,9 @@
 	ANY, { UQ_ASSUME_CM_OVER_DATA }},
  { USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS64LX,
 	0x100, { UQ_ASSUME_CM_OVER_DATA }},
+ /* Devices which should be ignored by uhid */
+ { USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE,
+	ANY, { UQ_HID_IGNORE }},
  { 0, 0, 0, { 0 } }
 };
 
diff -u -r ./usb_quirks.h hidpatch/usb_quirks.h
--- ./usb_quirks.h	Thu Jul  5 05:12:59 2001
+++ hidpatch/usb_quirks.h	Tue Apr 26 07:41:18 2005
@@ -54,6 +54,7 @@
 #define UQ_AU_INP_ASYNC	0x0800	/* input is async despite claim of adaptive */
 #define UQ_ASSUME_CM_OVER_DATA 0x1000 /* modem device breaks on cm over data */
 #define UQ_BROKEN_BIDIR	0x2000	/* printer has broken bidir mode */
+#define UQ_HID_IGNORE   0x4000  /* device should be ignored by hid class */
 };
 
 extern const struct usbd_quirks usbd_no_quirk;
--- hid_blacklist.patch ends here ---