<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/core, branch v2.6.30</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>USB: pass mem_flags to dma_alloc_coherent</title>
<updated>2009-04-23T21:15:28+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes@sipsolutions.net</email>
</author>
<published>2009-04-18T09:00:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a8aa401f38cfb5fa26e970b48e93fb851d68fe64'/>
<id>a8aa401f38cfb5fa26e970b48e93fb851d68fe64</id>
<content type='text'>
When I want to use my webcam, I get:

                                 vvvvvvv
cheese: page allocation failure. order:5, mode:0x8004
Pid: 8100, comm: cheese Not tainted 2.6.30-rc2-wl-dirty #102
Call Trace:
 [&lt;ffffffff802c5d8e&gt;] __alloc_pages_internal+0x3fe/0x520
 [&lt;ffffffff80210a20&gt;] dma_generic_alloc_coherent+0x90/0x120
 [&lt;ffffffffa001c91e&gt;] hcd_buffer_alloc+0xee/0x130 [usbcore]
 [&lt;ffffffffa000d52d&gt;] usb_buffer_alloc+0x2d/0x40 [usbcore]
 [&lt;ffffffffa0160e14&gt;] uvc_alloc_urb_buffers+0x84/0x140 [uvcvideo]
 [&lt;ffffffffa0160ff6&gt;] uvc_init_video+0x126/0x400 [uvcvideo]
 [...]

Oddly, I remembered fixing this and putting in __GFP_NOWARN
because uvcvideo retries a smaller allocation. However, the
allocation function doesn't pass the gfp flags through to
dma_alloc_coherent so we still get the warning!

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.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>
When I want to use my webcam, I get:

                                 vvvvvvv
cheese: page allocation failure. order:5, mode:0x8004
Pid: 8100, comm: cheese Not tainted 2.6.30-rc2-wl-dirty #102
Call Trace:
 [&lt;ffffffff802c5d8e&gt;] __alloc_pages_internal+0x3fe/0x520
 [&lt;ffffffff80210a20&gt;] dma_generic_alloc_coherent+0x90/0x120
 [&lt;ffffffffa001c91e&gt;] hcd_buffer_alloc+0xee/0x130 [usbcore]
 [&lt;ffffffffa000d52d&gt;] usb_buffer_alloc+0x2d/0x40 [usbcore]
 [&lt;ffffffffa0160e14&gt;] uvc_alloc_urb_buffers+0x84/0x140 [uvcvideo]
 [&lt;ffffffffa0160ff6&gt;] uvc_init_video+0x126/0x400 [uvcvideo]
 [...]

Oddly, I remembered fixing this and putting in __GFP_NOWARN
because uvcvideo retries a smaller allocation. However, the
allocation function doesn't pass the gfp flags through to
dma_alloc_coherent so we still get the warning!

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: add reset endpoint operations</title>
<updated>2009-04-17T17:50:27+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@csr.com</email>
</author>
<published>2009-04-08T17:36:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3444b26afa145148951112534f298bdc554ec789'/>
<id>3444b26afa145148951112534f298bdc554ec789</id>
<content type='text'>
Wireless USB endpoint state has a sequence number and a current
window and not just a single toggle bit.  So allow HCDs to provide a
endpoint_reset method and call this or clear the software toggles as
required (after a clear halt, set configuration etc.).

usb_settoggle() and friends are then HCD internal and are moved into
core/hcd.h and all device drivers call usb_reset_endpoint() instead.

If the device endpoint state has been reset (with a clear halt) but
the host endpoint state has not then subsequent data transfers will
not complete. The device will only work again after it is reset or
disconnected.

Signed-off-by: David Vrabel &lt;david.vrabel@csr.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>
Wireless USB endpoint state has a sequence number and a current
window and not just a single toggle bit.  So allow HCDs to provide a
endpoint_reset method and call this or clear the software toggles as
required (after a clear halt, set configuration etc.).

usb_settoggle() and friends are then HCD internal and are moved into
core/hcd.h and all device drivers call usb_reset_endpoint() instead.

If the device endpoint state has been reset (with a clear halt) but
the host endpoint state has not then subsequent data transfers will
not complete. The device will only work again after it is reset or
disconnected.

Signed-off-by: David Vrabel &lt;david.vrabel@csr.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: allow malformed LANGID descriptors</title>
<updated>2009-03-24T23:20:45+00:00</updated>
<author>
<name>Daniel Mack</name>
<email>daniel@caiaq.de</email>
</author>
<published>2009-03-20T18:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b7af0bb26899bb47ae16fb41d2296111b0784a56'/>
<id>b7af0bb26899bb47ae16fb41d2296111b0784a56</id>
<content type='text'>
When an USB hardware does not provide a valid LANGID, fall back to value
zero which is still a reasonable default for most devices.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&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>
When an USB hardware does not provide a valid LANGID, fall back to value
zero which is still a reasonable default for most devices.

Signed-off-by: Daniel Mack &lt;daniel@caiaq.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: more u32 conversion after transfer_buffer_length and actual_length</title>
<updated>2009-03-24T23:20:45+00:00</updated>
<author>
<name>Roel Kluin</name>
<email>roel.kluin@gmail.com</email>
</author>
<published>2009-03-13T11:19:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=71d2718f2507dc17501d04e2bdca7b8e694ce365'/>
<id>71d2718f2507dc17501d04e2bdca7b8e694ce365</id>
<content type='text'>
transfer_buffer_length and actual_length have become unsigned, therefore some
additional conversion of local variables, function arguments and print
specifications is desired.

A test for a negative urb-&gt;transfer_buffer_length became obsolete; instead
we ensure that it does not exceed INT_MAX. Also, urb-&gt;actual_length is always
less than urb-&gt;transfer_buffer_length.

rh_string() does no longer return -EPIPE in the case of an unsupported ID.
Instead its only caller, rh_call_control() does the check.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-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>
transfer_buffer_length and actual_length have become unsigned, therefore some
additional conversion of local variables, function arguments and print
specifications is desired.

A test for a negative urb-&gt;transfer_buffer_length became obsolete; instead
we ensure that it does not exceed INT_MAX. Also, urb-&gt;actual_length is always
less than urb-&gt;transfer_buffer_length.

rh_string() does no longer return -EPIPE in the case of an unsupported ID.
Instead its only caller, rh_call_control() does the check.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-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>USB: usbfs: remove unneeded "inline" annotations</title>
<updated>2009-03-24T23:20:44+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-03-09T17:44:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d34d9721a559fd11ec682bd9ef17220de0162060'/>
<id>d34d9721a559fd11ec682bd9ef17220de0162060</id>
<content type='text'>
This patch (as1223) removes a bunch of unnecessary "inline"
annotations from the usbfs driver.

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>
This patch (as1223) removes a bunch of unnecessary "inline"
annotations from the usbfs driver.

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>USB: don't send Set-Interface after reset</title>
<updated>2009-03-24T23:20:38+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-02-26T15:21:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4fe0387afa893b44c5a21b9bfbb0888354ef4656'/>
<id>4fe0387afa893b44c5a21b9bfbb0888354ef4656</id>
<content type='text'>
This patch (as1221) changes the way usbcore reinitializes a device
following a reset or a reset-resume.  Currently we call
usb_set_interface() for every interface in the active configuration;
this is to put the interface into the same altsetting as before the
reset and to make sure that the host's endpoint state matches the
device's endpoint state.

However, sending a Set-Interface request is a waste of time if an
interface was already in altsetting 0 before the reset, since it is
certainly in altsetting 0 afterward.  In addition, many devices can't
handle Set-Interface requests -- they crash when they receive them.

So instead, the patch adds code to check each interface.  If the
interface wasn't in altsetting 0 before the reset, we go head with the
Set-Interface request as before.  But if it was then we skip sending
the Set-Interface request, and we clear out the host-side endpoint
state by calling usb_disable_interface() followed by
usb_enable_interface().

The patch also adds a couple of new comments to explain what's going
on.

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>
This patch (as1221) changes the way usbcore reinitializes a device
following a reset or a reset-resume.  Currently we call
usb_set_interface() for every interface in the active configuration;
this is to put the interface into the same altsetting as before the
reset and to make sure that the host's endpoint state matches the
device's endpoint state.

However, sending a Set-Interface request is a waste of time if an
interface was already in altsetting 0 before the reset, since it is
certainly in altsetting 0 afterward.  In addition, many devices can't
handle Set-Interface requests -- they crash when they receive them.

So instead, the patch adds code to check each interface.  If the
interface wasn't in altsetting 0 before the reset, we go head with the
Set-Interface request as before.  But if it was then we skip sending
the Set-Interface request, and we clear out the host-side endpoint
state by calling usb_disable_interface() followed by
usb_enable_interface().

The patch also adds a couple of new comments to explain what's going
on.

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>USB: allow libusb to talk to unauthenticated WUSB devices</title>
<updated>2009-03-24T23:20:35+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@csr.com</email>
</author>
<published>2009-02-18T14:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6da9c99059bf24fb1faae6b9613bae64ea50c05e'/>
<id>6da9c99059bf24fb1faae6b9613bae64ea50c05e</id>
<content type='text'>
To permit a userspace application to associate with WUSB devices
using numeric association, control transfers to unauthenticated WUSB
devices must be allowed.

This requires that wusbcore correctly sets the device state to
UNAUTHENTICATED, DEFAULT and ADDRESS and that control transfers can be
performed to UNAUTHENTICATED devices.

Signed-off-by: David Vrabel &lt;david.vrabel@csr.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>
To permit a userspace application to associate with WUSB devices
using numeric association, control transfers to unauthenticated WUSB
devices must be allowed.

This requires that wusbcore correctly sets the device state to
UNAUTHENTICATED, DEFAULT and ADDRESS and that control transfers can be
performed to UNAUTHENTICATED devices.

Signed-off-by: David Vrabel &lt;david.vrabel@csr.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: replace uses of __constant_{endian}</title>
<updated>2009-03-24T23:20:33+00:00</updated>
<author>
<name>Harvey Harrison</name>
<email>harvey.harrison@gmail.com</email>
</author>
<published>2009-02-11T22:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=551509d267905705f6d723e51ec706916f06b859'/>
<id>551509d267905705f6d723e51ec706916f06b859</id>
<content type='text'>
The base versions handle constant folding now.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@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>
The base versions handle constant folding now.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: drivers: use USB API functions rather than constants</title>
<updated>2009-03-24T23:20:28+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2008-12-29T10:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2e0fe709687470637a0709b930ccc9e993d2dad5'/>
<id>2e0fe709687470637a0709b930ccc9e993d2dad5</id>
<content type='text'>
This set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// &lt;smpl&gt;
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd-&gt;bmAttributes &amp; \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd-&gt;bEndpointAddress &amp; \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include &lt;linux/usb.h&gt;

@depends on !inc &amp;&amp; (r1||r5)@
@@

+ #include &lt;linux/usb.h&gt;
  #include &lt;linux/usb/...&gt;
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&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 set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// &lt;smpl&gt;
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd-&gt;bmAttributes &amp; \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd-&gt;bEndpointAddress &amp; \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include &lt;linux/usb.h&gt;

@depends on !inc &amp;&amp; (r1||r5)@
@@

+ #include &lt;linux/usb.h&gt;
  #include &lt;linux/usb/...&gt;
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: add quirk to avoid config and interface strings</title>
<updated>2009-03-24T23:20:25+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-03-18T18:28:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1662e3a7f076e51e3073faf9ce77157b529c475b'/>
<id>1662e3a7f076e51e3073faf9ce77157b529c475b</id>
<content type='text'>
Apparently the Configuration and Interface strings aren't used as
often as the Vendor, Product, and Serial strings.  In at least one
device (a Saitek Cyborg Gold 3D joystick), attempts to read the
Configuration string cause the device to stop responding to Control
requests.

This patch (as1226) adds a quirks flag, telling the kernel not to
read a device's Configuration or Interface strings, together with a
new quirk for the offending joystick.

Reported-by: Melchior FRANZ &lt;melchior.franz@gmail.com&gt;
Tested-by: Melchior FRANZ &lt;melchior.franz@gmail.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;  [2.6.28 and 2.6.29, nothing earlier]
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apparently the Configuration and Interface strings aren't used as
often as the Vendor, Product, and Serial strings.  In at least one
device (a Saitek Cyborg Gold 3D joystick), attempts to read the
Configuration string cause the device to stop responding to Control
requests.

This patch (as1226) adds a quirks flag, telling the kernel not to
read a device's Configuration or Interface strings, together with a
new quirk for the offending joystick.

Reported-by: Melchior FRANZ &lt;melchior.franz@gmail.com&gt;
Tested-by: Melchior FRANZ &lt;melchior.franz@gmail.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;  [2.6.28 and 2.6.29, nothing earlier]
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
