History log of /linux-master/drivers/usb/gadget/epautoconf.c
Revision Date Author Comments
# 6b0be25c 09-Sep-2021 Ajay Garg <ajaygargnsit@gmail.com>

usb: gadget: fix for a typo that conveys logically-inverted information.

Upon calling usb_ep_autoconfig_release(), the endpoint becomes *not
valid*.

Signed-off-by: Ajay Garg <ajaygargnsit@gmail.com>
Link: https://lore.kernel.org/r/20210909120624.77557-1-ajaygargnsit@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dffe2d7f 31-Jan-2019 Andrzej Pietrasiewicz <andrzej.p@collabora.com>

usb: gadget: move non-super speed code out of usb_ep_autoconfig_ss()

The moved code refers to non-super speed endpoints only. This patch also
makes the comment stress the fact, that autoconfigured descriptor might
need some adjustments.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# e79bfcb7 06-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: gadget: Remove redundant license text

Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b67f628c 15-Sep-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: epautoconf: add usb_ep_autoconfig_release() function

This patch introduces usb_ep_autoconfig_release() function which allows
to release endpoint previously obtained from usb_ep_autoconfig() during
USB function bind.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# f871cb9b 15-Sep-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: fix few outdated comments

Fix comments in code to make them up to date.

composite: claiming endpoint is now done by setting ep->claimed flag,
not ep->driver_data.

epautoconf: usb_ep_autoconfig() and usb_ep_autoconfig_ss() return
claimed endpoint with ep->claimed flag already set.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# e4c1b1ba 21-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: fix possible regression introduced with ep->claimed

This patch fixes possible regression introduced by
patch reworking endpoint claiming mechanism. It restores
setring ep->driver_data to NULL in usb_ep_autoconfig_reset(),
which was removed by patch commit cc476b42a39d.

Fixes: cc476b42a39d ("usb: gadget: encapsulate endpoint
claiming mechanism")
Reported-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# adab4339 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: remove gadget_chips.h

This header file contains helpers for quirks based on UDC controller name.
Since we have generic quirk bitfields in usb_gadget structure for all of
these quirks we don't need to have this header any longer.

This patch removes gadget_chips.h file and makes sure that it's no longer
included anywhere in kernel sources.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 26b8aa45 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: musb: gadget: add musb_match_ep() function

Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Function does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 8cc67b7b 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: goku_udc: add goku_match_ep() function

Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Function does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

[ balbi@ti.com : fix build breakage ]

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 3e8b2318 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: net2280: add net2280_match_ep() function

Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
process. Function does the same that was done by chip-specific code inside
of epautoconf. Now this code can be removed from there to separate generic code
from platform specific logic.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# b0aea003 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: move find_ep() from epautoconf to udc-core

Move find_ep() to udc-core and rename it to gadget_find_ep_by_name().
It can be used in UDC drivers, especially in 'match_ep' callback after
moving chip-specific endpoint matching logic from epautoconf to UDC
drivers.

Replace all calls of find_ep() function with gadget_find_ep_by_name().

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 4278c687 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: move ep_matches() from epautoconf to udc-core

Move ep_matches() function to udc-core and rename it to
usb_gadget_ep_match_desc(). This function can be used by UDC drivers
in 'match_ep' callback to avoid writing lots of repetitive code.

Replace all calls of ep_matches() with usb_gadget_ep_match_desc().

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 596c154d 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: add 'ep_match' callback to usb_gadget_ops

Add callback that is called by epautoconf to allow UDC driver match the
best endpoint for specific descriptor. It's intended to supply mechanism
which allows to get rid of chip-specific endpoint matching code from
epautoconf.

If gadget has set 'ep_match' callback we prefer to call it first, and
if it fails to find matching endpoint, then we try to use default matching
algorithm.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 26bf956a 06-Aug-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: epautoconf: rework ep_matches() function

Rework ep_matches() function to make it shorter and more readable.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 5dbe135a 31-Jul-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: epautoconf: remove ep and desc configuration from ep_matches()

As function ep_matches() is used to match endpoint with usb descriptor it's
highly unintuitive that it modifies endpoint and descriptor structures fields.
This patch moves code configuring ep and desc from ep_matches() to
usb_ep_autoconfig_ss(), so now function ep_matches() does nothing more than
its name suggests.

[ balbi@ti.com : fix build warning ]

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# b58713d5 31-Jul-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: epautoconf: remove pxa quirk from ep_matches()

The same effect can be achieved by using capabilities flags, so now we can
get rid of handling of hardware specific limitations in generic code.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# b86f33a3 31-Jul-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: epautoconf: add endpoint capabilities flags verification

Introduce endpoint matching mechanism basing on endpoint capabilities
flags. We check if endpoint supports transfer type and direction requested
in ep descriptor. Since we have this new endpoint matching mechanism
there is no need to have old code guessing endpoint capabilities basing
on its name, so we are getting rid of it. Remove also the obsolete comment.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# cc476b42 31-Jul-2015 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: encapsulate endpoint claiming mechanism

So far it was necessary for usb functions to set ep->driver_data in
endpoint obtained from autoconfig to non-null value, to indicate that
endpoint is claimed by function (in autoconfig it was checked if endpoint
has set this field to non-null value, and if it has, it was assumed that
it is claimed). It could cause bugs because if some function doesn't
set this field autoconfig could return the same endpoint more than one
time.

To help to avoid such bugs this patch adds claimed flag to struct usb_ep,
and encapsulates endpoint claiming mechanism inside usb_ep_autoconfig_ss()
and usb_ep_autoconfig_reset(), so now usb functions don't need to perform
any additional actions to mark endpoint obtained from autoconfig as claimed.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# e9ab4d0a 16-May-2015 Mian Yousaf Kaukab <yousaf.kaukab@intel.com>

usb: gadget: autoconf: net2280: match hardware and usb ep address

USB3380 GPEP can be used in IN and OUT directions however, both
directions should use same endpoint address. Fulfil this requirement
by mapping usb endpoint to hardware endpoint with the same address.

Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 803a5362 08-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

usb: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e117e742 12-Dec-2013 Robert Baldyga <r.baldyga@samsung.com>

usb: gadget: add "maxpacket_limit" field to struct usb_ep

This patch adds "maxpacket_limit" to struct usb_ep. This field contains
maximum value of maxpacket supported by driver, and is set in driver probe.
This value should be used by autoconfig() function, because value of field
"maxpacket" is set to value from endpoint descriptor when endpoint becomes
enabled. So when autoconfig() function will be called again for this endpoint,
"maxpacket" value will contain wMaxPacketSize from descriptior instead of
maximum packet size for this endpoint.

For this reason this patch adds new field "maxpacket_limit" which contains
value of maximum packet size (which defines maximum endpoint capabilities).
This value is used in ep_matches() function used by autoconfig().

Value of "maxpacket_limit" should be set in UDC driver probe function, using
usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
set choosen value to both "maxpacket_limit" and "maxpacket" fields.

This patch modifies UDC drivers by adding support for maxpacket_limit.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# c3505f04 07-Nov-2013 Felipe Balbi <balbi@ti.com>

usb: gadget: epautoconf: switch over to usb_endpoint_type()

we have a helper to fetch endpoint type out of
a descriptor, let's use it.

Signed-off-by: Felipe Balbi <balbi@ti.com>


# dc995fc2 06-Sep-2012 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: gadget: libcomposite: add epautoconf.c to libcomposite

This patch adds epautoconf.c into libcomposite and updates all gadgets.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# e87bb711 06-Sep-2012 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: gadget: move global vars from epautoconf into struct usb_gadget

epautoconf has two global variables which count the endpoint number of
last assigned endpoint.
This patch removes the global variable and keeps it as per (UDC) gadget.
While here, the ifdef is removed and now the in and outpoint are
enumerated unconditionally. The dwc3 for instance supports 32 endpoints
in total.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 609ca228 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>


# c74c9300 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>


# 7422ba53 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>


# d327ab5b 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>


# 28c9fc68 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>


# 29cc8897 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>


# bdb64d72 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>


# a59d6b91 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>


# 48767a4e 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>


# 553fbcde 13-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>


# 28824b18 04-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>


# f2984a33 08-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>


# 90f79768 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>


# 767ffec1 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>


# 3a8a3b1c 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>


# 551509d2 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>


# bb9496c6 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>


# a4c39c41 19-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>


# 0e530b45 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>


# 9454a57a 04-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>


# a9475226 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>


# 01ee7d70 25-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>


# 5f848137 16-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>


# a353678d 06-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>


# 1da177e4 16-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!