Date: Fri, 23 Dec 2005 03:10:05 GMT From: Florent Thoumie <flz@xbsd.org> To: freebsd-usb@FreeBSD.org Subject: Re: usb/90162 Message-ID: <200512230310.jBN3A5aQ032707@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/90162; it has been noted by GNATS. From: Florent Thoumie <flz@xbsd.org> To: bug-followup@freebsd.org, iedowse@freebsd.org Cc: Subject: Re: usb/90162 Date: Fri, 23 Dec 2005 04:06:53 +0100 --nextPart10775816.KSARUhMy5M Content-Type: multipart/mixed; boundary="Boundary-01=_Nn2qDy8KkpvDh3Z" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_Nn2qDy8KkpvDh3Z Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I've reworked your patch and the UMS_T quirk in ums_intr() but I'm still=20 experiencing problems, when I move the mouse it looks like my notebook is= =20 under heavy load (far from being smooth). Not sure where it comes from, do you have an idea Ian ? =2D-=20 =46lorent Thoumie flz@FreeBSD.org =46reeBSD Committer --Boundary-01=_Nn2qDy8KkpvDh3Z Content-Type: text/x-diff; charset="us-ascii"; name="ums.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ums.diff" =3D=3D=3D=3D //depot/user/flz/usb/src/sys/dev/usb/ums.c#1 - /disks/zero/Wor= k/perforce/flz_usb/src/sys/dev/usb/ums.c =3D=3D=3D=3D =2D-- /tmp/tmp.66593.0 Fri Dec 23 04:04:24 2005 +++ /disks/zero/Work/perforce/flz_usb/src/sys/dev/usb/ums.c Fri Dec 23 03:5= 3:29 2005 @@ -97,6 +97,7 @@ =20 struct ums_softc { device_t sc_dev; /* base device */ + usbd_device_handle sc_udev; /* USB device */ usbd_interface_handle sc_iface; /* interface */ usbd_pipe_handle sc_intrpipe; /* interrupt pipe */ int sc_ep_addr; @@ -189,7 +190,8 @@ return (UMATCH_NONE); =20 if (hid_is_collection(desc, size, =2D HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)) || + usbd_get_quirks(uaa->device)->uq_flags & UQ_MS_BAD_CLASS) ret =3D UMATCH_IFACECLASS; else ret =3D UMATCH_NONE; @@ -214,6 +216,7 @@ =20 sc->sc_disconnected =3D 1; sc->sc_iface =3D iface; + sc->sc_udev =3D uaa->device; id =3D usbd_get_interface_descriptor(iface); usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; @@ -324,6 +327,17 @@ sc->sc_disconnected =3D 0; free(desc, M_TEMP); =20 + if (usbd_get_quirks(uaa->device)->uq_flags & UQ_MS_BAD_CLASS) { + /* The offset is wrong for this mouse, correct it */ + sc->sc_loc_x.pos -=3D 40; + sc->sc_loc_y.pos -=3D 40; + + if (sc->flags & UMS_Z) + sc->sc_loc_z.pos -=3D 40; + for (i =3D 1; i <=3D sc->nbuttons; i++) + sc->sc_loc_btn[i-1].pos -=3D 40; + } + #ifdef USB_DEBUG DPRINTF(("ums_attach: sc=3D%p\n", sc)); DPRINTF(("ums_attach: X\t%d/%d\n", @@ -455,12 +469,10 @@ * at the same time it generates a left-click message on the button * byte which causes spurious left-click's where there shouldn't be. * This should sort that. =2D * Currently it's the only user of UMS_T so use it as an identifier. =2D * We probably should switch to some more official quirk. */ =2D if (sc->flags & UMS_T) { + if (usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_MS_LEADING_BYTE) { if (sc->sc_iid) { =2D if (*ibuf++ =3D=3D 0x02) + if (*ibuf++ =3D=3D 0x02 || *ibuf =3D=3D 0x15) return; } } else { =3D=3D=3D=3D //depot/user/flz/usb/src/sys/dev/usb/usb_quirks.c#1 - /disks/z= ero/Work/perforce/flz_usb/src/sys/dev/usb/usb_quirks.c =3D=3D=3D=3D =2D-- /tmp/tmp.66593.1 Fri Dec 23 04:04:24 2005 +++ /disks/zero/Work/perforce/flz_usb/src/sys/dev/usb/usb_quirks.c Fri Dec = 23 04:01:13 2005 @@ -82,6 +82,12 @@ { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPOD3G, ANY, { UQ_NO_OPEN_CLE= ARSTALL }}, { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPODNANO, ANY, { UQ_NO_OPEN_CL= EARSTALL }}, { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPODVIDEO, ANY, { UQ_NO_OPEN_CL= EARSTALL }}, + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK, + ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK2, + ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, + { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, + ANY, { UQ_MS_LEADING_BYTE }}, /* XXX These should have a revision number, but I don't know what they ar= e. */ { USB_VENDOR_HP, USB_PRODUCT_HP_895C, ANY, { UQ_BROKEN_BIDIR }}, { USB_VENDOR_HP, USB_PRODUCT_HP_880C, ANY, { UQ_BROKEN_BIDIR }}, =3D=3D=3D=3D //depot/user/flz/usb/src/sys/dev/usb/usb_quirks.h#1 - /disks/z= ero/Work/perforce/flz_usb/src/sys/dev/usb/usb_quirks.h =3D=3D=3D=3D =2D-- /tmp/tmp.66593.2 Fri Dec 23 04:04:24 2005 +++ /disks/zero/Work/perforce/flz_usb/src/sys/dev/usb/usb_quirks.h Fri Dec = 23 04:04:13 2005 @@ -56,7 +56,8 @@ #define UQ_BROKEN_BIDIR 0x2000 /* printer has broken bidir mode */ #define UQ_NO_OPEN_CLEARSTALL 0x4000 /* don't usbd_clear_endpoint_stall() = */ /* in usbd_setup_pipe() */ =2D =09 +#define UQ_MS_BAD_CLASS 0x8000 /* doesn't identify properly */ +#define UQ_MS_LEADING_BYTE 0x00010000 /* mouse sends an unknown leading by= te */ }; =20 extern const struct usbd_quirks usbd_no_quirk; =3D=3D=3D=3D //depot/user/flz/usb/src/sys/dev/usb/usbdevs#1 - /disks/zero/W= ork/perforce/flz_usb/src/sys/dev/usb/usbdevs =3D=3D=3D=3D =2D-- /tmp/tmp.66593.3 Fri Dec 23 04:04:24 2005 +++ /disks/zero/Work/perforce/flz_usb/src/sys/dev/usb/usbdevs Fri Dec 23 03= :58:33 2005 @@ -1174,6 +1174,9 @@ product MICROSOFT INTELLIEYE 0x0025 IntelliEye mouse product MICROSOFT INETPRO2 0x002b Internet Keyboard Pro product MICROSOFT MN110 0x007a 10/100 USB NIC +product MICROSOFT WLINTELLIMOUSE 0x008c Wireless Optical IntelliMouse +product MICROSOFT WLNOTEBOOK 0x00b9 Wireless Notebook Optical Mouse +product MICROSOFT WLNOTEBOOK2 0x00e1 Wireless Notebook Optical Mouse =20 /* Microtech products */ product MICROTECH SCSIDB25 0x0004 USB-SCSI-DB25 --Boundary-01=_Nn2qDy8KkpvDh3Z-- --nextPart10775816.KSARUhMy5M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBDq2nTMxEkbVFH3PQRAhQdAJ9Y0h5GO8SPaGn/vV7T6SQCrPok/QCfQfaB d9SeJfd45yrdDPKKGE5VSFI= =yyvI -----END PGP SIGNATURE----- --nextPart10775816.KSARUhMy5M--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512230310.jBN3A5aQ032707>