Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Jun 2007 23:25:03 -0400
From:      Nathan Lay <nslay@comcast.net>
To:        freebsd-drivers@freebsd.org
Subject:   Microsoft Wireless Notebook Presenter Mouse (patch)
Message-ID:  <4662348F.4060306@comcast.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040503000102060204010206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everyone,
I got this wireless mouse for free from a friend and noticed it didn't 
work with ums.
The mouse uses a bluetooth dongle, but the dongle can also impersonate a 
USB hub with the mouse plugged in, however the mouse's usage flags are 
HUP_CONSUMER and HUG_POINTER instead of the usage flags ums expects 
HUP_GENERIC_DESKTOP and HUG_MOUSE.  The mouse also lies about the bit 
positions of the X, Y, Z, T and 5 buttons, and the size of the ibuf.
I created a patch for sys/dev/usb/ums.c and sys/dev/usb/usbdevs
Anyway I can make this patch better?

cd /usr/src
patch < /path/to/ums.c.patch
patch < /path/to/usbdevs.patch

Best Regards,
Nathan Lay


--------------040503000102060204010206
Content-Type: text/plain;
 name="ums.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ums.c.patch"

*** sys/dev/usb/ums.c	Mon Feb  6 15:29:17 2006
--- /root/ums.c	Sat Jun  2 22:41:10 2007
***************
*** 195,198 ****
--- 195,204 ----
  		ret = UMATCH_NONE;
  
+ 	/* Odd usage flags in Presenter mice! */
+ 	if (hid_is_collection(desc, size, HID_USAGE2(HUP_CONSUMER, HUG_POINTER)))
+ 		ret = UMATCH_IFACECLASS;
+ 	else
+ 		ret = UMATCH_NONE;
+ 
  	free(desc, M_TEMP);
  	return (ret);
***************
*** 313,317 ****
--- 319,342 ----
  				hid_input, &sc->sc_loc_btn[i-1], 0);
  
+ 
  	sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
+ 
+ 	/* Mouse quirks, add here! */
+ 	switch ( uaa->product ) {
+ 	case USB_PRODUCT_MICROSOFT_PRESENTER:
+ 		/* This mouse lies about its buttons and x,y,z positions			 * Offset by 16 instead of 8 because of UMS_T *ibuff++ thingy
+ 		 */ 
+ 		/* XXX Not sure if UMS_T is on all Presenter mice! */
+ 		sc->sc_loc_x.pos -= 16;
+ 		sc->sc_loc_y.pos -= 16;
+ 		sc->sc_loc_z.pos -= 16;
+ 		sc->sc_loc_t.pos -= 16;
+ 		for (i = 1; i <= sc->nbuttons; i++ ) sc->sc_loc_btn[i-1].pos -= 16;
+ 		/* This mouse also lies about the size! */
+ 		sc->sc_isize = 6;
+ 		break;
+ 	}
+ 
+ 
  	sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT);
  	if (!sc->sc_ibuf) {

--------------040503000102060204010206
Content-Type: text/plain;
 name="usbdevs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="usbdevs.patch"

*** sys/dev/usb/usbdevs	Tue Nov 14 07:54:38 2006
--- /root/usbdevs	Sat Jun  2 22:48:52 2007
***************
*** 1250,1253 ****
--- 1250,1254 ----
  product MICROSOFT INETPRO2	0x002b	Internet Keyboard Pro
  product MICROSOFT MN110		0x007a	10/100 USB NIC
+ product MICROSOFT PRESENTER	0x0713	Microsoft Wireless Presenter Mouse
  
  /* Microtech products */

--------------040503000102060204010206--



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