History log of /drivers/usb/gadget/epautoconf.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f9b0f5170918695891f42645737682ccb452ee13 01-Mar-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org> Merge tag 'gadget-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

USB: Gadget: changes for 3.4

This merge is rather big. Here's what it contains:

For am5536udc we have just simple coding style fixes. Nothing that has any
potential to cause any issues going forward.

With mv_udc, there's only one single change removing an unneeded NULL check.

at91_udc also only saw a single change this merge window, and that's only
removing a duplicated header.

The Renesas controller has a few more involved changes. Support for SUDMAC was
added, there's now a special handling of IRQ resources for when the IRQ line is
shared between Renesas controller and SUDMAC, we also had a bug fix where
Renesas controller would sleep in atomic context while doing DMA transfers from
a tasklet. There were also a set of minor cleanups.

The FSL UDC also had a scheduling in atomic context bug fix, but that's all.

Thanks to Sebastian, the dummy_hcd now works better than ever with support for
scatterlists and streams. Sebastian also added SuperSpeed descriptors to the
serial gadgets.

The highlight on this merge is the addition of a generic API for mapping and
unmapping usb_requests. This will avoid code duplication on all UDC controllers
and also kills all the defines for DMA_ADDR_INVALID which UDC controllers
sprinkled around. A few of the UDC controllers were already converted to use
this new API.

Conflicts:
drivers/usb/dwc3/gadget.c
609ca228073ae06c5513474d2cdf0af7ee5766ec 06-Feb-2012 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: gadget: clean the ep in autoconf before returning it.

Since commit 72c973dd aka ("usb: gadget: add usb_endpoint_descriptor to
struct usb_ep) the descriptor is part of the ep. Most gadgets like
g_zero or masstorage call config_ep_by_speed() to grab an available
endpoint which may be used for FS/HS/SS bulk/iso/intr and in a second
they assign the proper descriptor by calling config_ep_by_speed(). This
is good so far. A few of them like ncm call config_ep_by_speed() only if
ep->desc not assigned earlier. That means ep->desc is never assigned if
the endpoint was used by another gadget before it was removed.

Some of those gadgets also assign ep->driver_data to NULL on reset or
ep_disable part _but_ keep a reference to this endpoint. At ep_enable
time they assign driver_data to their private data. This probably needs
a clean up of its own.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
/drivers/usb/gadget/epautoconf.c
c74c930082fd407e3b9e503d855d78777a8e5a84 11-Jan-2012 Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb: gadget: check for streams only for SS udcs

Currently the UASP gadget fails to bind on an UDC which does not provide
stream support. This is true for all udc in tree except for dummy and
dwc3 since they don't support SuperSpeed.
There is no need to test for the availability of stream support on those
UDCs because we will never even try to use them. I think it is sane to
assume that StreamSupport is always available on SuperSpeed since it is
one of the key features.
The host side will only allocate on SS so this part is also fine.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
/drivers/usb/gadget/epautoconf.c
55b81e6f2795484ea8edf5805c95c007cacfa736 09-Jan-2012 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (232 commits)
USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c
xhci: Clean up 32-bit build warnings.
USB: update documentation for usbmon
usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops
drivers/usb/class/cdc-acm.c: clear dangling pointer
drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree
drivers/usb/host/isp1760-if.c: introduce missing kfree
usb: option: add ZD Incorporated HSPA modem
usb: ch9: fix up MaxStreams helper
USB: usb-skeleton.c: cleanup open_count
USB: usb-skeleton.c: fix open/disconnect race
xhci: Properly handle COMP_2ND_BW_ERR
USB: remove dead code from suspend/resume path
USB: add quirk for another camera
drivers: usb: wusbcore: Fix dependency for USB_WUSB
xhci: Better debugging for critical host errors.
xhci: Be less verbose during URB cancellation.
xhci: Remove debugging about ring structure allocation.
xhci: Remove debugging about toggling cycle bits.
xhci: Remove debugging for individual transfers.
...
7422ba5343b8c1dbe1a517d0fcc15e7d671ca960 19-Dec-2011 Felipe Balbi <balbi@ti.com> usb: gadget: epautoconf: do not change number of streams

We should not change gadget driver's descriptors just
because we think it's right to do so.

There are several of reasons which would support this
statement but it suffices to say that this was probably
never tested because it updates bmAttributes without
asking the driver if it's ok to do so.

This means that e.g. on UASP gadget it would enable
stream support even for the command endpoint which must
not have stream support enabled.

In fact, this change is fixing the bug introduced by
commit a59d6b9 (usb: gadget: add streams support to
the gadget framework) which was caught when testing
UASP gadget with dwc3 driver.

Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
/drivers/usb/gadget/epautoconf.c
d327ab5b6d660d6fe22b073b743fde1668e593bb 19-Nov-2011 Michal Nazarewicz <mina86@mina86.com> usb: gadget: replace usb_gadget::is_dualspeed with max_speed

This commit replaces usb_gadget's is_dualspeed field with
a max_speed field.

[ balbi@ti.com : Fixed DWC3 driver ]

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
/drivers/usb/gadget/epautoconf.c
28c9fc68ebd32d473a8787d05c74e3f39c6c866b 09-Sep-2011 Klaus Schwarzkopf <schwarzkopf@sensortherm.de> usb gadget: clean up FSF boilerplate text

remove the following two paragraphs as they are not needed:

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
29cc88979a8818cd8c5019426e945aed118b400e 23-Aug-2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> USB: use usb_endpoint_maxp() instead of le16_to_cpu()

Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
instead of le16_to_cpu(desc->wMaxPacketSize).
This patch fix it up

Cc: Armin Fuerst <fuerst@in.tum.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Johannes Erdfelt <johannes@erdfelt.com>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: David Kubicek <dave@awk.cz>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Brad Hards <bhards@bigpond.net.au>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
Cc: David Brownell <david-b@pacbell.net>
Cc: David Lopo <dlopo@chipidea.mips.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Xie Xiaobo <X.Xie@freescale.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Jiang Bo <tanya.jiang@freescale.com>
Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Herbert Pƶtzl <herbert@13thfloor.at>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Roman Weissgaerber <weissg@vienna.at>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: Florian Floe Echtler <echtler@fs.tum.de>
Cc: Christian Lucht <lucht@codemercs.com>
Cc: Juergen Stuber <starblue@sourceforge.net>
Cc: Georges Toth <g.toth@e-biz.lu>
Cc: Bill Ryder <bryder@sgi.com>
Cc: Kuba Ober <kuba@mareimbrium.org>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
bdb64d727216b49a18c2b8337658adc6b2db82ea 29-Jun-2011 Tatyana Brokhman <tlinder@codeaurora.org> usb: gadget: add SuperSpeed support to the Gadget Framework

SuperSpeed USB has defined a new descriptor, called
the Binary Device Object Store (BOS) Descriptor. It
has also changed a bit the definition of SET_FEATURE
and GET_STATUS requests to add USB3-specific details.

This patch implements both changes to the Composite
Gadget Framework.

[ balbi@ti.com : slight changes to commit log
fixed a compile error on ARM ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
a59d6b91cbca52235e3ed9f7f9e34c4f2f3e1996 28-Jun-2011 Tatyana Brokhman <tlinder@codeaurora.org> usb: gadget: add streams support to the gadget framework

This patch defines necessary fields to support
streaming for USB3.0.

It implements a new function, called
usb_ep_autoconfig_ss(), to be used instead of the
existing usb_ep_autoconfig() when working in
SuperSpeed mode and there is a need to search for
an endpoint according to the number of required
streams.

[ balbi@ti.com : slight changes to commit log ]

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
48767a4e8263620c347c3fa17812c943dd0fc2fa 28-Jun-2011 Tatyana Brokhman <tlinder@codeaurora.org> usb: gadget: configure endpoint according to gadget speed

Add config_ep_by_speed() to configure the endpoint
according to the gadget speed.

Using this function will spare the FDs from handling
the endpoint chosen descriptor.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
553fbcde3481c98a076c9744a59ad08dbc61c099 14-Jan-2011 Jassi Brar <jassi.brar@samsung.com> USB: Gadget: Initialize wMaxPacketSize if not already set

Currently, for ISO and INT, a protocol driver must chose the value for
wMaxPacketSize arbitrarily. The value may be too low, resulting in lesser
than efficient operation or high enough to not work with all UDC drivers.

Take un-initialized wMaxPacketSize as a hint to provide maximum
possible packetsize for the selected endpoint. The protocol may
then choose a value not bigger than that.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
28824b18ac4705e876a282a15ea0de8fc957551f 05-May-2010 Michal Nazarewicz <m.nazarewicz@samsung.com> USB: gadget: __init and __exit tags removed

__init, __initdata and __exit tags have have been removed from
various files to make it possible for gadgets that do not use
the __init/__exit tags to use those.

Files in question are related to:
* the core composite framework,
* the mass storage function (fixing a section mismatch) and
* ethernet driver (ACM, ECM, RNDIS).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
f2984a333fb5e325d478950c9d8af3693869e69c 09-Mar-2010 Mike Frysinger <vapier@gentoo.org> USB: gadget: fix Blackfin builds after gadget cleansing

The recent change to clean out dead gadget drivers (90f7976880bbbf99)
missed the call to gadget_is_musbhsfc() behind CONFIG_BLACKFIN. This
causes Blackfin gadget builds to fail since the function no longer
exists anywhere.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
90f7976880bbbf9968629500972f8e2f80401217 05-Feb-2010 Christoph Egger <siccegge@stud.informatik.uni-erlangen.de> USB: Remove unsupported usb gadget drivers

A bunch of USB gadget drivers where never ported from the linux 2.4
series to 2.6 kernels. However there's some code still in the tree for
them which isn't used and is probably untested for ages.

As the chance of these drivers being forward ported is probably quite
small now it might be time to get rid of them.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
767ffec15e25b34c7194e47f0ad1fbf63a568d44 21-Dec-2009 Cliff Cai <cliff.cai@analog.com> USB: gadget: add INT support for Blackfin musb

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
3a8a3b1cee6c525661732b8bcf29ac63d42945ed 21-Dec-2009 Bryan Wu <cooloney@kernel.org> USB: gadget: use ep5 for bulk-in and ep6 for bulk-out for Blackfin MUSB

Normally, the musb uses ep1 as the bidirectional bulk endpoint. This won't
work on the Blackfin musb as all endpoints (except ep0) are unidirectional.
Further, ep1-ep4 have a small 128 byte FIFO which makes them undesirable
for bulk endpoints (which need more like a 512 byte FIFO). This leaves us
with ep5-ep7 which have 1024 byte FIFOs and can be configured as either
in/out and bulk/interrupt/iso on the fly.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
551509d267905705f6d723e51ec706916f06b859 11-Feb-2009 Harvey Harrison <harvey.harrison@gmail.com> USB: replace uses of __constant_{endian}

The base versions handle constant folding now.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
bb9496c6f7e853e5d4edd5397c9d45f1968d623c 25-Nov-2008 Julia Lawall <julia@diku.dk> USB: gadget: change simple_strtol to simple_strtoul

Since num is unsigned, it would seem better to use simple_strtoul that
simple_strtol.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r2@
long e;
position p;
@@

e = simple_strtol@p(...)

@@
position p != r2.p;
type T;
T e;
@@

e =
- simple_strtol@p
+ simple_strtoul
(...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
a4c39c41bf3592684e36fa0dbbd4ab1a31f969b9 20-Jun-2008 David Brownell <dbrownell@users.sourceforge.net> usb gadget: descriptor copying support

Define three new descriptor manipulation utilities, for use when
setting up functions that may have multiple instances:

usb_copy_descriptors() to copy a vector of descriptors
usb_free_descriptors() to free the copy
usb_find_endpoint() to find a copied version

These will be used as follows. Functions will continue to have static
tables of descriptors they update, now used as __initdata templates.

When a function creates a new instance, it patches those tables with
relevant interface and string IDs, plus endpoint assignments. Then it
copies those morphed descriptors, associates the copies with the new
function instance, and records the endpoint descriptors to use when
activating the endpoints. When initialization is done, only the copies
remain in memory. The copies are freed on driver removal.

This ensures that each instance has descriptors which hold the right
instance-specific data. Two instances in the same configuration will
obviously never share the same interface IDs or use the same endpoints.
Instances in different configurations won't do so either, which means
this is slightly less memory-efficient in some cases.

This also includes a bugfix to the epautoconf code that shows up with
this usage model. It must replace the previous endpoint number when
updating the template descriptors, not just mask in a few more bits.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
0e530b45783f75a29bde20bbf9e287c915a4f68b 05-Apr-2008 David Brownell <david-b@pacbell.net> USB: gadget section fixes

Restore some section annotations: they were switched to "__devinit"
while they should have been "__init", because of bogus warnings. The
warnings are now fixed, so the runtime footprint of various drivers
can now shrink a bit. On ARMv5, it's about 600 bytes except for the
Ethernet gadget, where it can save a bit more.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
9454a57ab5922e5cd25321cae9d1a8cbeb3e2e85 05-Oct-2007 David Brownell <david-b@pacbell.net> USB: move <linux/usb_gadget.h> to <linux/usb/gadget.h>

Move <linux/usb_gadget.h> to <linux/usb/gadget.h>, reducing
some of the clutter in the main include directory.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
a9475226977917afd5a85621f8a3d7f380a9da31 30-Jul-2007 David Brownell <david-b@pacbell.net> USB: "sparse" cleanups for usb gadgets

This removes complaints about the gadget stack which are generated by
the currrent "sparse": it doesn't like the fact that zero is the null
pointer. (Last I checked, C guarantees that's correct ...)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
01ee7d7032204b383b2fba73021e7acbc776184b 26-May-2007 David Brownell <david-b@pacbell.net> USB: usb gadgets avoid le{16,32}_to_cpup()

It turns out that le16_to_cpup() and le32_to_cpup() aren't always safe
to call with pointers into packed structures, since those are inlined
functions and GCC may lose the "packed" attribute. So those references
can become unaligned kernel accesses, which are evil on some hardware.

This patch updates uses of those routines in the gadget stack. The
references into packed structures can just use leXX_to_cpu(*x), which
in most cases is more natural. Some other uses in RNDIS, mostly in
debug code, were wrong in the first place; those use get_unaligned().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
5f848137744106ee737f559454ce5adfceb38347 17-Dec-2006 David Brownell <david-b@pacbell.net> USB: <linux/usb_ch9.h> becomes <linux/usb/ch9.h>

This moves <linux/usb_ch9.h> to <linux/usb/ch9.h> to reduce some of the
clutter of usb header files.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
a353678d3136306c1d00f0d2319de1dac8a6b1db 07-Jul-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: gadget section fixups

Recent section changes broke gadget builds on some platforms. This patch
is the best fix that's available until better section markings exist:

- There's a lot of cleanup code that gets used in both init and exit paths;
stop marking it as "__exit".

(Best fix for this would be an "__init_or_exit" section marking, putting
the cleanup in __init when __exit sections get discarded else in __exit.)

- Stop marking the use-once probe routines as "__init" since references
to those routines are not allowed from driver structures. They're now
marked "__devinit", which in practice is a net lose.

(Best fix for this is likely to separate such use-once probe routines
from the driver structure ... but in general, all busses that aren't
hotpluggable will be forced to waste memory for all probe-only code.)

In general these broken section rules waste an average of two to four kBytes
per driver of code bloat ... because none of the relevant code can ever be
reused after module initialization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/usb/gadget/epautoconf.c
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
/drivers/usb/gadget/epautoconf.c