Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
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, >usage[n], value[n]); > continue; > } Thanks for the detailed report. Here is the fix. Alan, please apply this to -ac5. -- Vojtech Pavlik SuSE Labs 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.cFri 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, >usage[n], value[n]); continue;
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On Fri, Jun 01, 2001 at 05:32:26PM -0400, Robert M. Love wrote: > USB mouse wheel has been broke since 2.4.5-ac4 (when new USB HID, > hid-core.c, was integrated). The mouse in general seems jerky, and > specifically the input device does not receive events for consecutive > wheel movements -- just the first "spin," until the mouse is moved > again. > > obviously the bug is in the new hid-core.c, but I confirmed this by > compiling with that part of the ac6 patch removed. I have since been > trying to write a patch but I can not fix the problem, so I am reporting > it to you. > > I and another user thought the problem was in hid_input_field, but upon > looking I now think not. > > My mouse is fairly unusable in X, and unfortunately I can not figure out > a fix. It is a quite stupid bug. Here is the fix (already sent to Alan). -- Vojtech Pavlik SuSE Labs 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.cFri 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, >usage[n], value[n]); continue;
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On Fri, Jun 01, 2001 at 05:32:26PM -0400, Robert M. Love wrote: USB mouse wheel has been broke since 2.4.5-ac4 (when new USB HID, hid-core.c, was integrated). The mouse in general seems jerky, and specifically the input device does not receive events for consecutive wheel movements -- just the first spin, until the mouse is moved again. obviously the bug is in the new hid-core.c, but I confirmed this by compiling with that part of the ac6 patch removed. I have since been trying to write a patch but I can not fix the problem, so I am reporting it to you. I and another user thought the problem was in hid_input_field, but upon looking I now think not. My mouse is fairly unusable in X, and unfortunately I can not figure out a fix. It is a quite stupid bug. Here is the fix (already sent to Alan). -- Vojtech Pavlik SuSE Labs 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.cFri 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;
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
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 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.cFri 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;
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On Fri, Jun 01, 2001 at 05:32:26PM -0400, Robert M. Love wrote: > I and another user thought the problem was in hid_input_field, but upon > looking I now think not. It is, check against hid.c in 2.4.5, the new code &&'s the first 2 if statements and so it now checks non-zero HID_MAIN_INPUT_RELATIVE values for new and old being the same, which AFAICT, they can and often will be. Patch against ac6 reverts back to original hid.c check :- --- ../linux.orig/drivers/usb/hid-core.cSat Jun 2 21:47:35 2001 +++ drivers/usb/hid-core.c Sat Jun 2 21:46:00 2001 @@ -773,10 +773,11 @@ if (HID_MAIN_ITEM_VARIABLE & field->flags) { - if ((field->flags & HID_MAIN_ITEM_RELATIVE) && !value[n]) - continue; - if (value[n] == field->value[n]) - continue; + if (field->flags & HID_MAIN_ITEM_RELATIVE) { + if (!value[n]) continue; + } else { + if (value[n] == field->value[n]) continue; + } hid_process_event(hid, field, >usage[n], value[n]); continue; } -- Michael. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On Fri, Jun 01, 2001 at 05:32:26PM -0400, Robert M. Love wrote: I and another user thought the problem was in hid_input_field, but upon looking I now think not. It is, check against hid.c in 2.4.5, the new code 's the first 2 if statements and so it now checks non-zero HID_MAIN_INPUT_RELATIVE values for new and old being the same, which AFAICT, they can and often will be. Patch against ac6 reverts back to original hid.c check :- --- ../linux.orig/drivers/usb/hid-core.cSat Jun 2 21:47:35 2001 +++ drivers/usb/hid-core.c Sat Jun 2 21:46:00 2001 @@ -773,10 +773,11 @@ if (HID_MAIN_ITEM_VARIABLE field-flags) { - if ((field-flags HID_MAIN_ITEM_RELATIVE) !value[n]) - continue; - if (value[n] == field-value[n]) - continue; + if (field-flags HID_MAIN_ITEM_RELATIVE) { + if (!value[n]) continue; + } else { + if (value[n] == field-value[n]) continue; + } hid_process_event(hid, field, field-usage[n], value[n]); continue; } -- Michael. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
USB mouse wheel has been broke since 2.4.5-ac4 (when new USB HID, hid-core.c, was integrated). The mouse in general seems jerky, and specifically the input device does not receive events for consecutive wheel movements -- just the first "spin," until the mouse is moved again. obviously the bug is in the new hid-core.c, but I confirmed this by compiling with that part of the ac6 patch removed. I have since been trying to write a patch but I can not fix the problem, so I am reporting it to you. I and another user thought the problem was in hid_input_field, but upon looking I now think not. My mouse is fairly unusable in X, and unfortunately I can not figure out a fix. -- Robert M. Love [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On 01 Jun 2001 10:57:17 +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 ive noticed the same problem -- mouse movement itself is even jerky, so i suspect events are being lost. the mouse is not really even usable for me in X. i too traced the problem down to hid-core.c, i think, and i am going to try to write up a patch against the latest ac, but the Maintainer may already realize the problem? -- Robert M. Love [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
On 01 Jun 2001 10:57:17 +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 ive noticed the same problem -- mouse movement itself is even jerky, so i suspect events are being lost. the mouse is not really even usable for me in X. i too traced the problem down to hid-core.c, i think, and i am going to try to write up a patch against the latest ac, but the Maintainer may already realize the problem? -- Robert M. Love [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: USB mouse wheel breakage was Re: Linux 2.4.5-ac5
USB mouse wheel has been broke since 2.4.5-ac4 (when new USB HID, hid-core.c, was integrated). The mouse in general seems jerky, and specifically the input device does not receive events for consecutive wheel movements -- just the first spin, until the mouse is moved again. obviously the bug is in the new hid-core.c, but I confirmed this by compiling with that part of the ac6 patch removed. I have since been trying to write a patch but I can not fix the problem, so I am reporting it to you. I and another user thought the problem was in hid_input_field, but upon looking I now think not. My mouse is fairly unusable in X, and unfortunately I can not figure out a fix. -- Robert M. Love [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/