2005-02-07 18:54:31

by Mikkel Krautz

[permalink] [raw]
Subject: Re: [PATCH] hid-core: Configurable USB HID Mouse Interrupt Polling Interval

This includes the kernel-parameters.txt-patch, and the hid-core.c-patch, without the extra else-statement.

Thanks,
Mikkel

Signed-off-by: Mikkel Krautz <[email protected]>
---
--- clean/Documentation/kernel-parameters.txt
+++ dirty/Documentation/kernel-parameters.txt
@@ -73,6 +73,7 @@
SWSUSP Software suspension is enabled.
TS Appropriate touchscreen support is enabled.
USB USB support is enabled.
+ USBHID USB Human Interface Device support is enabled.
V4L Video For Linux support is enabled.
VGA The VGA console has been enabled.
VT Virtual terminal support is enabled.
@@ -1393,6 +1394,9 @@
Format: <io>,<irq>

usb-handoff [HW] Enable early USB BIOS -> OS handoff
+
+ usbhid.mousepoll=
+ [USBHID] The interval which mice are to be polled at.

video= [FB] Frame buffer configuration
See Documentation/fb/modedb.txt.
--- clean/drivers/usb/input/hid-core.c
+++ dirty/drivers/usb/input/hid-core.c
@@ -37,13 +37,20 @@
* Version Information
*/

-#define DRIVER_VERSION "v2.0"
+#define DRIVER_VERSION "v2.01"
#define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik"
#define DRIVER_DESC "USB HID core driver"
#define DRIVER_LICENSE "GPL"

static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick",
"Gamepad", "Keyboard", "Keypad", "Multi-Axis Controller"};
+/*
+ * Module parameters.
+ */
+
+static unsigned int hid_mousepoll_interval;
+module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
+MODULE_PARM_DESC(mousepoll, "Polling interval of mice");

/*
* Register a new report for a device.
@@ -1695,6 +1702,10 @@
if (dev->speed == USB_SPEED_HIGH)
interval = 1 << (interval - 1);

+ /* Change the polling interval of mice. */
+ if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0)
+ interval = hid_mousepoll_interval;
+
if (endpoint->bEndpointAddress & USB_DIR_IN) {
if (hid->urbin)
continue;



2005-02-08 15:16:18

by zyphr

[permalink] [raw]
Subject: Re: [PATCH] hid-core: Configurable USB HID Mouse Interrupt Polling Interval

Something looks odd.
I've tested this with 2.6.11-rc3-bk5 + your lasted patch

cat /sys/module/usbhid/parameters/mousepoll says it's at 2ms
but if I check /proc/bus/usb/devices it's reading 10ms

I've used parameter under /etc/modules (debian sarge)
in there I have added: usbhid mousepoll=2

this used to work ok with:
http://omfg.linux.dk/pub/configurable-hid-mouse-polling/archive/chmp-r5-add-modparam.patch

rmmod usbhid and then "modprobe usbhid mousepoll=x" with a different value,
does change the vualue under /sys
but under /proc/bus/usb/devices it keeps reading the same value (10ms)
I also tried replugging the mouse, the value's stay the same.

I am just a just user, so maybe I did something wrong =)

Thanks,

Joep

On Mon, 7 Feb 2005 19:57:06 +0100, Mikkel Krautz <[email protected]> wrote:
> This includes the kernel-parameters.txt-patch, and the hid-core.c-patch, without the extra else-statement.
>
> Thanks,
> Mikkel
>
> Signed-off-by: Mikkel Krautz <[email protected]>
> ---
> --- clean/Documentation/kernel-parameters.txt
> +++ dirty/Documentation/kernel-parameters.txt
> @@ -73,6 +73,7 @@
> SWSUSP Software suspension is enabled.
> TS Appropriate touchscreen support is enabled.
> USB USB support is enabled.
> + USBHID USB Human Interface Device support is enabled.
> V4L Video For Linux support is enabled.
> VGA The VGA console has been enabled.
> VT Virtual terminal support is enabled.
> @@ -1393,6 +1394,9 @@
> Format: <io>,<irq>
>
> usb-handoff [HW] Enable early USB BIOS -> OS handoff
> +
> + usbhid.mousepoll=
> + [USBHID] The interval which mice are to be polled at.
>
> video= [FB] Frame buffer configuration
> See Documentation/fb/modedb.txt.
> --- clean/drivers/usb/input/hid-core.c
> +++ dirty/drivers/usb/input/hid-core.c
> @@ -37,13 +37,20 @@
> * Version Information
> */
>
> -#define DRIVER_VERSION "v2.0"
> +#define DRIVER_VERSION "v2.01"
> #define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik"
> #define DRIVER_DESC "USB HID core driver"
> #define DRIVER_LICENSE "GPL"
>
> static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick",
> "Gamepad", "Keyboard", "Keypad", "Multi-Axis Controller"};
> +/*
> + * Module parameters.
> + */
> +
> +static unsigned int hid_mousepoll_interval;
> +module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
> +MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
>
> /*
> * Register a new report for a device.
> @@ -1695,6 +1702,10 @@
> if (dev->speed == USB_SPEED_HIGH)
> interval = 1 << (interval - 1);
>
> + /* Change the polling interval of mice. */
> + if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0)
> + interval = hid_mousepoll_interval;
> +
> if (endpoint->bEndpointAddress & USB_DIR_IN) {
> if (hid->urbin)
> continue;
>
> -
> 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/
>


Attachments:
(No filename) (3.33 kB)
dmesg_2.6.11-rc3-bk5.txt (11.50 kB)
proc.bus.usb.devices.txt (1.86 kB)
Download all attachments

2005-02-08 16:02:40

by Oliver Neukum

[permalink] [raw]
Subject: Re: [PATCH] hid-core: Configurable USB HID Mouse Interrupt Polling Interval

Am Dienstag, 8. Februar 2005 16:15 schrieb zyphr:
> Something looks odd.
> I've tested this with 2.6.11-rc3-bk5 + your lasted patch
>
> cat /sys/module/usbhid/parameters/mousepoll says it's at 2ms
> but if I check /proc/bus/usb/devices it's reading 10ms

You're reading the device descriptor. It is unchangeable.
Using the module parameter you can make the driver ignore
the value specified in the descriptor, not change the descriptor.

Regards
Oliver

2005-02-08 16:08:32

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH] hid-core: Configurable USB HID Mouse Interrupt Polling Interval

On Tue, Feb 08, 2005 at 04:15:53PM +0100, zyphr wrote:
> Something looks odd.
> I've tested this with 2.6.11-rc3-bk5 + your lasted patch
>
> cat /sys/module/usbhid/parameters/mousepoll says it's at 2ms
> but if I check /proc/bus/usb/devices it's reading 10ms
>
> I've used parameter under /etc/modules (debian sarge)
> in there I have added: usbhid mousepoll=2
>
> this used to work ok with:
> http://omfg.linux.dk/pub/configurable-hid-mouse-polling/archive/chmp-r5-add-modparam.patch
>
> rmmod usbhid and then "modprobe usbhid mousepoll=x" with a different value,
> does change the vualue under /sys
> but under /proc/bus/usb/devices it keeps reading the same value (10ms)
> I also tried replugging the mouse, the value's stay the same.
>
> I am just a just user, so maybe I did something wrong =)

This is correct. The new patch is not modifying the device descriptors,
which should be considered read-only by driver code, it only changes
only the actual polling behavior.

--
Vojtech Pavlik
SuSE Labs, SuSE CR