Microsoft Wireless Notebook Presenter Mouse (patch)

Nathan Lay nslay at comcast.net
Sun Jun 3 03:37:02 UTC 2007


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

-------------- next part --------------
*** 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) {
-------------- next part --------------
*** 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 */


More information about the freebsd-drivers mailing list