History log of /drivers/usb/gadget/ether.c
Revision Date Author Comments
90ab5ee94171b3e28de6bb42ee30b527014e0be7 13-Jan-2012 Rusty Russell <rusty@rustcorp.com.au> module_param: make bool parameters really bool (drivers & misc)

module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>
04617db7aa688598ebd3fce20691d31a5e778b45 27-Jun-2011 Paul Zimmerman <Paul.Zimmerman@synopsys.com> usb: gadget: add SS descriptors to Ethernet gadget

Add SuperSpeed descriptors to the Network USB
function drivers.

This has been lightly tested using a Linux host.
I was able to ssh from device to host and host to
device, no obvious problems seen.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
35a0e0bf6f6b2b900d461e9f35c286953b2b1afc 29-Jun-2011 Tatyana Brokhman <tlinder@codeaurora.org> usb: gadget: add max_speed to usb_composite_driver

This field is used by the Gadget drivers to specify
the maximum speed they support, meaning: the maximum
speed they can provide descriptors for.

The driver speed will be set in consideration of this
value.

[ balbi@ti.com : dropped the ifdeffery ]

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>
c9bfff9c98671ad50e4abbfe1ab606a9957f7539 12-Aug-2010 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> usb gadget: don't save bind callback in struct usb_configuration

The bind function is most of the time only called at init time so there
is no need to save a pointer to it in the configuration structure.

This fixes many section mismatches reported by modpost.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[m.nazarewicz@samsung.com: updated for -next]
Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
07a18bd716ed5dea336429404b132568cfaaef95 12-Aug-2010 Michal Nazarewicz <m.nazarewicz@samsung.com> usb gadget: don't save bind callback in struct usb_composite_driver

The bind function is most of the time only called at init time so there
is no need to save a pointer to it in the composite driver structure.

This fixes many section mismatches reported by modpost.

Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e12995ec8f8d99f2a339541fc28998af2d60af0f 12-Aug-2010 Michal Nazarewicz <m.nazarewicz@samsung.com> USB: Revert "USB: gadget: section mismatch warning fixed"

This reverts a commit which proposed an invalid solution
for a section mismatch. Next 3 commits will fix it correctly.

Conflicts:

drivers/usb/gadget/mass_storage.c

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
89ba85d4015b7fa738b35bcc228075c117a9a578 21-Jun-2010 Michal Nazarewicz <m.nazarewicz@samsung.com> USB: gadget: section mismatch warning fixed

In may gadgets bind and bind like functions were in a init section
as they were only run during initialisation. However, being
callback functions they were referenced from structures in “normal”
sections. Changing the tag from “__init” to “__ref” fixes the
warnings.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c9188ad25dde86e929bd567166b5a1366a3a9059 28-Dec-2009 Robert P. J. Day <rpjday@crashcourse.ca> USB: Correct CONFIG variable typo.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
396cda90d228d0851f3d64c7c85a1ecf6b8ae1e8 30-Nov-2009 Michal Nazarewicz <m.nazarewicz@samsung.com> USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDIS

If g_ether and g_multi are both built CONFIG_USB_ETH_RNDIS symbol
may be redefined in the later and, whats even worse, g_ether's settings
may affect g_multi's. This adds a USB_ETH_RNDIS symbol defined at the
beginning of ether.c and multi.c according toproper KConfig settings.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4238ef54690ea502a22aab41c377f23588c387d0 14-Oct-2009 Brian Niebuhr <bniebuhr3@gmail.com> USB: gadget: Fix EEM driver comments and VID/PID

Remove expository comments and fix USB VID and PID

Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9b39e9ddedeef48569f8aac60a7b4c1fbb127c7d 14-Aug-2009 Brian Niebuhr <bniebuhr@efjohnson.com> USB: gadget: Add EEM gadget driver

This patch adds a CDC EEM ethernet gadget driver. CDC EEM is a newer
USB ethernet specification that uses a simpler interface than the older
CDC ECM. This makes CDC EEM usable by a wider set of USB hardware.
By default the ethernet gadget will still use CDC ECM/Subset, but kernel
configuration and/or a module parameter will allow alternative use of
the CDC EEM protocol.

Changes since last version:
- Brought in missing RNDIS changes that caused compile error
- Modified 'sentinel CRC' checking to match EEM host driver

Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4e19f220d4e84f5728cb7edde36352ab425cfba4 19-Jun-2009 David Brownell <dbrownell@users.sourceforge.net> USB: RNDIS gadget, fix issues talking from PXA

The reworked Ethernet gadget has an RNDIS interop problem when used
with the CDC subset driver ... e.g. on PXA 2xx and 3xx hardware,
which currently has a hard time talking to MS-Windows hosts.

The issue is that Microsoft requires USB_CLASS_COMM. Fix by tweaking
the CDC subset driver to not switch to USB_CLASS_VENDOR_SPEC if RNDIS
is used in some other device configuration.

[ UPDATED: some "statements" were comma-terminated; fix that. ]

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Aric Blumer <aric@sdgsystems.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
36e893d25aa2abcae0f11ef263de0e8322641386 12-Sep-2008 David Brownell <dbrownell@users.sourceforge.net> usb gadget: USB_GADGET_VBUS_DRAW Kconfig option

Offer a "how much VBUS power to request" configuration option
for USB gadgets that aren't using board-specific customization
of their gadget or (composite) configuration drivers.

Also remove a couple pointless "depends on USB_GADGET" bits
from the Kconfig text; booleans inside an "if USB_GADGET" will
already have that dependency.

Based on a patch from Justin Clacherty.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Justin Clacherty <justin@redfish-group.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
33376c1c043c05077b4ac79c33804266f6c45e49 19-Aug-2008 David Brownell <dbrownell@users.sourceforge.net> usb gadget: link fixes for network gadget

Change how the Ethernet/RNDIS gadget driver builds: don't
use separate compilation, since it works poorly when key
parts are library code (with init sections etc). Instead
be as close as we can to "gcc --combine ...".

This is a bit more complicated than most of the others
because it had to resolve a few symbol collisions.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b6c63937001889af6fe431aaba97e59d04e028e7 25-Jul-2008 Arjan van de Ven <arjan@linux.intel.com> Rename WARN() to WARNING() to clear the namespace

We want to use WARN() as a variant of WARN_ON(), however a few drivers are
using WARN() internally. This patch renames these to WARNING() to avoid the
namespace clash. A few cases were defining but not using the thing, for those
cases I just deleted the definition.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Greg KH <greg@kroah.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
0391c828ce75cc71ae301946699a6f2d515fd99d 20-Jun-2008 David Brownell <dbrownell@users.sourceforge.net> usb ethernet gadget: use composite gadget framework

Building on the previous patches which took code from this driver and
pakaged it in more-reusable network "function" components, this patch
gets rid of the original code and uses those components instead.

As seen with the other gadget driver conversions, the resulting code
is much easier to understand and (presumably) work with. In this case
that's especially true, since the Ethernet gadget had grown to handle
three (!) different Ethernet-over-USB protocols. This modularization
should make it much easier to add a fourth option for the newish CDC
"Ethernet Emulation Model" (or EEM).

Lightly tested, primarily at full speed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15b2d2b529d11449910ac86f6093124bce8f6103 20-Jun-2008 David Brownell <dbrownell@users.sourceforge.net> usb gadget: RNDIS cleanups

Some cleanup to the RNDIS code:

- Minor bugfix: rndis_unit() is supposed to put the link into the
RNDIS_UNINITIALIZED state, which does not mean "unused". There's
a separate method to stop using the link. (Bug doesn't affect
anything right now because of how the code is used.)

- Reduce coupling between RNDIS code and its user(s), in preparation
for updates in that code:

* Decouple RNDIS_RESPONSE_AVAILABLE notifications from net_device
by passing just a void* handle. (Also, remove the unused return
value of the notification callback.)
* When it needs a copy of net_device stats, just ask for it

- Remove unused/untested code backing various never-used OIDs:

* RNDIS_PM, RNDIS_WAKEUP ... "should" get implemented, but the
relevant docs were unclear, ambguous, and incomplete. Someone
with access to the Hidden Gospels (maybe in the EU?) might be
able to figure out what this should do.
* RNDIS_OPTIONAL_STATS ... as the name suggests, optional. Never
implemented in part because not all the semantics were clear.
* OID_GEN_RNDIS_CONFIG_PARAMETER, which has been #if 0 forever.

- A few small whitespace fixes

Plus switch the VERBOSE symbol over to the newer VERBOSE_DEBUG style.

There should be no functional changes because of this patch; it's a
net source code shrink (because of the dead/unused code removal) and
a small object code shrink (a couple hundred bytes on ARMv5).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7071a3ce0ca058ad2a9e3e8c33f30fb0bce62005 02-May-2008 Kay Sievers <kay.sievers@vrfy.org> USB: usb dev_name() instead of dev->bus_id

The bus_id field is going away, use the dev_name() function instead.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7a8576204333d133d58cbcc59dacf49a5546e3e4 23-Jun-2008 Philipp Zabel <philipp.zabel@gmail.com> [ARM] 5120/1: pxa: correct platform driver names for PXA25x and PXA27x UDC drivers

The pxa2xx_udc.c driver is renamed to pxa25x_udc.c (the platform
driver name changes from pxa2xx-udc to pxa25x-udc) and the
platform driver name of pxa27x_udc.c is fixed to pxa27x-udc.
pxa_device_udc in devices.c is split into pxa25x and pxa27x flavors
and the pxa27x_device_udc is enabled in pxa27x.c.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Including from Ian Molton:

Fixes for mistakes left over from the PXA2{5,7}X UDC split.

Signed-off-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
d75379a538708c5a8e3dba673d866c3f5f856620 19-Apr-2008 Robert Jarzmik <rjarzmik@free.fr> usb: pxa27x_udc driver

Adds pxa27x udc driver to support USB peripherals on pxa27x chips.

The driver is compatible with: Gadget Zero, the File Storage
gadget, and the Ethernet gadget (only in CDC subset mode).

The driver can't properly support multiple interfaces, because
of hardware bugs without possible workaround. That means no
RNDIS support from g_ether, and no CDC ACM support in g_serial.

Signed-off-by: Robert Jarzmik <rjarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
441b62c1edb986827154768d89bbac0ba779984f 04-Mar-2008 Harvey Harrison <harvey.harrison@gmail.com> USB: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
41566bcf35a8b23ce4715dadb5acfd1098c1d3e4 19-Feb-2008 Jan Altenberg <jan.altenberg@linutronix.de> USB: gadget: queue usb USB_CDC_GET_ENCAPSULATED_RESPONSE message

commit 0cf4f2de0a0f4100795f38ef894d4910678c74f8 introduced a bug, which
prevents sending an USB_CDC_GET_ENCAPSULATED_RESPONSE message. This
breaks the RNDIS initialization (especially / only Windoze machines
dislike this behavior...).

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Jan Altenberg <jan.altenberg@linutronix.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e7b13ec9235b9fded90f826ceeb8c34548631351 19-Dec-2007 David Brownell <david-b@pacbell.net> USB: gadget: ethernet error path potential oops fix

Fix potential (never-observed) oops on rare error path,
bugzilla #9594. Fix uses the same test as used earlier.

Also make the adjacent "else" block look like an "else" block
instead of hiding like a bug.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
5395353e0c8272fe73ac914acd7e4add0da2bef0 02-Oct-2007 Benedikt Spranger <bene@linutronix.de> usb-gadget-ether: prevent oops caused by error interrupt race

Fix a longstanding race in the Ethernet gadget driver, which can cause an
oops on device disconnect. The fix is just to make the TX path check
whether its freelist is empty. That check is otherwise not necessary,
since the queue is always stopped when that list empties (and restarted
when request completion puts an entry back on that freelist).

The race window starts when the network code decides to transmit a packet,
and ends when hard_start_xmit() grabs the freelist lock. When disconnect()
is called inside that window, it shuts down the TX queue and breaks the
otherwise-solid assumption that packets are never sent through a TX queue
that's stopped.

Signed-off-by: Benedikt Spranger <bene@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
0cf4f2de0a0f4100795f38ef894d4910678c74f8 02-Aug-2007 David Brownell <david-b@pacbell.net> USB: gadget: ethernet gadget cleanups, shrinkage

Clean up the ethernet gadget, using newer APIs and conventions:

- gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal

- Remove many now-needless #includes

- Use the VERBOSE_DEBUG convention

- Minor whitespace fixes.

- Fix a warning from "sparse".

Surprisingly, this saved about 2K of code (16%) on a fullspeed-only
ARMv4 platform. I'm bit puzzled by that (it's so much!), but approve
of the result.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
10d024c1b2fd58af8362670d7d6e5ae52fc33353 17-Sep-2007 Ralf Baechle <ralf@linux-mips.org> [NET]: Nuke SET_MODULE_OWNER macro.

It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it. The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.

[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
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>
55d402d854ade6b63b26e958f201ee2ef00b7b15 17-Jul-2007 Thomas Dahlmann <thomas.dahlmann@amd.com> USB: amd5536 UDC driver (in GEODE southbridge)

Driver for the AMD5536 UDC, as found in the AMD Geode CS5536 (southbridge).
This is a high speed DMA-capable controller, which can also be used in
OTG configurations (which are not supported by this patch).

Acked-by: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
55b3fd41b0846929f68b5fb1058ad8077289f584 14-Jun-2007 Haavard Skinnemoen <hskinnemoen@atmel.com> usb gadget: Rename husb2dev -> usba

husb2dev was the internal name of the USB Device Controller on
AT32AP7000. Rename it to "atmel_usba", which is closer to the official
name used in documentation and marketing material.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7f9985c2e4e5555b750d6f891b4923e63cc834c1 09-May-2007 David Brownell <david-b@pacbell.net> USB: usb gadget, dead config cleanup

Remove some dead CONFIG_ symbols, and document the status of a few others.
The "gadget_chips.h" references are by and large to drivers which exist
but haven't yet been submitted for merging to the main 2.6 tree.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4cf2503c6801a69fee25030475eceeefb36d1b56 10-May-2007 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> USB: m66592-udc: peripheral controller driver for M66592

I would like to submit Renesas M66592 udc driver.

The M66592 is Renesas USB 2.0 peripheral controller.
This controller supports USB high-speed.

The driver has been tested Gadget Zero, Ethernet Gadget,
File-backed Storage Gadget, and passed usbtest script.

Signed-off-by : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e63340ae6b6205fef26b40a75673d1c9c0c8bb90 08-May-2007 Randy Dunlap <randy.dunlap@oracle.com> header cleaning: don't include smp_lock.h when not used

Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d2eef1fc99640f7de302dcdbcfbdfcec2eef13f6 23-Apr-2007 Li Yang <leoli@freescale.com> USB: update gadget files for fsl_usb2_udc driver

Update gadget_chip.c, ether.c for newly added Freescale Highspeed USB
device driver.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b8d297c93a888fcd4d74ba0bbeeabe9b84caf514 23-Apr-2007 Erik Hovland <erik@hovland.org> usb ethernet gadget, workaround network stack API glitch

Another workaround for the glitch in the network layer, whereby one call
ignores the (otherwise kernel-wide) convention that free() calls should
not oops when passed nulls. This code already handles that API glitch in
most other paths.

From: Erik Hovland <erik@hovland.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 26-Apr-2007 Arnaldo Carvalho de Melo <acme@redhat.com> [ETH]: Make eth_type_trans set skb->dev like the other *_type_trans

One less thing for drivers writers to worry about.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
cd354f1ae75e6466a7e31b727faede57a1f89ca5 14-Feb-2007 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] remove many unneeded #includes of sched.h

After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ef3ff462a31987629c4d0488550fbbb66fbfcc35 27-Feb-2006 H�vard Skinnemoen <hskinnemoen@atmel.com> USB: usb ethernet gadget recognizes HUSB2DEV

Define DEV_CONFIG_CDC when compiling for HUSB2DEV.

From: H�vard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
11d5489873facd395653a4ee14669751bfe9bab5 12-Dec-2006 David Brownell <david-b@pacbell.net> USB: ethernet gadget interop with MCCI Windows driver

It turns out that minor tweaks to the "CDC Subset" support in the Ethernet
gadget driver, just updating a config descriptor, let it be automagically
recognized by a Windows driver supported by MCCI.

This patch adds those descriptors, so systems using PXA 255 processors
(like Gumstix etc) can interop with those commercial MS-Windows drivers.
This is a Good Thing since Microsoft's RNDIS code has bugginess issues,
which are unfortunately compounded by "won't fix" issues as well as "the
published specs are incomplete and wrong" issues. Being able to talk to
the MCCI driver gives Windows users another connectivity option. (MCCI
also has CDC Ethernet drivers, which can help most non-PXA processors.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
d8126a0c23b95d8f49a8f4b49191691f9a09ae4a 13-Nov-2006 David Brownell <david-b@pacbell.net> usb/gadget/ether.c minor manycast tweaks

Minor cleanup/clarification in the ethernet gadget driver, using standard
calls to test for Ethernet multicast and broadcast addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c4028958b6ecad064b1a6303a6a5906d4fe48d73 22-Nov-2006 David Howells <dhowells@redhat.com> WorkStruct: make allyesconfig

Fix up for make allyesconfig.

Signed-Off-By: David Howells <dhowells@redhat.com>
96b644bdec977b97a45133e5b4466ba47a7a5e65 02-Oct-2006 Serge E. Hallyn <serue@us.ibm.com> [PATCH] namespaces: utsname: use init_utsname when appropriate

In some places, particularly drivers and __init code, the init utsns is the
appropriate one to use. This patch replaces those with a the init_utsname
helper.

Changes: Removed several uses of init_utsname(). Hope I picked all the
right ones in net/ipv4/ipconfig.c. These are now changed to
utsname() (the per-process namespace utsname) in the previous
patch (2/7)

[akpm@osdl.org: CIFS fix]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrey Savochkin <saw@sw.ru>
Cc: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
729ed6d502b45fd3b5c3b21c3ceaa63a8fe7cc43 30-Aug-2006 David Brownell <david-b@pacbell.net> USB: ethernet gadget avoids zlps for musb_hdrc

For systems using the Mentor HDRC controllers we get better TX DMA throughput
if we can avoid falling back to PIO to write zero length packets ... so tell
the driver to avoid ZLPs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
55359021b9a75a6d61a49ca8b9a1209793cd55f7 22-Aug-2006 Eric Sesterhenn <snakebyte@gmx.de> USB: fix signedness issue in drivers/usb/gadget/ether.c

another gcc 4.1 signdness warning:

drivers/usb/gadget/ether.c:2028: warning: comparison of unsigned expression < 0 is always false

length is assigned the value of usb_ep_queue() which returns an int.
Directly after this it is checked for < 0, which can never be true. Making
length an int makes the error check work again.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bfb2c965d669045b7629fd577b7834c87c2dfd54 30-Jun-2006 Tony Lindgren <tony@atomide.com> USB: Allow compile in g_ether, fix typo

Allows compiling g_ether in and fixes a typo with MUSB_HDRC

Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
789851cf0005b946557340c9bbfc7728906cdbfc 22-Aug-2006 David Brownell <david-b@pacbell.net> usb gadget: g_ether spinlock recursion fix

The new spinlock debug code turned up a spinlock recursion bug in the
Ethernet gadget driver on a disconnect path; it would show up with any
UDC driver where the cancellation of active requests was synchronous,
rather than e.g. delayed until a controller's completion IRQ.

That recursion is fixed here by creating and using a new spinlock to
protect the relevant lists.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
a8c28f2389942bab376e39351d27525499630248 13-Jun-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: move <linux/usb_cdc.h> to <linux/usb/cdc.h>

This moves <linux/usb_cdc.h> to <linux/usb/cdc.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>
7e27f18c8a37ffb95f677e4e9c3cca818a3e9eb1 13-Jun-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: whitespace removal from usb/gadget/ether

This removes extraneous whitespace from the Ethernet/RNDIS gadget driver.
It's all space-at-EOL, spaces-before-tabs, or tabs-then-spaces.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4186c29ca199063facdda49851b4c863699687b1 07-Jun-2006 Matt Reimer <mattjreimer@gmail.com> [PATCH] USB: trivial DEBUG message correction in gadget ether driver

Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e1394b49ee70bd8686acaf969e4d61b57da1c263 02-Apr-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: g_ether, highspeed conformance fix

Be sure to record the peripheral's ep0 maxpacket size BEFORE using
that to initialize the (high speed) device qualifier; that helps a
lot with USBCV testing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1afc64a3d68174fe524f11d92e045a30eacc927e 18-Feb-2006 Aras Vaichas <arasv@magellan-technology.com> [PATCH] USB: ethernet gadget driver section fixups

This patch allows you to set the iSerialNumber field in the
usb_device_descriptor structure for your USB ethernet gadget.

It also changes the parameters shown through sysfs so they're
no longer declared as __initdata, preventing potential oopses.

That's most useful for the Ethernet addresses, which may in
some cases be random "locally administered" addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
329af28b141ab4ae847aff1362864c4cc332641f 18-Feb-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: gadget driver section fixups

This adds __init section annotations to gadget driver bind() routines to
remove calls from .text into .init sections (for endpoint autoconfig).
Likewise it adds __exit section annotations to their unbind() routines.

The specification of the gadget driver register/unregister functions is
updated to explicitly allow use of those sections.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1c05ad4447e4ecbd61647c102fb6f2f5a6634ff3 25-Jan-2006 David Brownell <david-b@pacbell.net> [PATCH] recognize three more usb peripheral controllers

This adds declarations for three USB peripheral controllers:

- Two high speed USB cores that can be licensed from Mentor Graphics
to be integrated into silicon:

* "musbhsfc" is for peripherals only, as found in for example the
IBM/AMCC 44EP processors.

* "musbhdrc" is OTG-capable (dual role), and is found in various
products including OMAP 2430 and the new DaVinci SOCs.

The "musbh" standing for "Mentor USB Highspeed", the rest standing
for "Function Controller" or "Dual Role Controller" (OTG-capable).

- The full speed controller on the FreeScale MPC8272.

Adding these definitions just allows gadget driver code to handle any
controller-specific logic; controller drivers are quite separate.

Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7802ac5c29d135345db1b06f9167075cd9f2d675 22-Jan-2006 David Brownell <david-b@pacbell.net> [PATCH] USB: minor gadget/rndis tweak

Resove a minor FIXME: don't change MTU while RNDIS link is active,
the other end won't expect such things...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d78967fb035aeb839a047ae69ce5f1ff39288a8d 06-Jan-2006 Russell King <rmk@arm.linux.org.uk> [PATCH] Remove usb gadget generic driver methods

USB gadget drivers make no use of these, remove the pointless
comments.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d0d5049fb02fc1082c17e08deecd6fed8db549b6 10-Oct-2005 Ben Dooks <ben@fluff.org.uk> [PATCH] USB: gadget drivers - add .owner initialisation

Ensure the the device_driver and usb_gadget_driver
have their .owner fields initialised to associate
the module owner to the driver.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
55016f10e31bb15b85d8c500f979dfdceb37d548 21-Oct-2005 Al Viro <viro@zeniv.linux.org.uk> [PATCH] gfp_t: drivers/usb

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
91e79c91fab10f5790159d8d0c1d16da2a9653f9 14-Jul-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: Gadget library: centralize gadget controller numbers

This patch centralizes the assignment of bcdDevice numbers for different
gadget controllers. This won't improve the object code at all, but it
does save a lot of repetitive and error-prone source code ... and will
simplify the work of supporting a new controller driver, since most new
gadget drivers will no longer need patches (unless some hardware quirks
limit USB protocol messaging).

Added minor cleanups and identifer hooks for the UDC in the Freescale
iMX series processors.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e828264ee797d40b1df99fe88c6acfc0f36df639 29-Jun-2005 Ian Campbell <icampbell@arcom.com> [PATCH] USB: gadget/ether build fixes.

I also needed the following on 2.6.13-rc1 without CONFIG_USB_ETH_RNDIS,
symbol fs_status_desc isn't available in that case on PXA255.

This builds both with and without ETH_RNDIS, but I haven't actually
tested either.

Signed-off-by: Ian Campbell <icampbell@arcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
05f33400307cfe9d89dbeca659731b9055fefbf8 29-Jun-2005 Ian Campbell <icampbell@arcom.com> [PATCH] USB: gadget/ether fixes

Signed-off-by: Ian Campbell <icampbell@arcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5db539e49fc7471e23bf3c94ca304f008cb7b7f3 23-Jun-2005 Olav Kongas <ok@artecdesign.ee> [PATCH] USB: Fix kmalloc's flags type in USB

Greg,

This patch fixes the kmalloc() flags argument type in USB
subsystem; hopefully all of its occurences. The patch was
made against patch-2.6.12-git2 from Jun 20.

Cleanup of flags for kmalloc() in USB subsystem.

Signed-off-by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
822e14ac222d1dad3f5393b75603f0455aebbefc 13-Jun-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: resolve ethernet gadget build glitch on pxa

This fixes a build error on pxa25x processes with pxa2xx_udc and

CONFIG_USB_ETH=m
# CONFIG_USB_ETH_RNDIS is not set

The error is because on that CPU there's no status transfer support
except with RNDIS. Workaround, enable the RNDIS support too.

Signed-off-by: Ian Campbell <icampbell@arcom.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
45e45ab45c266642276d01e56d9fb5dccbfad960 16-May-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: fix drivers/usb/gadget/ether.c compile error

This fixes a compile glitch with CONFIG_USB_ETH_RNDIS disabled, and
replaces some inline #ifdeffery (and other code) with inline functions
which can evaluate to constants.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1bbc169621cbe502b9143a27eb12802a0f1d43a0 07-May-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: gadget driver updates (SETUP api change)

This updates most of the gadget framework to expect SETUP packets use
USB byteorder (matching the annotation in <linux/usb_ch9.h> and usage
in the host side stack):

- definition in <linux/usb_gadget.h>
- gadget drivers: Ethernet/RNDIS, serial/ACM, file_storage, gadgetfs.
- dummy_hcd

It also includes some other similar changes as suggested by "sparse",
which was used to detect byteorder bugs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
907cba35f7f24587f0eff60073e1f4e1e01c976d 28-Apr-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: ethernet gadget updates (mostly cleanup)

Some cleanup for the the Ethernet part of the Ethernet/RNDIS gadget driver:

- Remove remnants of ancient endpoint init logic; this is simpler, clearer

- Save a smidgeon of space in the object file

- Get rid of some #ifdeffery, mostly by using some newish inlines

- Reset more driver state as part of USB reset

- Remove a needless wrapper around an RNDIS call

- Improve and comment the status interrupt handling:
* RNDIS sometimes needs to queue these transfers (rarely in normal
cases, but reproducibly while Windows was deadlocking its USB stack)
* Mark requests as busy/not

- Enable the SET_NETDEV_DEV() call; sysfs seems to behave sanely now

This is a net shrink of source code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
340600ab4cf0cc41efd01a65af97ebb7d35a7f85 28-Apr-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: rndis updates (mostly cleanup)

Some bugfixes and lots of cleanup (net code shrink):

- On reset, force the RNDIS state machine its initial state

- Hook up the RNDIS (outgoing) filters to the CDC mechanism

- Lots of cleanup:
* Eliminate duplicate copy of OID table;
* Unify handlying of the OID "query" response data pointer;
* Reduce code duplication for calculating query response lengths;
* Remove some checks for "can't happen" errors;
* Get rid of debugging #ifdefs by making the debug flag an integer level

Most of the patch, by volume, relates to those query response cleanups.
It incidentally shaves off a few hundred bytes of object code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
093cf723b2b06d774929ea07982f6a466ff22314 04-May-2005 Steven Cole <elenstev@mesatop.com> [PATCH] USB: Spelling fixes for drivers/usb.

Here are some spelling corrections for drivers/usb.

cancelation -> cancellation
succesful -> successful
cancelation -> cancellation
decriptor -> descriptor
Initalize -> Initialize
wierd -> weird
Protocoll -> Protocol
occured -> occurred
successfull -> successful
Procesing -> Processing
devide -> divide
Isochronuous -> Isochronous
noticable -> noticeable
Basicly -> Basically
transfering -> transferring
intialize -> initialize
Incomming -> Incoming
additionnal -> additional
asume -> assume
Unfortunatly -> Unfortunately
retreive -> retrieve
tranceiver -> transceiver
Compatiblity -> Compatibility
Incorprated -> Incorporated
existance -> existence
Ununsual -> Unusual

Signed-off-by: Steven Cole <elenstev@mesatop.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6cdee106e7571751ecc0e9f96606322f88b64a8d 19-Apr-2005 David Brownell <david-b@pacbell.net> [PATCH] usb gadget: ethernet/rndis updates

Updates to the Ethernet/RNDIS gadget driver (mostly for RNDIS):

- Fix brown-paper bag goof with RNDIS packet TX ... the wrong length
field got set, so Windows would ignore data packets it received.

- More consistent handling of CDC output filters (but not yet hooking
things up so RNDIS uses the mechanism).

- Zerocopy RX for RNDIS packets too (saving CPU cycles).

- Use the pre-allocated interrupt/status request and buffer, rather
than allocating and freeing one of each every few seconds (which
could fail).

- Some more "sparse" tweaks, making both dual-speed and single-speed
configurations happier.

- RNDIS speeds are reported in units of 100bps, not bps.

Plus two minor cleanups (whitespace, messaging).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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!