Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5

Vojtech Pavlik (vojtech@suse.cz)
Fri, 1 Jun 2001 16:31:10 +0200


--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Jun 01, 2001 at 10:57:17AM +0100, Michael wrote:

> On Wed, May 30, 2001 at 09:30:39PM +0100, Alan Cox wrote:
> > 2.4.5-ac4
> > o Update USB hid drivers (Vojtech Pavlik)
>
> I think these changes have broken my USB wheel mouse.
>
> Events seems to be getting lost (/dev/input/mice)
>
> It only scrolls when either the scroll direction has changed or if other
> mouse events occur (e.g. you need to wiggle mouse from side to side to
> scroll down a long page in mozilla)
>
> problems seems to be in drivers/usb/hid-core.c hid_input_field line 772
>
> for (n = 0; n < count; n++) {
>
> if (HID_MAIN_ITEM_VARIABLE & field->flags) {
>
> if ((field->flags & HID_MAIN_ITEM_RELATIVE) && !value[n])
> continue;
> The next 2 lines are dropping the scroll wheel events (which appear in the
> input code as type:2, code: 8, value -1 or 1 depending on direction)
>
> if (value[n] == field->value[n])
> continue;
> hid_process_event(hid, field, &field->usage[n], value[n]);
> continue;
> }

Thanks for the detailed report.
Here is the fix.

Alan, please apply this to -ac5.

-- 
Vojtech Pavlik
SuSE Labs

--Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hid.fix.diff"

diff -urN linux-2.4.5-ac4/drivers/usb/hid-core.c linux/drivers/usb/hid-core.c --- linux-2.4.5-ac4/drivers/usb/hid-core.c Tue May 29 19:48:15 2001 +++ linux/drivers/usb/hid-core.c Fri Jun 1 16:30:33 2001 @@ -775,7 +775,7 @@ if ((field->flags & HID_MAIN_ITEM_RELATIVE) && !value[n]) continue; - if (value[n] == field->value[n]) + if ((~field->flags & HID_MAIN_ITEM_RELATIVE) && value[n] == field->value[n]) continue; hid_process_event(hid, field, &field->usage[n], value[n]); continue;

--Kj7319i9nmIyA2yE-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/