Fix for Logitech DiNovo cordless mouse
Jin Guojun [DSD]
g_jin at lbl.gov
Wed Jun 9 19:04:57 GMT 2004
Markus Wild wrote:
> Since yesterday I'm a happy owner of a Logitech dinovo
> cordless USB keyboard/mouse. The keyboard works fine, however
> the mouse didn't move a bit. I saw that other people had similar
> "luck", so I enabled a bit of debugging. This is with FreeBSD-current,
> btw.
>
> ... (skipped)
>
> With this, my current fix is simple: only set id if it's not
> set already:
> diff -u -r1.23 hid.c
> --- hid.c 24 Aug 2003 17:55:54 -0000 1.23
> +++ hid.c 9 Jun 2004 18:34:23 -0000
> @@ -374,9 +374,10 @@
> int size, id;
>
> id = 0;
> + bzero (&h, sizeof (h));
> for (d = hid_start_parse(buf, len, 1<<k); hid_get_item(d, &h); )
> - if (h.report_ID != 0)
> - id = h.report_ID;
> + if (h.report_ID != 0 && !id)
> + id = h.report_ID;
> hid_end_parse(d);
> size = h.loc.pos;
> if (id != 0) {
>
> I don't know whether this is any more correct or buggy than the
> previous version, and I don't know whether it will break currently
> working configurations, but it did get mine working. If your mouse
> is currently of not much use, you might give it a try.
By looking the code, the fix should be something like in attachment.
Since I have not such device, I cannot test it.
Let me know if attached patch works.
-Jin
-------------- next part --------------
*** dev/usb/hid.c Sun Feb 29 16:07:21 2004
--- hid.c Wed Jun 9 12:00:38 2004
***************
*** 364,369 ****
--- 364,370 ----
break;
}
}
+ return 0;
}
int
***************
*** 374,380 ****
int size, id;
id = 0;
! for (d = hid_start_parse(buf, len, 1<<k); hid_get_item(d, &h); )
if (h.report_ID != 0)
id = h.report_ID;
hid_end_parse(d);
--- 375,381 ----
int size, id;
id = 0;
! for (d = hid_start_parse(buf, len, 1<<k); !id && hid_get_item(d, &h); )
if (h.report_ID != 0)
id = h.report_ID;
hid_end_parse(d);
More information about the freebsd-hardware
mailing list