From owner-freebsd-stable@FreeBSD.ORG Mon Jun 13 14:49:34 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48AE216A41C for ; Mon, 13 Jun 2005 14:49:34 +0000 (GMT) (envelope-from vanco@satro.sk) Received: from mail.satronet.sk (mail.satronet.sk [217.144.16.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id B205E43D49 for ; Mon, 13 Jun 2005 14:49:33 +0000 (GMT) (envelope-from vanco@satro.sk) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.satronet.sk (Postfix) with ESMTP id 61EA21605BD6E for ; Mon, 13 Jun 2005 16:49:32 +0200 (CEST) Received: from mail.satronet.sk ([127.0.0.1]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18667-01-12 for ; Mon, 13 Jun 2005 16:49:31 +0200 (CEST) Received: from [147.175.51.163] (unknown [147.175.51.163]) by mail.satronet.sk (Postfix) with ESMTP id 515251605BD79 for ; Mon, 13 Jun 2005 16:49:31 +0200 (CEST) Message-ID: <42AD9CFF.2080308@satro.sk> Date: Mon, 13 Jun 2005 16:49:35 +0200 From: Michal Vanco User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050610) X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: freebsd-stable@freebsd.org References: <42AD7AEA.3010006@satro.sk> In-Reply-To: <42AD7AEA.3010006@satro.sk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by ANTIvirus at satronet.sk Subject: Re: MS USB Wireless Mouse X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2005 14:49:34 -0000 Michal Vanco wrote: > ... seems like reported locations X,Y,Z and buttons are wrong. > well ... this works. but i'm not sure for other mices diff -Nrua usb/ums.c /sys/dev/usb/ums.c --- usb/ums.c Sun Jan 30 02:00:10 2005 +++ /sys/dev/usb/ums.c Mon Jun 13 16:24:50 2005 @@ -76,6 +76,7 @@ #include #endif + #ifdef USB_DEBUG #define DPRINTF(x) if (umsdebug) logprintf x #define DPRINTFN(n,x) if (umsdebug>(n)) logprintf x @@ -287,6 +288,9 @@ if (hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_TWHEEL), hid_input, &sc->sc_loc_t, &flags)) { sc->sc_loc_t.pos = sc->sc_loc_t.pos + 8; + sc->sc_loc_x.pos = sc->sc_loc_x.pos - 40; + sc->sc_loc_y.pos = sc->sc_loc_y.pos - 40; + sc->sc_loc_z.pos = sc->sc_loc_z.pos - 40; sc->flags |= UMS_T; } @@ -307,9 +311,12 @@ sc->nbuttons, sc->flags & UMS_Z? " and Z dir" : "", sc->flags & UMS_T?" and a TILT dir": ""); - for (i = 1; i <= sc->nbuttons; i++) + for (i = 1; i <= sc->nbuttons; i++) { hid_locate(desc, size, HID_USAGE2(HUP_BUTTON, i), hid_input, &sc->sc_loc_btn[i-1], 0); + if (sc->flags & UMS_T) + sc->sc_loc_btn[i - 1].pos -= 40; + } sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid); sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT); @@ -458,8 +465,9 @@ */ if (sc->flags & UMS_T) { if (sc->sc_iid) { - if (*ibuf++ == 0x02) - return; + ibuf++; + if (*(ibuf - 1) == 0x02 || *(ibuf - 1) == 0x14) + return; } } else { if (sc->sc_iid) {