2005-02-07 17:51:52

by Mikkel Krautz

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

Are you talking about the following line?

+ else
+ hid_mousepoll_interval = interval;

If so, I put it there, to fill a tiny gap, i felt was missing.

If no parameter is passed, hid_mousepoll_interval is obviously 0.

If a user, who doesn't pass the parameter to usbhid, reads
'/sys/module/usbhid/parameters/mousepoll', the answer would be "0",
which is incorrect, no?

Thanks,
Mikkel

On Mon, 7 Feb 2005 18:43:03 +0100, Vojtech Pavlik <[email protected]> wrote:
> On Mon, Feb 07, 2005 at 04:44:24PM +0100, Mikkel Krautz wrote:
> > And, here's an updated version of hid-core.c:
> >
> > Signed-off-by: Mikkel Krautz <[email protected]>
> > ---
> > --- 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,12 @@
> > 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;
> > + else
> > + hid_mousepoll_interval = interval;
>
> This line is trying to achieve what?
>
> > +
> > if (endpoint->bEndpointAddress & USB_DIR_IN) {
> > if (hid->urbin)
> > continue;
> >
> >
>
> --
> Vojtech Pavlik
> SuSE Labs, SuSE CR
>


2005-02-07 17:57:12

by Mikkel Krautz

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

Sorry, I now realise that my way of doing this only sets
hid_mousepoll_interval to the latest-plugged-in mouse's polling
interval.

How should I handle this? Just remove the line, and keep the "0 feature"?

Thanks,
Mikkel


On Mon, 7 Feb 2005 18:51:46 +0100, Mikkel Krautz <[email protected]> wrote:
> Are you talking about the following line?
>
> + else
> + hid_mousepoll_interval = interval;
>
> If so, I put it there, to fill a tiny gap, i felt was missing.
>
> If no parameter is passed, hid_mousepoll_interval is obviously 0.
>
> If a user, who doesn't pass the parameter to usbhid, reads
> '/sys/module/usbhid/parameters/mousepoll', the answer would be "0",
> which is incorrect, no?
>
> Thanks,
> Mikkel
>
> On Mon, 7 Feb 2005 18:43:03 +0100, Vojtech Pavlik <[email protected]> wrote:
> > On Mon, Feb 07, 2005 at 04:44:24PM +0100, Mikkel Krautz wrote:
> > > And, here's an updated version of hid-core.c:
> > >
> > > Signed-off-by: Mikkel Krautz <[email protected]>
> > > ---
> > > --- 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,12 @@
> > > 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;
> > > + else
> > > + hid_mousepoll_interval = interval;
> >
> > This line is trying to achieve what?
> >
> > > +
> > > if (endpoint->bEndpointAddress & USB_DIR_IN) {
> > > if (hid->urbin)
> > > continue;
> > >
> > >
> >
> > --
> > Vojtech Pavlik
> > SuSE Labs, SuSE CR
> >
>