Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2008 22:00:03 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-usb@FreeBSD.org
Subject:   Re: usb/118670: [ums] [patch] Razer Copperhead Laser Mouse shows up as keyboard
Message-ID:  <200802272200.m1RM03tS058913@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/118670; it has been noted by GNATS.

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org, Uwe@grohnwaldt.eu
Cc: imp@freebsd.org
Subject: Re: usb/118670: [ums] [patch] Razer Copperhead Laser Mouse shows up as keyboard
Date: Wed, 27 Feb 2008 16:41:13 -0500

 According to the USB spec, the protocol field is only defined if the subclass 
 is 1.  So a subclass of 0 is really a violation of the spec.  I think a 
 better fix is to put back the old hid_is_collection() test first and then 
 directly check the descriptor if that fails:
 
 Index: ums.c
 ===================================================================
 RCS file: /usr/cvs/src/sys/dev/usb/ums.c,v
 retrieving revision 1.97
 diff -u -r1.97 ums.c
 --- ums.c	26 Dec 2007 14:31:16 -0000	1.97
 +++ ums.c	27 Feb 2008 21:40:48 -0000
 @@ -198,7 +198,10 @@
  	if (err)
  		return (UMATCH_NONE);
  
 -	if (id->bInterfaceClass == UICLASS_HID &&
 +	if (hid_is_collection(desc, size,
 +			      HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
 +		ret = UMATCH_IFACECLASS;
 +	else if (id->bInterfaceClass == UICLASS_HID &&
  	    id->bInterfaceSubClass == UISUBCLASS_BOOT &&
  	    id->bInterfaceProtocol == UIPROTO_MOUSE)
  		ret = UMATCH_IFACECLASS;
 
 -- 
 John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802272200.m1RM03tS058913>