<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/input, branch v2.6.14</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>[PATCH] USB: fix bug in handling of highspeed usb HID devices</title>
<updated>2005-10-17T21:45:49+00:00</updated>
<author>
<name>Christian Krause</name>
<email>chkr@plauener.de</email>
</author>
<published>2005-10-17T21:30:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=13b58ee51802a45d2b8853ffe0003d9fa768195c'/>
<id>13b58ee51802a45d2b8853ffe0003d9fa768195c</id>
<content type='text'>
During the development of an USB device I found a bug in the handling of
Highspeed HID devices in the kernel.

What happened?

Highspeed HID devices are correctly recognized and enumerated by the
kernel. But even if usbhid kernel module is loaded, no HID reports are
received by the kernel.

The output of the hardware USB analyzer told me that the host doesn't
even poll for interrupt IN transfers (even the "interrupt in" USB
transfer are polled by the host).

After some debugging in hid-core.c I've found the reason.

In case of a highspeed device, the endpoint interval is re-calculated in
driver/usb/input/hid-core.c:

line 1669:
             /* handle potential highspeed HID correctly */
             interval = endpoint-&gt;bInterval;
             if (dev-&gt;speed == USB_SPEED_HIGH)
                   interval = 1 &lt;&lt; (interval - 1);

Basically this calculation is correct (refer to USB 2.0 spec, 9.6.6).
This new calculated value of "interval" is used as input for
usb_fill_int_urb:

line 1685:

            usb_fill_int_urb(hid-&gt;urbin, dev, pipe, hid-&gt;inbuf, 0,
                   hid_irq_in, hid, interval);

Unfortunately the same calculation as above is done a second time in
usb_fill_int_urb in the file include/linux/usb.h:

line 933:
        if (dev-&gt;speed == USB_SPEED_HIGH)
                urb-&gt;interval = 1 &lt;&lt; (interval - 1);
        else
                urb-&gt;interval = interval;

This means, that if the endpoint descriptor (of a high speed device)
specifies e.g. bInterval = 7, the urb-&gt;interval gets the value:

hid-core.c: interval = 1 &lt;&lt; (7-1) = 0x40 = 64
urb-&gt;interval = 1 &lt;&lt; (interval -1) = 1 &lt;&lt; (63) = integer overflow

Because of this the value of urb-&gt;interval is sometimes negative and is
rejected in core/urb.c:
line 353:
                /* too small? */
                if (urb-&gt;interval &lt;= 0)
                        return -EINVAL;

The conclusion is, that the recalculaton of the interval (which is
necessary for highspeed) should not be made twice, because this is
simply wrong. ;-)

Re-calculation in usb_fill_int_urb makes more sense, because it is the
most general approach. So it would make sense to remove it from
hid-core.c.

Because in hid-core.c the interval variable is only used for calling
usb_fill_int_urb, it is no problem to remove the highspeed
re-calculation in this file.

Signed-off-by: Christian Krause &lt;chkr@plauener.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the development of an USB device I found a bug in the handling of
Highspeed HID devices in the kernel.

What happened?

Highspeed HID devices are correctly recognized and enumerated by the
kernel. But even if usbhid kernel module is loaded, no HID reports are
received by the kernel.

The output of the hardware USB analyzer told me that the host doesn't
even poll for interrupt IN transfers (even the "interrupt in" USB
transfer are polled by the host).

After some debugging in hid-core.c I've found the reason.

In case of a highspeed device, the endpoint interval is re-calculated in
driver/usb/input/hid-core.c:

line 1669:
             /* handle potential highspeed HID correctly */
             interval = endpoint-&gt;bInterval;
             if (dev-&gt;speed == USB_SPEED_HIGH)
                   interval = 1 &lt;&lt; (interval - 1);

Basically this calculation is correct (refer to USB 2.0 spec, 9.6.6).
This new calculated value of "interval" is used as input for
usb_fill_int_urb:

line 1685:

            usb_fill_int_urb(hid-&gt;urbin, dev, pipe, hid-&gt;inbuf, 0,
                   hid_irq_in, hid, interval);

Unfortunately the same calculation as above is done a second time in
usb_fill_int_urb in the file include/linux/usb.h:

line 933:
        if (dev-&gt;speed == USB_SPEED_HIGH)
                urb-&gt;interval = 1 &lt;&lt; (interval - 1);
        else
                urb-&gt;interval = interval;

This means, that if the endpoint descriptor (of a high speed device)
specifies e.g. bInterval = 7, the urb-&gt;interval gets the value:

hid-core.c: interval = 1 &lt;&lt; (7-1) = 0x40 = 64
urb-&gt;interval = 1 &lt;&lt; (interval -1) = 1 &lt;&lt; (63) = integer overflow

Because of this the value of urb-&gt;interval is sometimes negative and is
rejected in core/urb.c:
line 353:
                /* too small? */
                if (urb-&gt;interval &lt;= 0)
                        return -EINVAL;

The conclusion is, that the recalculaton of the interval (which is
necessary for highspeed) should not be made twice, because this is
simply wrong. ;-)

Re-calculation in usb_fill_int_urb makes more sense, because it is the
most general approach. So it would make sense to remove it from
hid-core.c.

Because in hid-core.c the interval variable is only used for calling
usb_fill_int_urb, it is no problem to remove the highspeed
re-calculation in this file.

Signed-off-by: Christian Krause &lt;chkr@plauener.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: add apple usb touchpad driver</title>
<updated>2005-09-12T19:23:39+00:00</updated>
<author>
<name>Stelian Pop</name>
<email>stelian@popies.net</email>
</author>
<published>2005-09-08T08:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f7214ff4e8248513ec626212b2c1a3ca0b2a0888'/>
<id>f7214ff4e8248513ec626212b2c1a3ca0b2a0888</id>
<content type='text'>
This is a driver for the USB touchpad which can be found on post-February 2005
Apple PowerBooks.

This driver is derived from Johannes Berg's appletrackpad driver [1],
but it has been improved in some areas:
    * appletouch is a full kernel driver, no userspace program is necessary
    * appletouch can be interfaced with the synaptics X11 driver[2], in order
      to have touchpad acceleration, scrolling, two/three finger tap, etc.

This driver has been tested by the readers of the 'debian-powerpc' mailing
list for a few weeks now and I believe it is now ready for inclusion into the
mainline kernel.

Credits go to Johannes Berg for reverse-engineering the touchpad protocol,
Frank Arnold for further improvements, and Alex Harper for some additional
information about the inner workings of the touchpad sensors.

Signed-off-by: Stelian Pop &lt;stelian@popies.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a driver for the USB touchpad which can be found on post-February 2005
Apple PowerBooks.

This driver is derived from Johannes Berg's appletrackpad driver [1],
but it has been improved in some areas:
    * appletouch is a full kernel driver, no userspace program is necessary
    * appletouch can be interfaced with the synaptics X11 driver[2], in order
      to have touchpad acceleration, scrolling, two/three finger tap, etc.

This driver has been tested by the readers of the 'debian-powerpc' mailing
list for a few weeks now and I believe it is now ready for inclusion into the
mainline kernel.

Credits go to Johannes Berg for reverse-engineering the touchpad protocol,
Frank Arnold for further improvements, and Alex Harper for some additional
information about the inner workings of the touchpad sensors.

Signed-off-by: Stelian Pop &lt;stelian@popies.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[PATCH] USB: Prevent hid-core claiming Apple Bluetooth device on new G4 powerbooks"</title>
<updated>2005-09-12T18:58:07+00:00</updated>
<author>
<name>Greg KH</name>
<email>gregkh@suse.de</email>
</author>
<published>2005-09-12T18:58:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=80908309ce44677a07763e24e6ec9371cfa3ab5f'/>
<id>80908309ce44677a07763e24e6ec9371cfa3ab5f</id>
<content type='text'>
   This reverts 22af8878d2d641c6b15fe39fe4de3c05b2c477f0 commit.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
   This reverts 22af8878d2d641c6b15fe39fe4de3c05b2c477f0 commit.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Manual merge with Linus</title>
<updated>2005-09-10T01:14:47+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor_core@ameritech.net</email>
</author>
<published>2005-09-10T01:14:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d344c5e0856ad03278d8700b503762dbc8b86e12'/>
<id>d344c5e0856ad03278d8700b503762dbc8b86e12</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: yealink: fix htons usage, documentation updates</title>
<updated>2005-09-08T23:40:57+00:00</updated>
<author>
<name>Henk</name>
<email>Henk.Vergonet@gmail.com</email>
</author>
<published>2005-08-17T08:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b71e318cdb1dc301d734fdd4983dfc6dc167235a'/>
<id>b71e318cdb1dc301d734fdd4983dfc6dc167235a</id>
<content type='text'>
Signed-off-by: Henk Vergonet &lt;henk.vergonet@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Henk Vergonet &lt;henk.vergonet@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: fix endian issues in yealink driver.</title>
<updated>2005-09-08T23:40:57+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2005-08-16T19:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d5ae36dd439549305f00a755556f49c9fa7bb237'/>
<id>d5ae36dd439549305f00a755556f49c9fa7bb237</id>
<content type='text'>
sparse still complains about the htons usage, but I'll leave that for
others to fix.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sparse still complains about the htons usage, but I'll leave that for
others to fix.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] input-driver-yealink-P1K-usb-phone</title>
<updated>2005-09-08T23:40:57+00:00</updated>
<author>
<name>Henk</name>
<email>Henk.Vergonet@gmail.com</email>
</author>
<published>2005-08-16T14:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=aca951a22a1d93ebe31b54052b3eb9a8196df2fc'/>
<id>aca951a22a1d93ebe31b54052b3eb9a8196df2fc</id>
<content type='text'>
This patch aggregates all modifications in the -mm tree and adds
complete ringtone support.

The following features are supported:
  - keyboard          full support
  - LCD               full support
  - LED               full support
  - dialtone          full support
  - ringtone          full support
  - audio playback    via generic usb audio diver
  - audio record      via generic usb audio diver

For driver documentation see: Documentation/input/yealink.txt
For vendor documentation see: http://yealink.com

Signed-off-by: Henk &lt;Henk.Vergonet@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch aggregates all modifications in the -mm tree and adds
complete ringtone support.

The following features are supported:
  - keyboard          full support
  - LCD               full support
  - LED               full support
  - dialtone          full support
  - ringtone          full support
  - audio playback    via generic usb audio diver
  - audio record      via generic usb audio diver

For driver documentation see: Documentation/input/yealink.txt
For vendor documentation see: http://yealink.com

Signed-off-by: Henk &lt;Henk.Vergonet@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel</title>
<updated>2005-09-08T23:23:04+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2005-07-29T20:11:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b375a0495fd622037560c73c05f23ae6f127bb0c'/>
<id>b375a0495fd622037560c73c05f23ae6f127bb0c</id>
<content type='text'>
29 July 2005, Cambridge, MA:

This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
flag from the Linux kernel.  Mr. Stern explained, "This flag is a relic
from an earlier, less-well-designed system.  For over a year it hasn't
been used for anything other than printing warning messages."

An anonymous spokesman for the Linux kernel development community
commented, "This is exactly the sort of thing we see happening all the
time.  As the kernel evolves, support for old techniques and old code can
be jettisoned and replaced by newer, better approaches.  Proprietary
operating systems do not have the freedom or flexibility to change so
quickly."

Mr. Stern, a staff member at Harvard University's Rowland Institute who
works on Linux only as a hobby, noted that the patch (labelled as548) did
not update two files, keyspan.c and option.c, in the USB drivers' "serial"
subdirectory.  "Those files need more extensive changes," he remarked.
"They examine the status field of several URBs at times when they're not
supposed to.  That will need to be fixed before the URB_ASYNC_UNLINK flag
is removed."

Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
of Linux's USB drivers, did not respond to our inquiries or return our
calls.  His only comment was "Applied, thanks."

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
29 July 2005, Cambridge, MA:

This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
flag from the Linux kernel.  Mr. Stern explained, "This flag is a relic
from an earlier, less-well-designed system.  For over a year it hasn't
been used for anything other than printing warning messages."

An anonymous spokesman for the Linux kernel development community
commented, "This is exactly the sort of thing we see happening all the
time.  As the kernel evolves, support for old techniques and old code can
be jettisoned and replaced by newer, better approaches.  Proprietary
operating systems do not have the freedom or flexibility to change so
quickly."

Mr. Stern, a staff member at Harvard University's Rowland Institute who
works on Linux only as a hobby, noted that the patch (labelled as548) did
not update two files, keyspan.c and option.c, in the USB drivers' "serial"
subdirectory.  "Those files need more extensive changes," he remarked.
"They examine the status field of several URBs at times when they're not
supposed to.  That will need to be fixed before the URB_ASYNC_UNLINK flag
is removed."

Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
of Linux's USB drivers, did not respond to our inquiries or return our
calls.  His only comment was "Applied, thanks."

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: Prevent hid-core claiming Apple Bluetooth device on new G4 powerbooks</title>
<updated>2005-09-08T23:22:29+00:00</updated>
<author>
<name>Andrew de Quincey</name>
<email>adq_dvb@lidskialf.net</email>
</author>
<published>2005-08-04T22:16:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=22af8878d2d641c6b15fe39fe4de3c05b2c477f0'/>
<id>22af8878d2d641c6b15fe39fe4de3c05b2c477f0</id>
<content type='text'>
To recap: My new G4 powerbook has a bluetooth device that boots up in
what apppears to be a compatability mode - it looks exactly like an HID
keyboard/mouse device.

A special command sequence is sent to switch it into full bluetooth
mode. When this occurs the original HID device vanishes, and a new
(bluetooth HID) USB device appears on the bus with a different product
ID.

The original thread is here:
http://sourceforge.net/mailarchive/message.php?msg_id=12532263

The attached patch adds the device to the hid-core quirks so that
hid-core ignores it.

Signed-off-by: Andrew de Quincey &lt;adq_dvb@lidskialf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To recap: My new G4 powerbook has a bluetooth device that boots up in
what apppears to be a compatability mode - it looks exactly like an HID
keyboard/mouse device.

A special command sequence is sent to switch it into full bluetooth
mode. When this occurs the original HID device vanishes, and a new
(bluetooth HID) USB device appears on the bus with a different product
ID.

The original thread is here:
http://sourceforge.net/mailarchive/message.php?msg_id=12532263

The attached patch adds the device to the hid-core quirks so that
hid-core ignores it.

Signed-off-by: Andrew de Quincey &lt;adq_dvb@lidskialf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] USB: fix keyspan_remote endian bug on probe</title>
<updated>2005-09-08T23:22:17+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2005-07-27T08:06:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ef0840286045fe7ce84cb77e7608f0844c81001c'/>
<id>ef0840286045fe7ce84cb77e7608f0844c81001c</id>
<content type='text'>
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
