Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2007 18:10:02 GMT
From:      Jase Thew <bazerka@beardz.net>
To:        freebsd-usb@FreeBSD.org
Subject:   Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard
Message-ID:  <200712281810.lBSIA2Xc020796@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: Jase Thew <bazerka@beardz.net>
To: bug-followup@FreeBSD.org, Uwe@Grohnwaldt.eu, Warner Losh <imp@FreeBSD.org>
Cc:  
Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard
Date: Fri, 28 Dec 2007 17:39:53 +0000

 This is a multi-part message in MIME format.
 --------------090006030803070408040407
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 The Razer Copperhead is a compound device having both a mouse and
 programmable keyboard component (so that mouse buttons can be
 programmed to emulate keypresses), hence it previously attaching to both
 ums and ukbd.
 
 The problem with it no longer attaching to ums is due to changes made in
 ums.c version 1.94 - specifically (snippet taken from ums.c v1.97) :
 
 201:        if (id->bInterfaceClass == UICLASS_HID &&
 202:            id->bInterfaceSubClass == UISUBCLASS_BOOT &&
 203:            id->bInterfaceProtocol == UIPROTO_MOUSE)
 204:                ret = UMATCH_IFACECLASS;
 205:        else
 206:                ret = UMATCH_NONE;
 
 As the mouse device is Class 3 (HID), SubClass 0 (No SubClass), Protocol 
 2 (Mouse), it fails to match and hence will not attach.
 
 The attached patch, which applies against ums.c v1.97, changes the check 
 to match either SubClass 0 (No SubClass) or SubClass 1 (Boot device) and 
 defines the appropriate identifier in usb.h .
 
 After applying the patch, the mouse attaches successfully and works 
 correctly. This shouldn't affect any mice that use the Boot subclass - 
 it will just allow mice that have no subclass to work correctly.
 
 I would love to see this committed before 7.0-RELEASE is cut, but I 
 understand if it's not, as it is rather late in the testing cycle.
 
 
 
 --------------090006030803070408040407
 Content-Type: text/plain;
  name="patch-1.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-1.diff"
 
 --- sys/dev/usb/ums.c.orig	2007-12-28 17:07:33.000000000 +0000
 +++ sys/dev/usb/ums.c	2007-12-28 17:09:19.000000000 +0000
 @@ -198,7 +198,8 @@
  		return (UMATCH_NONE);
  
  	if (id->bInterfaceClass == UICLASS_HID &&
 -	    id->bInterfaceSubClass == UISUBCLASS_BOOT &&
 +	    (id->bInterfaceSubClass == UISUBCLASS_NONE ||
 +	    id->bInterfaceSubClass == UISUBCLASS_BOOT) &&
  	    id->bInterfaceProtocol == UIPROTO_MOUSE)
  		ret = UMATCH_IFACECLASS;
  	else
 --- sys/dev/usb/usb.h.orig	2007-12-28 17:09:26.000000000 +0000
 +++ sys/dev/usb/usb.h	2007-12-28 17:10:05.000000000 +0000
 @@ -433,6 +433,7 @@
  #define   UIPROTO_CDC_AT			1
  
  #define UICLASS_HID		0x03
 +#define  UISUBCLASS_NONE	0
  #define  UISUBCLASS_BOOT	1
  #define  UIPROTO_BOOT_KEYBOARD	1
  #define  UIPROTO_MOUSE		2
 
 --------------090006030803070408040407--



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