[PATCH] send-pr report attached

Lonnie Mendez <[email protected]>
Newsgroups gmane.os.freebsd.bugbusters
Message-ID <[email protected]>
  I hope this is an acceptable format... thank you.

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugbusters
To unsubscribe, send any mail to "[email protected]"
hidquirk (text/x-diff, 3 KB)
To: [email protected]
From: Lonnie Mendez <[email protected]>
Reply-To: [email protected]
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 [email protected]:/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 ---
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.