aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch31
-rw-r--r--driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch240
-rw-r--r--series14
-rw-r--r--usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch31
-rw-r--r--usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch163
-rw-r--r--usb.current/usb-isp1362-hcd-fix-double-lock.patch66
-rw-r--r--usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch43
-rw-r--r--usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch53
-rw-r--r--usb/usb-gadget-composite-added-disconnect-callback.patch45
-rw-r--r--usb/usb-gadget-f_mass_storage-added-eject-callback.patch235
-rw-r--r--usb/usb-gadget-g_ether-updated-inf-file.patch268
-rw-r--r--usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch211
-rw-r--r--usb/usb-gadget-g_multi-code-clean-up-and-refactoring.patch450
-rw-r--r--usb/usb-gadget-g_serial-inf-file-updated.patch238
14 files changed, 2088 insertions, 0 deletions
diff --git a/driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch b/driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch
new file mode 100644
index 00000000000000..21135bb0c9bb4d
--- /dev/null
+++ b/driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch
@@ -0,0 +1,31 @@
+From u.kleine-koenig@pengutronix.de Mon Jun 21 14:39:28 2010
+From: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
+Date: Mon, 21 Jun 2010 16:11:45 +0200
+Subject: Driver core: move platform device creation helpers to .init.text (if MODULE=n)
+To: Greg KH <greg@kroah.com>
+Cc: Greg Kroah-Hartman <gregkh@suse.de>, Magnus Damm <damm@opensource.se>, "Rafael J. Wysocki" <rjw@sisk.pl>, Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>, Paul Mundt <lethal@linux-sh.org>, linux-kernel@vger.kernel.org
+Message-ID: <1277129511-2732-2-git-send-email-u.kleine-koenig@pengutronix.de>
+
+
+Platform devices should only be called by init code, so it should be
+possible to move creation helpers to .init.text -- at least if modules
+are disabled.
+
+Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/base/platform.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -357,7 +357,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregi
+ *
+ * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
+ */
+-struct platform_device *platform_device_register_resndata(
++struct platform_device *__init_or_module platform_device_register_resndata(
+ struct device *parent,
+ const char *name, int id,
+ const struct resource *res, unsigned int num,
diff --git a/driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch b/driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch
new file mode 100644
index 00000000000000..c78b82887aa8b4
--- /dev/null
+++ b/driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch
@@ -0,0 +1,240 @@
+From u.kleine-koenig@pengutronix.de Mon Jun 21 14:38:47 2010
+From: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
+Date: Mon, 21 Jun 2010 16:11:44 +0200
+Subject: Driver core: reduce duplicated code for platform_device creation
+To: Greg KH <greg@kroah.com>
+Cc: Randy Dunlap <rdunlap@xenotime.net>, Dmitry Torokhov <dtor@mail.ru>, Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>, Anisse Astier <anisse@astier.eu>, Greg Kroah-Hartman <gregkh@suse.de>, Magnus Damm <damm@opensource.se>, "Rafael J. Wysocki" <rjw@sisk.pl>, Paul Mundt <lethal@linux-sh.org>, Eric Miao <eric.y.miao@gmail.com>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
+Message-ID: <1277129511-2732-1-git-send-email-u.kleine-koenig@pengutronix.de>
+
+
+This makes the two similar functions platform_device_register_simple
+and platform_device_register_data one line inline functions using a new
+generic function platform_device_register_resndata.
+
+Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/DocBook/device-drivers.tmpl | 1
+ drivers/base/platform.c | 104 +++++++-----------------------
+ include/linux/platform_device.h | 62 ++++++++++++++++-
+ 3 files changed, 85 insertions(+), 82 deletions(-)
+
+--- a/Documentation/DocBook/device-drivers.tmpl
++++ b/Documentation/DocBook/device-drivers.tmpl
+@@ -111,6 +111,7 @@ X!Edrivers/base/attribute_container.c
+ <!--
+ X!Edrivers/base/interface.c
+ -->
++!Iinclude/linux/platform_device.h
+ !Edrivers/base/platform.c
+ !Edrivers/base/bus.c
+ </sect1>
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -344,108 +344,56 @@ void platform_device_unregister(struct p
+ EXPORT_SYMBOL_GPL(platform_device_unregister);
+
+ /**
+- * platform_device_register_simple - add a platform-level device and its resources
+- * @name: base name of the device we're adding
+- * @id: instance id
+- * @res: set of resources that needs to be allocated for the device
+- * @num: number of resources
++ * platform_device_register_resndata - add a platform-level device with
++ * resources and platform-specific data
+ *
+- * This function creates a simple platform device that requires minimal
+- * resource and memory management. Canned release function freeing memory
+- * allocated for the device allows drivers using such devices to be
+- * unloaded without waiting for the last reference to the device to be
+- * dropped.
+- *
+- * This interface is primarily intended for use with legacy drivers which
+- * probe hardware directly. Because such drivers create sysfs device nodes
+- * themselves, rather than letting system infrastructure handle such device
+- * enumeration tasks, they don't fully conform to the Linux driver model.
+- * In particular, when such drivers are built as modules, they can't be
+- * "hotplugged".
+- *
+- * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
+- */
+-struct platform_device *platform_device_register_simple(const char *name,
+- int id,
+- const struct resource *res,
+- unsigned int num)
+-{
+- struct platform_device *pdev;
+- int retval;
+-
+- pdev = platform_device_alloc(name, id);
+- if (!pdev) {
+- retval = -ENOMEM;
+- goto error;
+- }
+-
+- if (num) {
+- retval = platform_device_add_resources(pdev, res, num);
+- if (retval)
+- goto error;
+- }
+-
+- retval = platform_device_add(pdev);
+- if (retval)
+- goto error;
+-
+- return pdev;
+-
+-error:
+- platform_device_put(pdev);
+- return ERR_PTR(retval);
+-}
+-EXPORT_SYMBOL_GPL(platform_device_register_simple);
+-
+-/**
+- * platform_device_register_data - add a platform-level device with platform-specific data
+ * @parent: parent device for the device we're adding
+ * @name: base name of the device we're adding
+ * @id: instance id
++ * @res: set of resources that needs to be allocated for the device
++ * @num: number of resources
+ * @data: platform specific data for this platform device
+ * @size: size of platform specific data
+ *
+- * This function creates a simple platform device that requires minimal
+- * resource and memory management. Canned release function freeing memory
+- * allocated for the device allows drivers using such devices to be
+- * unloaded without waiting for the last reference to the device to be
+- * dropped.
+- *
+ * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
+ */
+-struct platform_device *platform_device_register_data(
++struct platform_device *platform_device_register_resndata(
+ struct device *parent,
+ const char *name, int id,
++ const struct resource *res, unsigned int num,
+ const void *data, size_t size)
+ {
++ int ret = -ENOMEM;
+ struct platform_device *pdev;
+- int retval;
+
+ pdev = platform_device_alloc(name, id);
+- if (!pdev) {
+- retval = -ENOMEM;
+- goto error;
+- }
++ if (!pdev)
++ goto err;
+
+ pdev->dev.parent = parent;
+
+- if (size) {
+- retval = platform_device_add_data(pdev, data, size);
+- if (retval)
+- goto error;
++ if (res) {
++ ret = platform_device_add_resources(pdev, res, num);
++ if (ret)
++ goto err;
+ }
+
+- retval = platform_device_add(pdev);
+- if (retval)
+- goto error;
++ if (data) {
++ ret = platform_device_add_data(pdev, data, size);
++ if (ret)
++ goto err;
++ }
+
+- return pdev;
++ ret = platform_device_add(pdev);
++ if (ret) {
++err:
++ platform_device_put(pdev);
++ return ERR_PTR(ret);
++ }
+
+-error:
+- platform_device_put(pdev);
+- return ERR_PTR(retval);
++ return pdev;
+ }
+-EXPORT_SYMBOL_GPL(platform_device_register_data);
++EXPORT_SYMBOL_GPL(platform_device_register_resndata);
+
+ static int platform_drv_probe(struct device *_dev)
+ {
+--- a/include/linux/platform_device.h
++++ b/include/linux/platform_device.h
+@@ -43,10 +43,64 @@ extern struct resource *platform_get_res
+ extern int platform_get_irq_byname(struct platform_device *, const char *);
+ extern int platform_add_devices(struct platform_device **, int);
+
+-extern struct platform_device *platform_device_register_simple(const char *, int id,
+- const struct resource *, unsigned int);
+-extern struct platform_device *platform_device_register_data(struct device *,
+- const char *, int, const void *, size_t);
++extern struct platform_device *platform_device_register_resndata(
++ struct device *parent, const char *name, int id,
++ const struct resource *res, unsigned int num,
++ const void *data, size_t size);
++
++/**
++ * platform_device_register_simple - add a platform-level device and its resources
++ * @name: base name of the device we're adding
++ * @id: instance id
++ * @res: set of resources that needs to be allocated for the device
++ * @num: number of resources
++ *
++ * This function creates a simple platform device that requires minimal
++ * resource and memory management. Canned release function freeing memory
++ * allocated for the device allows drivers using such devices to be
++ * unloaded without waiting for the last reference to the device to be
++ * dropped.
++ *
++ * This interface is primarily intended for use with legacy drivers which
++ * probe hardware directly. Because such drivers create sysfs device nodes
++ * themselves, rather than letting system infrastructure handle such device
++ * enumeration tasks, they don't fully conform to the Linux driver model.
++ * In particular, when such drivers are built as modules, they can't be
++ * "hotplugged".
++ *
++ * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
++ */
++static inline struct platform_device *platform_device_register_simple(
++ const char *name, int id,
++ const struct resource *res, unsigned int num)
++{
++ return platform_device_register_resndata(NULL, name, id,
++ res, num, NULL, 0);
++}
++
++/**
++ * platform_device_register_data - add a platform-level device with platform-specific data
++ * @parent: parent device for the device we're adding
++ * @name: base name of the device we're adding
++ * @id: instance id
++ * @data: platform specific data for this platform device
++ * @size: size of platform specific data
++ *
++ * This function creates a simple platform device that requires minimal
++ * resource and memory management. Canned release function freeing memory
++ * allocated for the device allows drivers using such devices to be
++ * unloaded without waiting for the last reference to the device to be
++ * dropped.
++ *
++ * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
++ */
++static inline struct platform_device *platform_device_register_data(
++ struct device *parent, const char *name, int id,
++ const void *data, size_t size)
++{
++ return platform_device_register_resndata(parent, name, id,
++ NULL, 0, data, size);
++}
+
+ extern struct platform_device *platform_device_alloc(const char *name, int id);
+ extern int platform_device_add_resources(struct platform_device *pdev,
diff --git a/series b/series
index 4f1c4e92366638..452fd8b5e595bc 100644
--- a/series
+++ b/series
@@ -27,6 +27,11 @@ usb.current/usb-otg-ulpi-bail-out-on-read-errors.patch
usb.current/usb-ehci-mxc-bail-out-on-transceiver-problems.patch
usb.current/usb-s3c2410-deactivate-endpoints-before-gadget-unbinding.patch
usb.current/usb-fix-oops-in-usb_sg_init.patch
+usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch
+usb.current/usb-isp1362-hcd-fix-double-lock.patch
+usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch
+usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch
+usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch
#################################
# Staging patches for 2.6.35
@@ -59,6 +64,8 @@ driver-core/driver-core-drop-__must_check-from-bus_for_each_drv.patch
driver-core/firmware-loader-use-statically-initialized-data-attribute.patch
driver-core/firmware-loader-embed-device-into-firmware_priv-structure.patch
driver-core/driver-core-use-kmemdup-in-platform_device_add_resources.patch
+driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch
+driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch
#####################################
# TTY patches for after 2.6.35 is out
@@ -154,6 +161,13 @@ usb/usb-gadget-f_fs-functionfs_add-renamed-to-functionfs_bind_config.patch
usb/usb-gadget-composite-usb_string_ids_-functions-added.patch
usb/usb-gadget-f_fs-use-usb_string_ids_n.patch
usb/usb-gadget-f_mass_storage-dead-code-removed.patch
+usb/usb-gadget-g_multi-code-clean-up-and-refactoring.patch
+usb/usb-gadget-g_ether-updated-inf-file.patch
+usb/usb-gadget-g_serial-inf-file-updated.patch
+usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch
+usb/usb-gadget-composite-added-disconnect-callback.patch
+usb/usb-gadget-f_mass_storage-added-eject-callback.patch
+
# staging stuff is now in the staging-next tree on git.kernel.org
diff --git a/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch b/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch
new file mode 100644
index 00000000000000..9534a591bd705e
--- /dev/null
+++ b/usb.current/usb-gadget-eth-fix-calculate-crc32-in-eem.patch
@@ -0,0 +1,31 @@
+From Jiri.Pinkava@vscht.cz Mon Jun 21 14:40:59 2010
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Sun, 20 Jun 2010 20:05:52 +0200
+Subject: USB: gadget eth: Fix calculate CRC32 in EEM
+To: linux-usb@vger.kernel.org, dbrownell@users.sourceforge.net
+Cc: gregkh@suse.de, bniebuhr@efjohnson.com, tj@kernel.org, stevel@netspectrum.com
+Message-ID: <4C1E5880.4050007@vscht.cz>
+
+
+CRC should be calculated for Ethernet frame, not for whole recievede EEM data.
+This bug shows rarely, because in many times len == skb->len.
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/f_eem.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/usb/gadget/f_eem.c
++++ b/drivers/usb/gadget/f_eem.c
+@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *por
+ crc = get_unaligned_le32(skb->data + len
+ - ETH_FCS_LEN);
+ crc2 = ~crc32_le(~0,
+- skb->data,
+- skb->len - ETH_FCS_LEN);
++ skb->data, len - ETH_FCS_LEN);
+ } else {
+ crc = get_unaligned_be32(skb->data + len
+ - ETH_FCS_LEN);
diff --git a/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch b/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch
new file mode 100644
index 00000000000000..67fc5e5596ec9f
--- /dev/null
+++ b/usb.current/usb-gadget-printer-fix-sleep-inside-atomic.patch
@@ -0,0 +1,163 @@
+From jslaby@suse.cz Mon Jun 21 14:19:25 2010
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Mon, 21 Jun 2010 17:02:40 +0200
+Subject: USB: gadget/printer, fix sleep inside atomic
+To: gregkh@suse.de
+Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, "Craig W. Nadler" <craig@nadler.us>, David Brownell <dbrownell@users.sourceforge.net>
+Message-ID: <1277132560-14284-1-git-send-email-jslaby@suse.cz>
+
+
+Stanse found that sleep is called inside atomic context created by
+lock_printer_io spinlock in several functions. It's used in process
+context only and some functions sleep inside its critical section. As
+this is not allowed for spinlocks, switch it to mutex.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Craig W. Nadler <craig@nadler.us>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/printer.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+--- a/drivers/usb/gadget/printer.c
++++ b/drivers/usb/gadget/printer.c
+@@ -82,7 +82,7 @@ static struct class *usb_gadget_class;
+ struct printer_dev {
+ spinlock_t lock; /* lock this structure */
+ /* lock buffer lists during read/write calls */
+- spinlock_t lock_printer_io;
++ struct mutex lock_printer_io;
+ struct usb_gadget *gadget;
+ struct usb_request *req; /* for control responses */
+ u8 config;
+@@ -567,7 +567,7 @@ printer_read(struct file *fd, char __use
+
+ DBG(dev, "printer_read trying to read %d bytes\n", (int)len);
+
+- spin_lock(&dev->lock_printer_io);
++ mutex_lock(&dev->lock_printer_io);
+ spin_lock_irqsave(&dev->lock, flags);
+
+ /* We will use this flag later to check if a printer reset happened
+@@ -601,7 +601,7 @@ printer_read(struct file *fd, char __use
+ * call or not.
+ */
+ if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) {
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return -EAGAIN;
+ }
+
+@@ -648,7 +648,7 @@ printer_read(struct file *fd, char __use
+ if (dev->reset_printer) {
+ list_add(&current_rx_req->list, &dev->rx_reqs);
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return -EAGAIN;
+ }
+
+@@ -673,7 +673,7 @@ printer_read(struct file *fd, char __use
+ dev->current_rx_buf = current_rx_buf;
+
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+
+ DBG(dev, "printer_read returned %d bytes\n", (int)bytes_copied);
+
+@@ -697,7 +697,7 @@ printer_write(struct file *fd, const cha
+ if (len == 0)
+ return -EINVAL;
+
+- spin_lock(&dev->lock_printer_io);
++ mutex_lock(&dev->lock_printer_io);
+ spin_lock_irqsave(&dev->lock, flags);
+
+ /* Check if a printer reset happens while we have interrupts on */
+@@ -713,7 +713,7 @@ printer_write(struct file *fd, const cha
+ * a NON-Blocking call or not.
+ */
+ if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) {
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return -EAGAIN;
+ }
+
+@@ -752,7 +752,7 @@ printer_write(struct file *fd, const cha
+
+ if (copy_from_user(req->buf, buf, size)) {
+ list_add(&req->list, &dev->tx_reqs);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return bytes_copied;
+ }
+
+@@ -766,14 +766,14 @@ printer_write(struct file *fd, const cha
+ if (dev->reset_printer) {
+ list_add(&req->list, &dev->tx_reqs);
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return -EAGAIN;
+ }
+
+ if (usb_ep_queue(dev->in_ep, req, GFP_ATOMIC)) {
+ list_add(&req->list, &dev->tx_reqs);
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+ return -EAGAIN;
+ }
+
+@@ -782,7 +782,7 @@ printer_write(struct file *fd, const cha
+ }
+
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+
+ DBG(dev, "printer_write sent %d bytes\n", (int)bytes_copied);
+
+@@ -820,11 +820,11 @@ printer_poll(struct file *fd, poll_table
+ unsigned long flags;
+ int status = 0;
+
+- spin_lock(&dev->lock_printer_io);
++ mutex_lock(&dev->lock_printer_io);
+ spin_lock_irqsave(&dev->lock, flags);
+ setup_rx_reqs(dev);
+ spin_unlock_irqrestore(&dev->lock, flags);
+- spin_unlock(&dev->lock_printer_io);
++ mutex_unlock(&dev->lock_printer_io);
+
+ poll_wait(fd, &dev->rx_wait, wait);
+ poll_wait(fd, &dev->tx_wait, wait);
+@@ -1461,7 +1461,7 @@ autoconf_fail:
+ }
+
+ spin_lock_init(&dev->lock);
+- spin_lock_init(&dev->lock_printer_io);
++ mutex_init(&dev->lock_printer_io);
+ INIT_LIST_HEAD(&dev->tx_reqs);
+ INIT_LIST_HEAD(&dev->tx_reqs_active);
+ INIT_LIST_HEAD(&dev->rx_reqs);
+@@ -1594,7 +1594,7 @@ cleanup(void)
+ {
+ int status;
+
+- spin_lock(&usb_printer_gadget.lock_printer_io);
++ mutex_lock(&usb_printer_gadget.lock_printer_io);
+ class_destroy(usb_gadget_class);
+ unregister_chrdev_region(g_printer_devno, 2);
+
+@@ -1602,6 +1602,6 @@ cleanup(void)
+ if (status)
+ ERROR(dev, "usb_gadget_unregister_driver %x\n", status);
+
+- spin_unlock(&usb_printer_gadget.lock_printer_io);
++ mutex_unlock(&usb_printer_gadget.lock_printer_io);
+ }
+ module_exit(cleanup);
diff --git a/usb.current/usb-isp1362-hcd-fix-double-lock.patch b/usb.current/usb-isp1362-hcd-fix-double-lock.patch
new file mode 100644
index 00000000000000..d8e8f0950af3c8
--- /dev/null
+++ b/usb.current/usb-isp1362-hcd-fix-double-lock.patch
@@ -0,0 +1,66 @@
+From jslaby@suse.cz Mon Jun 21 14:19:09 2010
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Mon, 21 Jun 2010 17:02:51 +0200
+Subject: USB: isp1362-hcd, fix double lock
+To: gregkh@suse.de
+Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Lothar Wassmann <LW@KARO-electronics.de>, Michael Hennerich <michael.hennerich@analog.com>, Bryan Wu <cooloney@kernel.org>, Mike Frysinger <vapier@gentoo.org>
+Message-ID: <1277132571-14320-1-git-send-email-jslaby@suse.cz>
+
+
+Stanse found that isp1362_sw_reset tries to take a isp1362_hcd->lock,
+but it is already held in isp1362_hc_stop. Avoid that by introducing
+__isp1362_sw_reset which doesn't take the lock and call it from
+isp1362_hc_stop. isp1362_sw_reset is then as simple as lock --
+__isp1362_sw_reset -- unlock.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Lothar Wassmann <LW@KARO-electronics.de>
+Cc: Michael Hennerich <michael.hennerich@analog.com>
+Cc: Bryan Wu <cooloney@kernel.org>
+Cc: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/isp1362-hcd.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/host/isp1362-hcd.c
++++ b/drivers/usb/host/isp1362-hcd.c
+@@ -2224,12 +2224,9 @@ static void remove_debug_file(struct isp
+
+ /*-------------------------------------------------------------------------*/
+
+-static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd)
++static void __isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd)
+ {
+ int tmp = 20;
+- unsigned long flags;
+-
+- spin_lock_irqsave(&isp1362_hcd->lock, flags);
+
+ isp1362_write_reg16(isp1362_hcd, HCSWRES, HCSWRES_MAGIC);
+ isp1362_write_reg32(isp1362_hcd, HCCMDSTAT, OHCI_HCR);
+@@ -2240,6 +2237,14 @@ static void isp1362_sw_reset(struct isp1
+ }
+ if (!tmp)
+ pr_err("Software reset timeout\n");
++}
++
++static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&isp1362_hcd->lock, flags);
++ __isp1362_sw_reset(isp1362_hcd);
+ spin_unlock_irqrestore(&isp1362_hcd->lock, flags);
+ }
+
+@@ -2418,7 +2423,7 @@ static void isp1362_hc_stop(struct usb_h
+ if (isp1362_hcd->board && isp1362_hcd->board->reset)
+ isp1362_hcd->board->reset(hcd->self.controller, 1);
+ else
+- isp1362_sw_reset(isp1362_hcd);
++ __isp1362_sw_reset(isp1362_hcd);
+
+ if (isp1362_hcd->board && isp1362_hcd->board->clock)
+ isp1362_hcd->board->clock(hcd->self.controller, 0);
diff --git a/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch b/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch
new file mode 100644
index 00000000000000..3332c336e757d5
--- /dev/null
+++ b/usb.current/usb-qcserial-fix-a-memory-leak-in-qcprobe-error-path.patch
@@ -0,0 +1,43 @@
+From axel.lin@gmail.com Mon Jun 21 14:40:38 2010
+From: Axel Lin <axel.lin@gmail.com>
+Date: Mon, 21 Jun 2010 08:44:17 +0800
+Subject: USB: qcserial: fix a memory leak in qcprobe error path
+Cc: Greg Kroah-Hartman <gregkh@suse.de>, Matthew Garrett <mjg@redhat.com>, Anssi Hannula <anssi.hannula@gmail.com>, Bernhard Rosenkraenzer <bero@arklinux.org>, linux-usb@vger.kernel.org
+Message-ID: <1277081057.15579.3.camel@mola>
+
+
+This patch adds missing kfree(data) before return -ENODEV.
+
+Signed-off-by: Axel Lin <axel.lin@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/qcserial.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/serial/qcserial.c
++++ b/drivers/usb/serial/qcserial.c
+@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *se
+ "Could not set interface, error %d\n",
+ retval);
+ retval = -ENODEV;
++ kfree(data);
+ }
+ return retval;
+ }
+@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *se
+ "Could not set interface, error %d\n",
+ retval);
+ retval = -ENODEV;
++ kfree(data);
+ }
+ return retval;
+ }
+@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *se
+ default:
+ dev_err(&serial->dev->dev,
+ "unknown number of interfaces: %d\n", nintf);
++ kfree(data);
+ return -ENODEV;
+ }
+
diff --git a/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch b/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch
new file mode 100644
index 00000000000000..86db9d73a0652c
--- /dev/null
+++ b/usb.current/usb-serial-ftdi-correct-merge-conflict-with-contec-id.patch
@@ -0,0 +1,53 @@
+From daniel.sangorrin@gmail.com Mon Jun 21 14:18:14 2010
+From: Daniel Sangorrin <daniel.sangorrin@gmail.com>
+Date: Fri, 18 Jun 2010 15:30:02 +0900
+Subject: USB: serial: ftdi: correct merge conflict with CONTEC id
+To: Andreas Mohr <andi@lisas.de>
+Cc: Greg Kroah-Hartman <gregkh@suse.de>, Radek Liboska <liboska@uochb.cas.cz>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
+Message-ID: <AANLkTimx1HWYzG0qQqP12ObWQI1eiH5SoFpRic06uN3f@mail.gmail.com>
+
+
+This patch corrects a problem with the merge of a previous
+patch to add the CONTEC identifier.
+
+I believe the merge problem occurred with the commit:
+dee5658b482e9e2ac7d6205dc876fc11d4008138
+
+Originally I submitted a patch and then they asked me to order the IDs
+and resubmit, so did I. But unfortunately in the end somehow both
+patches were merged.
+
+Signed-off-by: Daniel Sangorrin <daniel.sangorrin@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c | 1 -
+ drivers/usb/serial/ftdi_sio_ids.h | 7 -------
+ 2 files changed, 8 deletions(-)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -653,7 +653,6 @@ static struct usb_device_id id_table_com
+ { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) },
+ { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) },
+ { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) },
+- { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -501,13 +501,6 @@
+ #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */
+
+ /*
+- * Contec products (http://www.contec.com)
+- * Submitted by Daniel Sangorrin
+- */
+-#define CONTEC_VID 0x06CE /* Vendor ID */
+-#define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */
+-
+-/*
+ * Definitions for B&B Electronics products.
+ */
+ #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */
diff --git a/usb/usb-gadget-composite-added-disconnect-callback.patch b/usb/usb-gadget-composite-added-disconnect-callback.patch
new file mode 100644
index 00000000000000..89c20beef8e829
--- /dev/null
+++ b/usb/usb-gadget-composite-added-disconnect-callback.patch
@@ -0,0 +1,45 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:44:36 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:08 +0200
+Subject: USB: gadget: composite: added disconnect callback
+To: linux-usb@vger.kernel.org
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <98f552c7e1dd2d68b6eb27675f7fa3f5b211c29e.1277119876.git.m.nazarewicz@samsung.com>
+
+
+Added a disconnect() callback to composite devices which
+is called by composite glue when its disconnect callback
+is called by gadget.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Acked-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/composite.c | 2 ++
+ include/linux/usb/composite.h | 2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/drivers/usb/gadget/composite.c
++++ b/drivers/usb/gadget/composite.c
+@@ -956,6 +956,8 @@ static void composite_disconnect(struct
+ spin_lock_irqsave(&cdev->lock, flags);
+ if (cdev->config)
+ reset_config(cdev);
++ if (composite->disconnect)
++ composite->disconnect(cdev);
+ spin_unlock_irqrestore(&cdev->lock, flags);
+ }
+
+--- a/include/linux/usb/composite.h
++++ b/include/linux/usb/composite.h
+@@ -276,6 +276,8 @@ struct usb_composite_driver {
+ int (*bind)(struct usb_composite_dev *);
+ int (*unbind)(struct usb_composite_dev *);
+
++ void (*disconnect)(struct usb_composite_dev *);
++
+ /* global suspend hooks */
+ void (*suspend)(struct usb_composite_dev *);
+ void (*resume)(struct usb_composite_dev *);
diff --git a/usb/usb-gadget-f_mass_storage-added-eject-callback.patch b/usb/usb-gadget-f_mass_storage-added-eject-callback.patch
new file mode 100644
index 00000000000000..d659df76f5cec3
--- /dev/null
+++ b/usb/usb-gadget-f_mass_storage-added-eject-callback.patch
@@ -0,0 +1,235 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:44:50 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:09 +0200
+Subject: USB: gadget: f_mass_storage: added eject callback
+To: linux-usb@vger.kernel.org
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <eeff6a2401957ac2d50af8602ea08d1f913d8e0d.1277119876.git.m.nazarewicz@samsung.com>
+
+
+Added pre_eject() and post_eject() callbacks which are
+called before and after removable logical unit is ejected.
+The first can prevent logical unit from being ejected.
+
+This commit also changes the way callbacks are passed to
+the function from gadget. A fsg_operations structure has
+been created which lists all callbacks -- this is passed
+to the fsg_config.
+
+This is important because it changes the way thread_exits()
+callback is passed.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/f_mass_storage.c | 109 +++++++++++++++++++++++-------------
+ drivers/usb/gadget/mass_storage.c | 5 +
+ 2 files changed, 74 insertions(+), 40 deletions(-)
+
+--- a/drivers/usb/gadget/f_mass_storage.c
++++ b/drivers/usb/gadget/f_mass_storage.c
+@@ -316,6 +316,27 @@ static const char fsg_string_interface[]
+ /*-------------------------------------------------------------------------*/
+
+ struct fsg_dev;
++struct fsg_common;
++
++/* FSF callback functions */
++struct fsg_operations {
++ /* Callback function to call when thread exits. If no
++ * callback is set or it returns value lower then zero MSF
++ * will force eject all LUNs it operates on (including those
++ * marked as non-removable or with prevent_medium_removal flag
++ * set). */
++ int (*thread_exits)(struct fsg_common *common);
++
++ /* Called prior to ejection. Negative return means error,
++ * zero means to continue with ejection, positive means not to
++ * eject. */
++ int (*pre_eject)(struct fsg_common *common,
++ struct fsg_lun *lun, int num);
++ /* Called after ejection. Negative return means error, zero
++ * or positive is just a success. */
++ int (*post_eject)(struct fsg_common *common,
++ struct fsg_lun *lun, int num);
++};
+
+
+ /* Data shared by all the FSG instances. */
+@@ -369,8 +390,8 @@ struct fsg_common {
+ struct completion thread_notifier;
+ struct task_struct *thread_task;
+
+- /* Callback function to call when thread exits. */
+- int (*thread_exits)(struct fsg_common *common);
++ /* Callback functions. */
++ const struct fsg_operations *ops;
+ /* Gadget's private data. */
+ void *private_data;
+
+@@ -394,12 +415,8 @@ struct fsg_config {
+ const char *lun_name_format;
+ const char *thread_name;
+
+- /* Callback function to call when thread exits. If no
+- * callback is set or it returns value lower then zero MSF
+- * will force eject all LUNs it operates on (including those
+- * marked as non-removable or with prevent_medium_removal flag
+- * set). */
+- int (*thread_exits)(struct fsg_common *common);
++ /* Callback functions. */
++ const struct fsg_operations *ops;
+ /* Gadget's private data. */
+ void *private_data;
+
+@@ -435,6 +452,7 @@ static inline int __fsg_is_set(struct fs
+ if (common->fsg)
+ return 1;
+ ERROR(common, "common->fsg is NULL in %s at %u\n", func, line);
++ WARN_ON(1);
+ return 0;
+ }
+
+@@ -1393,43 +1411,55 @@ static int do_start_stop(struct fsg_comm
+ } else if (!curlun->removable) {
+ curlun->sense_data = SS_INVALID_COMMAND;
+ return -EINVAL;
+- }
+-
+- loej = common->cmnd[4] & 0x02;
+- start = common->cmnd[4] & 0x01;
+-
+- /* eject code from file_storage.c:do_start_stop() */
+-
+- if ((common->cmnd[1] & ~0x01) != 0 || /* Mask away Immed */
+- (common->cmnd[4] & ~0x03) != 0) { /* Mask LoEj, Start */
++ } else if ((common->cmnd[1] & ~0x01) != 0 || /* Mask away Immed */
++ (common->cmnd[4] & ~0x03) != 0) { /* Mask LoEj, Start */
+ curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
+ return -EINVAL;
+ }
+
+- if (!start) {
+- /* Are we allowed to unload the media? */
+- if (curlun->prevent_medium_removal) {
+- LDBG(curlun, "unload attempt prevented\n");
+- curlun->sense_data = SS_MEDIUM_REMOVAL_PREVENTED;
+- return -EINVAL;
+- }
+- if (loej) { /* Simulate an unload/eject */
+- up_read(&common->filesem);
+- down_write(&common->filesem);
+- fsg_lun_close(curlun);
+- up_write(&common->filesem);
+- down_read(&common->filesem);
+- }
+- } else {
++ loej = common->cmnd[4] & 0x02;
++ start = common->cmnd[4] & 0x01;
+
+- /* Our emulation doesn't support mounting; the medium is
+- * available for use as soon as it is loaded. */
++ /* Our emulation doesn't support mounting; the medium is
++ * available for use as soon as it is loaded. */
++ if (start) {
+ if (!fsg_lun_is_open(curlun)) {
+ curlun->sense_data = SS_MEDIUM_NOT_PRESENT;
+ return -EINVAL;
+ }
++ return 0;
+ }
+- return 0;
++
++ /* Are we allowed to unload the media? */
++ if (curlun->prevent_medium_removal) {
++ LDBG(curlun, "unload attempt prevented\n");
++ curlun->sense_data = SS_MEDIUM_REMOVAL_PREVENTED;
++ return -EINVAL;
++ }
++
++ if (!loej)
++ return 0;
++
++ /* Simulate an unload/eject */
++ if (common->ops && common->ops->pre_eject) {
++ int r = common->ops->pre_eject(common, curlun,
++ curlun - common->luns);
++ if (unlikely(r < 0))
++ return r;
++ else if (r)
++ return 0;
++ }
++
++ up_read(&common->filesem);
++ down_write(&common->filesem);
++ fsg_lun_close(curlun);
++ up_write(&common->filesem);
++ down_read(&common->filesem);
++
++ return common->ops && common->ops->post_eject
++ ? min(0, common->ops->post_eject(common, curlun,
++ curlun - common->luns))
++ : 0;
+ }
+
+
+@@ -2654,7 +2684,8 @@ static int fsg_main_thread(void *common_
+ common->thread_task = NULL;
+ spin_unlock_irq(&common->lock);
+
+- if (!common->thread_exits || common->thread_exits(common) < 0) {
++ if (!common->ops || !common->ops->thread_exits
++ || common->ops->thread_exits(common) < 0) {
+ struct fsg_lun *curlun = common->luns;
+ unsigned i = common->nluns;
+
+@@ -2730,6 +2761,7 @@ static struct fsg_common *fsg_common_ini
+ common->free_storage_on_release = 0;
+ }
+
++ common->ops = cfg->ops;
+ common->private_data = cfg->private_data;
+
+ common->gadget = gadget;
+@@ -2851,7 +2883,6 @@ buffhds_first_it:
+
+
+ /* Tell the thread to start working */
+- common->thread_exits = cfg->thread_exits;
+ common->thread_task =
+ kthread_create(fsg_main_thread, common,
+ OR(cfg->thread_name, "file-storage"));
+@@ -3148,8 +3179,8 @@ fsg_config_from_params(struct fsg_config
+ cfg->product_name = 0;
+ cfg->release = 0xffff;
+
+- cfg->thread_exits = 0;
+- cfg->private_data = 0;
++ cfg->ops = NULL;
++ cfg->private_data = NULL;
+
+ /* Finalise */
+ cfg->can_stall = params->stall;
+--- a/drivers/usb/gadget/mass_storage.c
++++ b/drivers/usb/gadget/mass_storage.c
+@@ -143,6 +143,9 @@ static int msg_thread_exits(struct fsg_c
+
+ static int __init msg_do_config(struct usb_configuration *c)
+ {
++ static const struct fsg_operations ops = {
++ .thread_exits = msg_thread_exits,
++ };
+ static struct fsg_common common;
+
+ struct fsg_common *retp;
+@@ -155,7 +158,7 @@ static int __init msg_do_config(struct u
+ }
+
+ fsg_config_from_params(&config, &mod_data);
+- config.thread_exits = msg_thread_exits;
++ config.ops = &ops;
+
+ retp = fsg_common_init(&common, c->cdev, &config);
+ if (IS_ERR(retp))
diff --git a/usb/usb-gadget-g_ether-updated-inf-file.patch b/usb/usb-gadget-g_ether-updated-inf-file.patch
new file mode 100644
index 00000000000000..fffb821e8efd77
--- /dev/null
+++ b/usb/usb-gadget-g_ether-updated-inf-file.patch
@@ -0,0 +1,268 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:42:21 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:05 +0200
+Subject: USB: gadget: g_ether: updated INF file
+To: linux-usb@vger.kernel.org
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <63fcea8d575e5c032d111840bf8cd82cea1aaa59.1277119876.git.m.nazarewicz@samsung.com>
+
+
+Updated the INF file for the g_ether gadget. It should work with most
+recent Windows systems now.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/usb/linux.inf | 224 ++++++++------------------------------------
+ 1 file changed, 45 insertions(+), 179 deletions(-)
+
+--- a/Documentation/usb/linux.inf
++++ b/Documentation/usb/linux.inf
+@@ -1,200 +1,66 @@
+-; MS-Windows driver config matching some basic modes of the
+-; Linux-USB Ethernet/RNDIS gadget firmware:
+-;
+-; - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS
+-; cable modem profile, and supports most non-Microsoft USB hosts
+-;
+-; - RNDIS plus CDC Subset ... used by hardware that incapable of
+-; full CDC Ethernet support.
+-;
+-; Microsoft only directly supports RNDIS drivers, and bundled them into XP.
+-; The Microsoft "Remote NDIS USB Driver Kit" is currently found at:
+-; http://www.microsoft.com/whdc/hwdev/resources/HWservices/rndis.mspx
+-
++; Based on template INF file found at
++; <http://msdn.microsoft.com/en-us/library/ff570620.aspx>
++; which was:
++; Copyright (c) Microsoft Corporation
++; and released under the MLPL as found at:
++; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>.
++; For use only on Windows operating systems.
+
+ [Version]
+-Signature = "$CHICAGO$"
++Signature = "$Windows NT$"
+ Class = Net
+ ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+ Provider = %Linux%
+-Compatible = 1
+-MillenniumPreferred = .ME
+-DriverVer = 03/30/2004,0.0.0.0
+-; catalog file would be used by WHQL
+-;CatalogFile = Linux.cat
++DriverVer = 06/21/2006,6.0.6000.16384
+
+ [Manufacturer]
+-%Linux% = LinuxDevices,NT.5.1
++%Linux% = LinuxDevices,NTx86,NTamd64,NTia64
++
++; Decoration for x86 architecture
++[LinuxDevices.NTx86]
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
+
+-[LinuxDevices]
+-; NetChip IDs, used by both firmware modes
+-%LinuxDevice% = RNDIS, USB\VID_0525&PID_a4a2
++; Decoration for x64 architecture
++[LinuxDevices.NTamd64]
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
+
+-[LinuxDevices.NT.5.1]
+-%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
++; Decoration for ia64 architecture
++[LinuxDevices.NTia64]
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
+
++;@@@ This is the common setting for setup
+ [ControlFlags]
+ ExcludeFromSelect=*
+
+-; Windows 98, Windows 98 Second Edition specific sections --------
+-
+-[RNDIS]
+-DeviceID = usb8023
+-MaxInstance = 512
+-DriverVer = 03/30/2004,0.0.0.0
+-AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common
+-
+-[RNDIS_AddReg_98]
+-HKR, , DevLoader, 0, *ndis
+-HKR, , DeviceVxDs, 0, usb8023.sys
+-HKR, NDIS, LogDriverName, 0, "usb8023"
+-HKR, NDIS, MajorNdisVersion, 1, 5
+-HKR, NDIS, MinorNdisVersion, 1, 0
+-HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
+-HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
+-HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
+-HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
+-HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98"
+-HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98"
+-HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98"
+-HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"
+-
+-[RNDIS_Install_98]
+-CopyFiles=RNDIS_CopyFiles_98
+-
+-[RNDIS_CopyFiles_98]
+-usb8023.sys, usb8023w.sys, , 0
+-rndismp.sys, rndismpw.sys, , 0
+-
+-; Windows Millennium Edition specific sections --------------------
+-
+-[RNDIS.ME]
+-DeviceID = usb8023
+-MaxInstance = 512
+-DriverVer = 03/30/2004,0.0.0.0
+-AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common
+-Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
+-BusType = 15
+-
+-[RNDIS_AddReg_ME]
+-HKR, , DevLoader, 0, *ndis
+-HKR, , DeviceVxDs, 0, usb8023.sys
+-HKR, NDIS, LogDriverName, 0, "usb8023"
+-HKR, NDIS, MajorNdisVersion, 1, 5
+-HKR, NDIS, MinorNdisVersion, 1, 0
+-HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
+-HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
+-HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
+-HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
+-HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME"
+-HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME"
+-HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME"
+-HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"
+-
+-[RNDIS_Install_ME]
+-CopyFiles=RNDIS_CopyFiles_ME
+-
+-[RNDIS_CopyFiles_ME]
+-usb8023.sys, usb8023m.sys, , 0
+-rndismp.sys, rndismpm.sys, , 0
+-
+-; Windows 2000 specific sections ---------------------------------
+-
+-[RNDIS.NT]
+-Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
+-BusType = 15
+-DriverVer = 03/30/2004,0.0.0.0
+-AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
+-CopyFiles = RNDIS_CopyFiles_NT
+-
+-[RNDIS.NT.Services]
+-AddService = USB_RNDIS, 2, RNDIS_ServiceInst_NT, RNDIS_EventLog
+-
+-[RNDIS_CopyFiles_NT]
+-; no rename of files on Windows 2000, use the 'k' names as is
+-usb8023k.sys, , , 0
+-rndismpk.sys, , , 0
+-
+-[RNDIS_ServiceInst_NT]
+-DisplayName = %ServiceDisplayName%
+-ServiceType = 1
+-StartType = 3
+-ErrorControl = 1
+-ServiceBinary = %12%\usb8023k.sys
+-LoadOrderGroup = NDIS
+-AddReg = RNDIS_WMI_AddReg_NT
+-
+-[RNDIS_WMI_AddReg_NT]
+-HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys"
+-
+-; Windows XP specific sections -----------------------------------
+-
++; DDInstall section
++; References the in-build Netrndis.inf
+ [RNDIS.NT.5.1]
+-Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
+-BusType = 15
+-DriverVer = 03/30/2004,0.0.0.0
+-AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
+-; no copyfiles - the files are already in place
++Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
++BusType = 15
++; NEVER REMOVE THE FOLLOWING REFERENCE FOR NETRNDIS.INF
++include = netrndis.inf
++needs = Usb_Rndis.ndi
++AddReg = Rndis_AddReg_Vista
+
++; DDInstal.Services section
+ [RNDIS.NT.5.1.Services]
+-AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog
++include = netrndis.inf
++needs = Usb_Rndis.ndi.Services
+
+-[RNDIS_ServiceInst_51]
+-DisplayName = %ServiceDisplayName%
+-ServiceType = 1
+-StartType = 3
+-ErrorControl = 1
+-ServiceBinary = %12%\usb8023.sys
+-LoadOrderGroup = NDIS
+-AddReg = RNDIS_WMI_AddReg_51
+-
+-[RNDIS_WMI_AddReg_51]
+-HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys"
+-
+-; Windows 2000 and Windows XP common sections --------------------
+-
+-[RNDIS_AddReg_NT]
+-HKR, Ndi, Service, 0, "USB_RNDIS"
+-HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
+-HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
+-
+-[RNDIS_EventLog]
+-AddReg = RNDIS_EventLog_AddReg
+-
+-[RNDIS_EventLog_AddReg]
+-HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll"
+-HKR, , TypesSupported, 0x00010001, 7
+-
+-; Common Sections -------------------------------------------------
+-
+-[RNDIS_AddReg_Common]
+-HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress%
+-HKR, NDI\params\NetworkAddress, type, 0, "edit"
+-HKR, NDI\params\NetworkAddress, LimitText, 0, "12"
+-HKR, NDI\params\NetworkAddress, UpperCase, 0, "1"
+-HKR, NDI\params\NetworkAddress, default, 0, " "
+-HKR, NDI\params\NetworkAddress, optional, 0, "1"
+-
+-[SourceDisksNames]
+-1=%SourceDisk%,,1
+-
+-[SourceDisksFiles]
+-usb8023m.sys=1
+-rndismpm.sys=1
+-usb8023w.sys=1
+-rndismpw.sys=1
+-usb8023k.sys=1
+-rndismpk.sys=1
+-
+-[DestinationDirs]
+-RNDIS_CopyFiles_98 = 10, system32/drivers
+-RNDIS_CopyFiles_ME = 10, system32/drivers
+-RNDIS_CopyFiles_NT = 12
++; Optional registry settings. You can modify as needed.
++[RNDIS_AddReg_Vista]
++HKR, NDI\params\VistaProperty, ParamDesc, 0, %Vista_Property%
++HKR, NDI\params\VistaProperty, type, 0, "edit"
++HKR, NDI\params\VistaProperty, LimitText, 0, "12"
++HKR, NDI\params\VistaProperty, UpperCase, 0, "1"
++HKR, NDI\params\VistaProperty, default, 0, " "
++HKR, NDI\params\VistaProperty, optional, 0, "1"
++
++; No sys copyfiles - the sys files are already in-build
++; (part of the operating system).
++; We do not support XP SP1-, 2003 SP1-, ME, 9x.
+
+ [Strings]
+-ServiceDisplayName = "USB Remote NDIS Network Device Driver"
+-NetworkAddress = "Network Address"
+ Linux = "Linux Developer Community"
+ LinuxDevice = "Linux USB Ethernet/RNDIS Gadget"
+-SourceDisk = "Ethernet/RNDIS Gadget Driver Install Disk"
+-
++Vista_Property = "Optional Vista Property"
diff --git a/usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch b/usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch
new file mode 100644
index 00000000000000..1a6e4d0f302c5e
--- /dev/null
+++ b/usb/usb-gadget-g_multi-added-documentation-and-inf-files.patch
@@ -0,0 +1,211 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:44:21 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:07 +0200
+Subject: USB: gadget: g_multi: added documentation and INF files
+To: linux-usb@vger.kernel.org
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <a5951faaeb541e04ed99e9cf901faa527d40fa43.1277119876.git.m.nazarewicz@samsung.com>
+
+
+A short documentation of the g_multi driver along with INF
+files for Windows XP SP3 are provided.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/usb/gadget_multi.txt | 150 ++++++++++++++++++++++++++++++++++++
+ Documentation/usb/linux-cdc-acm.inf | 4
+ Documentation/usb/linux.inf | 6 -
+ 3 files changed, 155 insertions(+), 5 deletions(-)
+
+--- /dev/null
++++ b/Documentation/usb/gadget_multi.txt
+@@ -0,0 +1,150 @@
++ -*- org -*-
++
++* Overview
++
++The Multifunction Composite Gadget (or g_multi) is a composite gadget
++that makes extensive use of the composite framework to provide
++a... multifunction gadget.
++
++In it's standard configuration it provides a single USB configuration
++with RNDIS[1] (that is Ethernet), USB CDC[2] ACM (that is serial) and
++USB Mass Storage functions.
++
++A CDC ECM (Ethernet) function may be turned on via a Kconfig option
++and RNDIS can be turned off. If they are both enabled the gadget will
++have two configurations -- one with RNDIS and another with CDC ECM[3].
++
++Please not that if you use non-standard configuration (that is enable
++CDC ECM) you may need to change vendor and/or product ID.
++
++* Host drivers
++
++To make use of the gadget one needs to make it work on host side --
++without that there's no hope of achieving anything with the gadget.
++As one might expect, things one need to do very from system to system.
++
++** Linux host drivers
++
++Since the gadget uses standard composite framework and appears as such
++to Linux host it does not need any additional drivers on Linux host
++side. All the functions are handled by respective drivers developed
++for them.
++
++This is also true for two configuration set-up with RNDIS
++configuration being the first one. Linux host will use the second
++configuration with CDC ECM which should work better under Linux.
++
++** Windows host drivers
++
++For the gadget two work under Windows two conditions have to be met:
++
++*** Detecting as composite gadget
++
++First of all, Windows need to detect the gadget as an USB composite
++gadget which on its own have some conditions[4]. If they are met,
++Windows lets USB Generic Parent Driver[5] handle the device which then
++tries to much drivers for each individual interface (sort of, don't
++get into too many details).
++
++The good news is: you do not have to worry about most of the
++conditions!
++
++The only thing to worry is that the gadget has to have a single
++configuration so a dual RNDIS and CDC ECM gadget won't work unless you
++create a proper INF -- and of course, if you do submit it!
++
++*** Installing drivers for each function
++
++The other, trickier thing is making Windows install drivers for each
++individual function.
++
++For mass storage it is trivial since Windows detect it's an interface
++implementing USB Mass Storage class and selects appropriate driver.
++
++Things are harder with RDNIS and CDC ACM.
++
++**** RNDIS
++
++To make Windows select RNDIS drivers for the first function in the
++gadget, one needs to use the [[file:linux.inf]] file provided with this
++document. It "attaches" Window's RNDIS driver to the first interface
++of the gadget.
++
++Please note, that while testing we encountered some issues[6] when
++RNDIS was not the first interface. You do not need to worry abut it
++unless you are trying to develop your own gadget in which case watch
++out for this bug.
++
++**** CDC ACM
++
++Similarly, [[file:linux-cdc-acm.inf]] is provided for CDC ACM.
++
++**** Customising the gadget
++
++If you intend to hack the g_multi gadget be advised that rearranging
++functions will obviously change interface numbers for each of the
++functionality. As an effect provided INFs won't work since they have
++interface numbers hard-coded in them (it's not hard to change those
++though[7]).
++
++This also means, that after experimenting with g_multi and changing
++provided functions one should change gadget's vendor and/or product ID
++so there will be no collision with other customised gadgets or the
++original gadget.
++
++Failing to comply may cause brain damage after wondering for hours why
++things don't work as intended before realising Windows have cached
++some drivers information (changing USB port may sometimes help plus
++you might try using USBDeview[8] to remove the phantom device).
++
++**** INF testing
++
++Provided INF files have been tested on Windows XP SP3, Windows Vista
++and Windows 7, all 32-bit versions. It should work on 64-bit versions
++as well. It most likely won't work on Windows prior to Windows XP
++SP2.
++
++** Other systems
++
++At this moment, drivers for any other systems have not been tested.
++Knowing how MacOS is based on BSD and BSD is an Open Source it is
++believed that it should (read: "I have no idea whether it will") work
++out-of-the-box.
++
++For more exotic systems I have even less to say...
++
++Any testing and drivers *are* *welcome*!
++
++* Authors
++
++This document has been written by Michal Nazarewicz
++([[mailto:mina86@mina86.com]]). INF files have been hacked with
++support of Marek Szyprowski ([[mailto:m.szyprowski@samsung.com]]) and
++Xiaofan Chen ([[mailto:xiaofanc@gmail.com]]) basing on the MS RNDIS
++template[9], Microchip's CDC ACM INF file and David Brownell's
++([[mailto:dbrownell@users.sourceforge.net]]) original INF files.
++
++* Footnotes
++
++[1] Remote Network Driver Interface Specification,
++[[http://msdn.microsoft.com/en-us/library/ee484414.aspx]].
++
++[2] Communications Device Class Abstract Control Model, spec for this
++and other USB classes can be found at
++[[http://www.usb.org/developers/devclass_docs/]].
++
++[3] CDC Ethernet Control Model.
++
++[4] [[http://msdn.microsoft.com/en-us/library/ff537109(v=VS.85).aspx]]
++
++[5] [[http://msdn.microsoft.com/en-us/library/ff539234(v=VS.85).aspx]]
++
++[6] To put it in some other nice words, Windows failed to respond to
++any user input.
++
++[7] You may find [[http://www.cygnal.org/ubb/Forum9/HTML/001050.html]]
++useful.
++
++[8] http://www.nirsoft.net/utils/usb_devices_view.html
++
++[9] [[http://msdn.microsoft.com/en-us/library/ff570620.aspx]]
+--- a/Documentation/usb/linux-cdc-acm.inf
++++ b/Documentation/usb/linux-cdc-acm.inf
+@@ -90,10 +90,10 @@ ServiceBinary=%12%\USBSER.sys
+ [SourceDisksFiles]
+ [SourceDisksNames]
+ [DeviceList]
+-%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7
++%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02
+
+ [DeviceList.NTamd64]
+-%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7
++%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_0525&PID_A4AB&MI_02
+
+
+ ;------------------------------------------------------------------------------
+--- a/Documentation/usb/linux.inf
++++ b/Documentation/usb/linux.inf
+@@ -18,15 +18,15 @@ DriverVer = 06/21/2006,6.0.600
+
+ ; Decoration for x86 architecture
+ [LinuxDevices.NTx86]
+-%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00
+
+ ; Decoration for x64 architecture
+ [LinuxDevices.NTamd64]
+-%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00
+
+ ; Decoration for ia64 architecture
+ [LinuxDevices.NTia64]
+-%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
++%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_0525&PID_a4ab&MI_00
+
+ ;@@@ This is the common setting for setup
+ [ControlFlags]
diff --git a/usb/usb-gadget-g_multi-code-clean-up-and-refactoring.patch b/usb/usb-gadget-g_multi-code-clean-up-and-refactoring.patch
new file mode 100644
index 00000000000000..8fcb0379791781
--- /dev/null
+++ b/usb/usb-gadget-g_multi-code-clean-up-and-refactoring.patch
@@ -0,0 +1,450 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:42:03 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:03 +0200
+Subject: USB: gadget: g_multi: code clean up and refactoring
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <caa6546b6691e75a7248415a4d50d681e4f8705d.1277119876.git.m.nazarewicz@samsung.com>
+
+
+The Multifunction Composite Gadget have been cleaned up
+and refactored so hopefully it looks prettier and works
+at least as good as before changes.
+
+A Kconfig has also been fixed to make it impossible to build
+FunctionFS gadget with no configurations. With this patch, if
+RNDIS is not chosen by the user CDC is force-selected.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/Kconfig | 1
+ drivers/usb/gadget/multi.c | 262 +++++++++++++++++++++++++--------------------
+ 2 files changed, 147 insertions(+), 116 deletions(-)
+
+--- a/drivers/usb/gadget/Kconfig
++++ b/drivers/usb/gadget/Kconfig
+@@ -863,6 +863,7 @@ config USB_G_NOKIA
+ config USB_G_MULTI
+ tristate "Multifunction Composite Gadget (EXPERIMENTAL)"
+ depends on BLOCK && NET
++ select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS
+ help
+ The Multifunction Composite Gadget provides Ethernet (RNDIS
+ and/or CDC Ethernet), mass storage and ACM serial link
+--- a/drivers/usb/gadget/multi.c
++++ b/drivers/usb/gadget/multi.c
+@@ -24,6 +24,7 @@
+
+ #include <linux/kernel.h>
+ #include <linux/utsname.h>
++#include <linux/module.h>
+
+
+ #if defined USB_ETH_RNDIS
+@@ -35,14 +36,13 @@
+
+
+ #define DRIVER_DESC "Multifunction Composite Gadget"
+-#define DRIVER_VERSION "2009/07/21"
+
+-/*-------------------------------------------------------------------------*/
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_AUTHOR("Michal Nazarewicz");
++MODULE_LICENSE("GPL");
+
+-#define MULTI_VENDOR_NUM 0x0525 /* XXX NetChip */
+-#define MULTI_PRODUCT_NUM 0xa4ab /* XXX */
+
+-/*-------------------------------------------------------------------------*/
++/***************************** All the files... *****************************/
+
+ /*
+ * kbuild is not very cooperative with respect to linking separately
+@@ -57,6 +57,8 @@
+ #include "config.c"
+ #include "epautoconf.c"
+
++#include "f_mass_storage.c"
++
+ #include "u_serial.c"
+ #include "f_acm.c"
+
+@@ -68,13 +70,24 @@
+ #endif
+ #include "u_ether.c"
+
+-#undef DBG /* u_ether.c has broken idea about macros */
+-#undef VDBG /* so clean up after it */
+-#undef ERROR
+-#undef INFO
+-#include "f_mass_storage.c"
+
+-/*-------------------------------------------------------------------------*/
++
++/***************************** Device Descriptor ****************************/
++
++#define MULTI_VENDOR_NUM 0x0525 /* XXX NetChip */
++#define MULTI_PRODUCT_NUM 0xa4ab /* XXX */
++
++
++enum {
++ __MULTI_NO_CONFIG,
++#ifdef CONFIG_USB_G_MULTI_RNDIS
++ MULTI_RNDIS_CONFIG_NUM,
++#endif
++#ifdef CONFIG_USB_G_MULTI_CDC
++ MULTI_CDC_CONFIG_NUM,
++#endif
++};
++
+
+ static struct usb_device_descriptor device_desc = {
+ .bLength = sizeof device_desc,
+@@ -82,80 +95,82 @@ static struct usb_device_descriptor devi
+
+ .bcdUSB = cpu_to_le16(0x0200),
+
+- /* .bDeviceClass = USB_CLASS_COMM, */
+- /* .bDeviceSubClass = 0, */
+- /* .bDeviceProtocol = 0, */
+- .bDeviceClass = 0xEF,
++ .bDeviceClass = USB_CLASS_MISC /* 0xEF */,
+ .bDeviceSubClass = 2,
+ .bDeviceProtocol = 1,
+- /* .bMaxPacketSize0 = f(hardware) */
+
+ /* Vendor and product id can be overridden by module parameters. */
+ .idVendor = cpu_to_le16(MULTI_VENDOR_NUM),
+ .idProduct = cpu_to_le16(MULTI_PRODUCT_NUM),
+- /* .bcdDevice = f(hardware) */
+- /* .iManufacturer = DYNAMIC */
+- /* .iProduct = DYNAMIC */
+- /* NO SERIAL NUMBER */
+- .bNumConfigurations = 1,
+ };
+
+-static struct usb_otg_descriptor otg_descriptor = {
+- .bLength = sizeof otg_descriptor,
+- .bDescriptorType = USB_DT_OTG,
+-
+- /* REVISIT SRP-only hardware is possible, although
+- * it would not be called "OTG" ...
+- */
+- .bmAttributes = USB_OTG_SRP | USB_OTG_HNP,
+-};
+
+ static const struct usb_descriptor_header *otg_desc[] = {
+- (struct usb_descriptor_header *) &otg_descriptor,
++ (struct usb_descriptor_header *) &(struct usb_otg_descriptor){
++ .bLength = sizeof(struct usb_otg_descriptor),
++ .bDescriptorType = USB_DT_OTG,
++
++ /*
++ * REVISIT SRP-only hardware is possible, although
++ * it would not be called "OTG" ...
++ */
++ .bmAttributes = USB_OTG_SRP | USB_OTG_HNP,
++ },
+ NULL,
+ };
+
+
+-/* string IDs are assigned dynamically */
+-
+-#define STRING_MANUFACTURER_IDX 0
+-#define STRING_PRODUCT_IDX 1
++enum {
++ MULTI_STRING_MANUFACTURER_IDX,
++ MULTI_STRING_PRODUCT_IDX,
++#ifdef CONFIG_USB_G_MULTI_RNDIS
++ MULTI_STRING_RNDIS_CONFIG_IDX,
++#endif
++#ifdef CONFIG_USB_G_MULTI_CDC
++ MULTI_STRING_CDC_CONFIG_IDX,
++#endif
++};
+
+ static char manufacturer[50];
+
+ static struct usb_string strings_dev[] = {
+- [STRING_MANUFACTURER_IDX].s = manufacturer,
+- [STRING_PRODUCT_IDX].s = DRIVER_DESC,
++ [MULTI_STRING_MANUFACTURER_IDX].s = manufacturer,
++ [MULTI_STRING_PRODUCT_IDX].s = DRIVER_DESC,
++#ifdef CONFIG_USB_G_MULTI_RNDIS
++ [MULTI_STRING_RNDIS_CONFIG_IDX].s = "Multifunction with RNDIS",
++#endif
++#ifdef CONFIG_USB_G_MULTI_CDC
++ [MULTI_STRING_CDC_CONFIG_IDX].s = "Multifunction with CDC ECM",
++#endif
+ { } /* end of list */
+ };
+
+-static struct usb_gadget_strings stringtab_dev = {
+- .language = 0x0409, /* en-us */
+- .strings = strings_dev,
+-};
+-
+ static struct usb_gadget_strings *dev_strings[] = {
+- &stringtab_dev,
++ &(struct usb_gadget_strings){
++ .language = 0x0409, /* en-us */
++ .strings = strings_dev,
++ },
+ NULL,
+ };
+
+-static u8 hostaddr[ETH_ALEN];
+
+
+
+ /****************************** Configurations ******************************/
+
+-static struct fsg_module_parameters mod_data = {
+- .stall = 1
+-};
+-FSG_MODULE_PARAMETERS(/* no prefix */, mod_data);
++static struct fsg_module_parameters fsg_mod_data = { .stall = 1 };
++FSG_MODULE_PARAMETERS(/* no prefix */, fsg_mod_data);
++
++static struct fsg_common fsg_common;
+
+-static struct fsg_common *fsg_common;
++static u8 hostaddr[ETH_ALEN];
+
+
++/********** RNDIS **********/
++
+ #ifdef USB_ETH_RNDIS
+
+-static int __init rndis_do_config(struct usb_configuration *c)
++static __ref int rndis_do_config(struct usb_configuration *c)
+ {
+ int ret;
+
+@@ -172,26 +187,42 @@ static int __init rndis_do_config(struct
+ if (ret < 0)
+ return ret;
+
+- ret = fsg_bind_config(c->cdev, c, fsg_common);
++ ret = fsg_bind_config(c->cdev, c, &fsg_common);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+
+-static struct usb_configuration rndis_config_driver = {
+- .label = "Multifunction Composite (RNDIS + MS + ACM)",
+- .bind = rndis_do_config,
+- .bConfigurationValue = 2,
+- /* .iConfiguration = DYNAMIC */
+- .bmAttributes = USB_CONFIG_ATT_SELFPOWER,
+-};
++static int rndis_config_register(struct usb_composite_dev *cdev)
++{
++ static struct usb_configuration config = {
++ .bind = rndis_do_config,
++ .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
++ .bmAttributes = USB_CONFIG_ATT_SELFPOWER,
++ };
++
++ config.label = strings_dev[MULTI_STRING_RNDIS_CONFIG_IDX].s;
++ config.iConfiguration = strings_dev[MULTI_STRING_RNDIS_CONFIG_IDX].id;
++
++ return usb_add_config(cdev, &config);
++}
++
++#else
++
++static int rndis_config_register(struct usb_composite_dev *cdev)
++{
++ return 0;
++}
+
+ #endif
+
++
++/********** CDC ECM **********/
++
+ #ifdef CONFIG_USB_G_MULTI_CDC
+
+-static int __init cdc_do_config(struct usb_configuration *c)
++static __ref int cdc_do_config(struct usb_configuration *c)
+ {
+ int ret;
+
+@@ -208,20 +239,33 @@ static int __init cdc_do_config(struct u
+ if (ret < 0)
+ return ret;
+
+- ret = fsg_bind_config(c->cdev, c, fsg_common);
++ ret = fsg_bind_config(c->cdev, c, &fsg_common);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+
+-static struct usb_configuration cdc_config_driver = {
+- .label = "Multifunction Composite (CDC + MS + ACM)",
+- .bind = cdc_do_config,
+- .bConfigurationValue = 1,
+- /* .iConfiguration = DYNAMIC */
+- .bmAttributes = USB_CONFIG_ATT_SELFPOWER,
+-};
++static int cdc_config_register(struct usb_composite_dev *cdev)
++{
++ static struct usb_configuration config = {
++ .bind = cdc_do_config,
++ .bConfigurationValue = MULTI_CDC_CONFIG_NUM,
++ .bmAttributes = USB_CONFIG_ATT_SELFPOWER,
++ };
++
++ config.label = strings_dev[MULTI_STRING_CDC_CONFIG_IDX].s;
++ config.iConfiguration = strings_dev[MULTI_STRING_CDC_CONFIG_IDX].id;
++
++ return usb_add_config(cdev, &config);
++}
++
++#else
++
++static int cdc_config_register(struct usb_composite_dev *cdev)
++{
++ return 0;
++}
+
+ #endif
+
+@@ -230,7 +274,7 @@ static struct usb_configuration cdc_conf
+ /****************************** Gadget Bind ******************************/
+
+
+-static int __init multi_bind(struct usb_composite_dev *cdev)
++static int __ref multi_bind(struct usb_composite_dev *cdev)
+ {
+ struct usb_gadget *gadget = cdev->gadget;
+ int status, gcnum;
+@@ -252,67 +296,56 @@ static int __init multi_bind(struct usb_
+ goto fail0;
+
+ /* set up mass storage function */
+- fsg_common = fsg_common_from_params(0, cdev, &mod_data);
+- if (IS_ERR(fsg_common)) {
+- status = PTR_ERR(fsg_common);
+- goto fail1;
++ {
++ void *retp;
++ retp = fsg_common_from_params(&fsg_common, cdev, &fsg_mod_data);
++ if (IS_ERR(retp)) {
++ status = PTR_ERR(retp);
++ goto fail1;
++ }
+ }
+
+-
++ /* set bcdDevice */
+ gcnum = usb_gadget_controller_number(gadget);
+- if (gcnum >= 0)
++ if (gcnum >= 0) {
+ device_desc.bcdDevice = cpu_to_le16(0x0300 | gcnum);
+- else {
+- /* We assume that can_support_ecm() tells the truth;
+- * but if the controller isn't recognized at all then
+- * that assumption is a bit more likely to be wrong.
+- */
+- WARNING(cdev, "controller '%s' not recognized\n",
+- gadget->name);
++ } else {
++ WARNING(cdev, "controller '%s' not recognized\n", gadget->name);
+ device_desc.bcdDevice = cpu_to_le16(0x0300 | 0x0099);
+ }
+
+-
+- /* Allocate string descriptor numbers ... note that string
+- * contents can be overridden by the composite_dev glue.
+- */
+-
+- /* device descriptor strings: manufacturer, product */
++ /* allocate string descriptor numbers */
+ snprintf(manufacturer, sizeof manufacturer, "%s %s with %s",
+ init_utsname()->sysname, init_utsname()->release,
+ gadget->name);
+- status = usb_string_id(cdev);
+- if (status < 0)
+- goto fail2;
+- strings_dev[STRING_MANUFACTURER_IDX].id = status;
+- device_desc.iManufacturer = status;
+
+- status = usb_string_id(cdev);
+- if (status < 0)
++ status = usb_string_ids_tab(cdev, strings_dev);
++ if (unlikely(status < 0))
+ goto fail2;
+- strings_dev[STRING_PRODUCT_IDX].id = status;
+- device_desc.iProduct = status;
+
+-#ifdef USB_ETH_RNDIS
+- /* register our first configuration */
+- status = usb_add_config(cdev, &rndis_config_driver);
+- if (status < 0)
++ device_desc.iManufacturer =
++ strings_dev[MULTI_STRING_MANUFACTURER_IDX].id;
++ device_desc.iProduct =
++ strings_dev[MULTI_STRING_PRODUCT_IDX].id;
++
++ /* register configurations */
++ status = rndis_config_register(cdev);
++ if (unlikely(status < 0))
+ goto fail2;
+-#endif
+
+-#ifdef CONFIG_USB_G_MULTI_CDC
+- /* register our second configuration */
+- status = usb_add_config(cdev, &cdc_config_driver);
+- if (status < 0)
++ status = cdc_config_register(cdev);
++ if (unlikely(status < 0))
+ goto fail2;
+-#endif
+
+- dev_info(&gadget->dev, DRIVER_DESC ", version: " DRIVER_VERSION "\n");
+- fsg_common_put(fsg_common);
++ /* we're done */
++ dev_info(&gadget->dev, DRIVER_DESC "\n");
++ fsg_common_put(&fsg_common);
+ return 0;
+
++
++ /* error recovery */
+ fail2:
+- fsg_common_put(fsg_common);
++ fsg_common_put(&fsg_common);
+ fail1:
+ gserial_cleanup();
+ fail0:
+@@ -339,18 +372,15 @@ static struct usb_composite_driver multi
+ .unbind = __exit_p(multi_unbind),
+ };
+
+-MODULE_DESCRIPTION(DRIVER_DESC);
+-MODULE_AUTHOR("Michal Nazarewicz");
+-MODULE_LICENSE("GPL");
+
+-static int __init g_multi_init(void)
++static int __init multi_init(void)
+ {
+ return usb_composite_register(&multi_driver);
+ }
+-module_init(g_multi_init);
++module_init(multi_init);
+
+-static void __exit g_multi_cleanup(void)
++static void __exit multi_exit(void)
+ {
+ usb_composite_unregister(&multi_driver);
+ }
+-module_exit(g_multi_cleanup);
++module_exit(multi_exit);
diff --git a/usb/usb-gadget-g_serial-inf-file-updated.patch b/usb/usb-gadget-g_serial-inf-file-updated.patch
new file mode 100644
index 00000000000000..24509c635998e7
--- /dev/null
+++ b/usb/usb-gadget-g_serial-inf-file-updated.patch
@@ -0,0 +1,238 @@
+From m.nazarewicz@samsung.com Mon Jun 21 14:42:37 2010
+From: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Date: Mon, 21 Jun 2010 13:57:06 +0200
+Subject: USB: gadget: g_serial: INF file updated
+To: linux-usb@vger.kernel.org
+Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg KH <greg@kroah.com>, Kyungmin Park <kyungmin.park@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, linux-kernel@vger.kernel.org
+Message-ID: <57cb6dca50e173774cdc0135c6a921fc006adc9e.1277119876.git.m.nazarewicz@samsung.com>
+
+
+Updated the INF file for g_serial gadget. It should work with
+most recent Windows systems now.
+
+Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/usb/gadget_serial.txt | 87 +++--------------------------
+ Documentation/usb/linux-cdc-acm.inf | 107 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 117 insertions(+), 77 deletions(-)
+
+--- a/Documentation/usb/gadget_serial.txt
++++ b/Documentation/usb/gadget_serial.txt
+@@ -151,88 +151,23 @@ instructions below to install the host s
+
+ Installing the Windows Host ACM Driver
+ --------------------------------------
+-To use the Windows ACM driver you must have the files "gserial.inf"
+-and "usbser.sys" together in a folder on the Windows machine.
+-
+-The "gserial.inf" file is given here.
+-
+--------------------- CUT HERE --------------------
+-[Version]
+-Signature="$Windows NT$"
+-Class=Ports
+-ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+-Provider=%LINUX%
+-DriverVer=08/17/2004,0.0.2.0
+-; Copyright (C) 2004 Al Borchers (alborchers@steinerpoint.com)
+-
+-[Manufacturer]
+-%LINUX%=GSerialDeviceList
+-
+-[GSerialDeviceList]
+-%GSERIAL%=GSerialInstall, USB\VID_0525&PID_A4A7
+-
+-[DestinationDirs]
+-DefaultDestDir=10,System32\Drivers
+-
+-[GSerialInstall]
+-CopyFiles=GSerialCopyFiles
+-AddReg=GSerialAddReg
+-
+-[GSerialCopyFiles]
+-usbser.sys
+-
+-[GSerialAddReg]
+-HKR,,DevLoader,,*ntkern
+-HKR,,NTMPDriver,,usbser.sys
+-HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+-
+-[GSerialInstall.Services]
+-AddService = usbser,0x0002,GSerialService
+-
+-[GSerialService]
+-DisplayName = %GSERIAL_DISPLAY_NAME%
+-ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+-StartType = 3 ; SERVICE_DEMAND_START
+-ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+-ServiceBinary = %10%\System32\Drivers\usbser.sys
+-LoadOrderGroup = Base
+-
+-[Strings]
+-LINUX = "Linux"
+-GSERIAL = "Gadget Serial"
+-GSERIAL_DISPLAY_NAME = "USB Gadget Serial Driver"
+--------------------- CUT HERE --------------------
+-
+-The "usbser.sys" file comes with various versions of Windows.
+-For example, it can be found on Windows XP typically in
+-
+- C:\WINDOWS\Driver Cache\i386\driver.cab
+-
+-Or it can be found on the Windows 98SE CD in the "win98" folder
+-in the "DRIVER11.CAB" through "DRIVER20.CAB" cab files. You will
+-need the DOS "expand" program, the Cygwin "cabextract" program, or
+-a similar program to unpack these cab files and extract "usbser.sys".
+-
+-For example, to extract "usbser.sys" into the current directory
+-on Windows XP, open a DOS window and run a command like
+-
+- expand C:\WINDOWS\Driver~1\i386\driver.cab -F:usbser.sys .
+-
+-(Thanks to Nishant Kamat for pointing out this DOS command.)
++To use the Windows ACM driver you must have the "linux-cdc-acm.inf"
++file (provided along this document) which supports all recent versions
++of Windows.
+
+ When the gadget serial driver is loaded and the USB device connected
+ to the Windows host with a USB cable, Windows should recognize the
+ gadget serial device and ask for a driver. Tell Windows to find the
+-driver in the folder that contains "gserial.inf" and "usbser.sys".
++driver in the folder that contains the "linux-cdc-acm.inf" file.
+
+ For example, on Windows XP, when the gadget serial device is first
+ plugged in, the "Found New Hardware Wizard" starts up. Select
+-"Install from a list or specific location (Advanced)", then on
+-the next screen select "Include this location in the search" and
+-enter the path or browse to the folder containing "gserial.inf" and
+-"usbser.sys". Windows will complain that the Gadget Serial driver
+-has not passed Windows Logo testing, but select "Continue anyway"
+-and finish the driver installation.
++"Install from a list or specific location (Advanced)", then on the
++next screen select "Include this location in the search" and enter the
++path or browse to the folder containing the "linux-cdc-acm.inf" file.
++Windows will complain that the Gadget Serial driver has not passed
++Windows Logo testing, but select "Continue anyway" and finish the
++driver installation.
+
+ On Windows XP, in the "Device Manager" (under "Control Panel",
+ "System", "Hardware") expand the "Ports (COM & LPT)" entry and you
+@@ -345,5 +280,3 @@ you should be able to send data back and
+ side and host side systems. Anything you type on the terminal
+ window on the gadget side should appear in the terminal window on
+ the host side and vice versa.
+-
+-
+--- /dev/null
++++ b/Documentation/usb/linux-cdc-acm.inf
+@@ -0,0 +1,107 @@
++; Windows USB CDC ACM Setup File
++
++; Based on INF template which was:
++; Copyright (c) 2000 Microsoft Corporation
++; Copyright (c) 2007 Microchip Technology Inc.
++; likely to be covered by the MLPL as found at:
++; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>.
++; For use only on Windows operating systems.
++
++[Version]
++Signature="$Windows NT$"
++Class=Ports
++ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
++Provider=%Linux%
++DriverVer=11/15/2007,5.1.2600.0
++
++[Manufacturer]
++%Linux%=DeviceList, NTamd64
++
++[DestinationDirs]
++DefaultDestDir=12
++
++
++;------------------------------------------------------------------------------
++; Windows 2000/XP/Vista-32bit Sections
++;------------------------------------------------------------------------------
++
++[DriverInstall.nt]
++include=mdmcpq.inf
++CopyFiles=DriverCopyFiles.nt
++AddReg=DriverInstall.nt.AddReg
++
++[DriverCopyFiles.nt]
++usbser.sys,,,0x20
++
++[DriverInstall.nt.AddReg]
++HKR,,DevLoader,,*ntkern
++HKR,,NTMPDriver,,USBSER.sys
++HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
++
++[DriverInstall.nt.Services]
++AddService=usbser, 0x00000002, DriverService.nt
++
++[DriverService.nt]
++DisplayName=%SERVICE%
++ServiceType=1
++StartType=3
++ErrorControl=1
++ServiceBinary=%12%\USBSER.sys
++
++;------------------------------------------------------------------------------
++; Vista-64bit Sections
++;------------------------------------------------------------------------------
++
++[DriverInstall.NTamd64]
++include=mdmcpq.inf
++CopyFiles=DriverCopyFiles.NTamd64
++AddReg=DriverInstall.NTamd64.AddReg
++
++[DriverCopyFiles.NTamd64]
++USBSER.sys,,,0x20
++
++[DriverInstall.NTamd64.AddReg]
++HKR,,DevLoader,,*ntkern
++HKR,,NTMPDriver,,USBSER.sys
++HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
++
++[DriverInstall.NTamd64.Services]
++AddService=usbser, 0x00000002, DriverService.NTamd64
++
++[DriverService.NTamd64]
++DisplayName=%SERVICE%
++ServiceType=1
++StartType=3
++ErrorControl=1
++ServiceBinary=%12%\USBSER.sys
++
++
++;------------------------------------------------------------------------------
++; Vendor and Product ID Definitions
++;------------------------------------------------------------------------------
++; When developing your USB device, the VID and PID used in the PC side
++; application program and the firmware on the microcontroller must match.
++; Modify the below line to use your VID and PID. Use the format as shown
++; below.
++; Note: One INF file can be used for multiple devices with different
++; VID and PIDs. For each supported device, append
++; ",USB\VID_xxxx&PID_yyyy" to the end of the line.
++;------------------------------------------------------------------------------
++[SourceDisksFiles]
++[SourceDisksNames]
++[DeviceList]
++%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7
++
++[DeviceList.NTamd64]
++%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7
++
++
++;------------------------------------------------------------------------------
++; String Definitions
++;------------------------------------------------------------------------------
++;Modify these strings to customize your device
++;------------------------------------------------------------------------------
++[Strings]
++Linux = "Linux Developer Community"
++DESCRIPTION = "Gadget Serial"
++SERVICE = "USB RS-232 Emulation Driver"