aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-08-26 09:51:32 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-08-26 09:51:32 -0700
commit9075ee5923cf8e0e6930cb7827bbf4c9d59e7f99 (patch)
tree7bd69df0b569b73f7a842ff3289fdd2450bc8c1c /usb
parent66577cd1a08a1282db7033198c289c0539536003 (diff)
downloadpatches-9075ee5923cf8e0e6930cb7827bbf4c9d59e7f99.tar.gz
usb patches
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-clean-up-root-hub-string-descriptors.patch159
-rw-r--r--usb/usb-fix-paths-in-usbmon-documentation.patch55
-rw-r--r--usb/usb-gadget-double-free_irq-in-at91udc_probe.patch27
-rw-r--r--usb/usb-omap-isp1301-compile-fix.patch79
-rw-r--r--usb/usb-unusual_devs.h-drop-some-unneeded-floppy-entries.patch74
5 files changed, 394 insertions, 0 deletions
diff --git a/usb/usb-clean-up-root-hub-string-descriptors.patch b/usb/usb-clean-up-root-hub-string-descriptors.patch
new file mode 100644
index 00000000000000..d2076dfb9f0dcc
--- /dev/null
+++ b/usb/usb-clean-up-root-hub-string-descriptors.patch
@@ -0,0 +1,159 @@
+From linux@horizon.com Tue Aug 25 22:51:38 2009
+From: "George Spelvin" <linux@horizon.com>
+Date: 24 Aug 2009 22:06:41 -0400
+Subject: USB: Clean up root hub string descriptors
+To: stern@rowland.harvard.edu
+Cc: linux@horizon.com, linux-usb@vger.kernel.org
+Message-ID: <20090825020641.29734.qmail@science.horizon.com>
+
+
+The previous code had a bug that would add a trailing null byte to
+the returned descriptor.
+
+Signed-off-by: George Spelvin <linux@horizon.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/hcd.c | 111 ++++++++++++++++++++++++++++---------------------
+ 1 file changed, 64 insertions(+), 47 deletions(-)
+
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -337,72 +337,89 @@ static const u8 ss_rh_config_descriptor[
+
+ /*-------------------------------------------------------------------------*/
+
+-/*
+- * helper routine for returning string descriptors in UTF-16LE
+- * input can actually be ISO-8859-1; ASCII is its 7-bit subset
++/**
++ * ascii2desc() - Helper routine for producing UTF-16LE string descriptors
++ * @s: Null-terminated ASCII (actually ISO-8859-1) string
++ * @buf: Buffer for USB string descriptor (header + UTF-16LE)
++ * @len: Length (in bytes; may be odd) of descriptor buffer.
++ *
++ * The return value is the number of bytes filled in: 2 + 2*strlen(s) or
++ * buflen, whichever is less.
++ *
++ * USB String descriptors can contain at most 126 characters; input
++ * strings longer than that are truncated.
+ */
+-static unsigned ascii2utf(char *s, u8 *utf, int utfmax)
++static unsigned
++ascii2desc(char const *s, u8 *buf, unsigned len)
+ {
+- unsigned retval;
++ unsigned n, t = 2 + 2*strlen(s);
+
+- for (retval = 0; *s && utfmax > 1; utfmax -= 2, retval += 2) {
+- *utf++ = *s++;
+- *utf++ = 0;
+- }
+- if (utfmax > 0) {
+- *utf = *s;
+- ++retval;
++ if (t > 254)
++ t = 254; /* Longest possible UTF string descriptor */
++ if (len > t)
++ len = t;
++
++ t += USB_DT_STRING << 8; /* Now t is first 16 bits to store */
++
++ n = len;
++ while (n--) {
++ *buf++ = t;
++ if (!n--)
++ break;
++ *buf++ = t >> 8;
++ t = (unsigned char)*s++;
+ }
+- return retval;
++ return len;
+ }
+
+-/*
+- * rh_string - provides manufacturer, product and serial strings for root hub
+- * @id: the string ID number (1: serial number, 2: product, 3: vendor)
++/**
++ * rh_string() - provides string descriptors for root hub
++ * @id: the string ID number (0: langids, 1: serial #, 2: product, 3: vendor)
+ * @hcd: the host controller for this root hub
+- * @data: return packet in UTF-16 LE
+- * @len: length of the return packet
++ * @data: buffer for output packet
++ * @len: length of the provided buffer
+ *
+ * Produces either a manufacturer, product or serial number string for the
+ * virtual root hub device.
++ * Returns the number of bytes filled in: the length of the descriptor or
++ * of the provided buffer, whichever is less.
+ */
+-static unsigned rh_string(int id, struct usb_hcd *hcd, u8 *data, unsigned len)
++static unsigned
++rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len)
+ {
+- char buf [100];
++ char buf[100];
++ char const *s;
++ static char const langids[4] = {4, USB_DT_STRING, 0x09, 0x04};
+
+ // language ids
+- if (id == 0) {
+- buf[0] = 4; buf[1] = 3; /* 4 bytes string data */
+- buf[2] = 0x09; buf[3] = 0x04; /* MSFT-speak for "en-us" */
+- len = min_t(unsigned, len, 4);
+- memcpy (data, buf, len);
++ switch (id) {
++ case 0:
++ /* Array of LANGID codes (0x0409 is MSFT-speak for "en-us") */
++ /* See http://www.usb.org/developers/docs/USB_LANGIDs.pdf */
++ if (len > 4)
++ len = 4;
++ memcpy(data, langids, len);
+ return len;
+-
+- // serial number
+- } else if (id == 1) {
+- strlcpy (buf, hcd->self.bus_name, sizeof buf);
+-
+- // product description
+- } else if (id == 2) {
+- strlcpy (buf, hcd->product_desc, sizeof buf);
+-
+- // id 3 == vendor description
+- } else if (id == 3) {
++ case 1:
++ /* Serial number */
++ s = hcd->self.bus_name;
++ break;
++ case 2:
++ /* Product name */
++ s = hcd->product_desc;
++ break;
++ case 3:
++ /* Manufacturer */
+ snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname,
+ init_utsname()->release, hcd->driver->description);
+- }
+-
+- switch (len) { /* All cases fall through */
++ s = buf;
++ break;
+ default:
+- len = 2 + ascii2utf (buf, data + 2, len - 2);
+- case 2:
+- data [1] = 3; /* type == string */
+- case 1:
+- data [0] = 2 * (strlen (buf) + 1);
+- case 0:
+- ; /* Compiler wants a statement here */
++ /* Can't happen; caller guarantees it */
++ return 0;
+ }
+- return len;
++
++ return ascii2desc(s, data, len);
+ }
+
+
diff --git a/usb/usb-fix-paths-in-usbmon-documentation.patch b/usb/usb-fix-paths-in-usbmon-documentation.patch
new file mode 100644
index 00000000000000..4961d51373c166
--- /dev/null
+++ b/usb/usb-fix-paths-in-usbmon-documentation.patch
@@ -0,0 +1,55 @@
+From rbrito@ime.usp.br Tue Aug 25 22:52:45 2009
+From: Rog�rio Brito <rbrito@ime.usp.br>
+Date: Sat, 22 Aug 2009 17:33:53 -0300
+Subject: USB: fix paths in usbmon documentation
+To: Alan Stern <stern@rowland.harvard.edu>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Message-ID: <20090822203353.GA2103@ime.usp.br>
+Content-Disposition: inline
+
+
+Hi there.
+
+On Aug 21 2009, Alan Stern wrote:
+> On Thu, 20 Aug 2009, Rogério Brito wrote:
+> > Again, just reiterating, what I said before, even though I am not sure
+> > if I can reproduce it, I will try to.
+>
+> A usbmon trace showing what happens when you plug in the drive and
+> when you run smartctl would help.
+
+The documentation for usbmon in the kernel 2.6.31-rc7 kernel doesn't
+match what the kernel exposes in the debug fs tree. This patch fixes it.
+
+Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/usb/usbmon.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/Documentation/usb/usbmon.txt
++++ b/Documentation/usb/usbmon.txt
+@@ -33,7 +33,7 @@ if usbmon is built into the kernel.
+
+ Verify that bus sockets are present.
+
+-# ls /sys/kernel/debug/usbmon
++# ls /sys/kernel/debug/usb/usbmon
+ 0s 0u 1s 1t 1u 2s 2t 2u 3s 3t 3u 4s 4t 4u
+ #
+
+@@ -58,11 +58,11 @@ Bus=03 means it's bus 3.
+
+ 3. Start 'cat'
+
+-# cat /sys/kernel/debug/usbmon/3u > /tmp/1.mon.out
++# cat /sys/kernel/debug/usb/usbmon/3u > /tmp/1.mon.out
+
+ to listen on a single bus, otherwise, to listen on all buses, type:
+
+-# cat /sys/kernel/debug/usbmon/0u > /tmp/1.mon.out
++# cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out
+
+ This process will be reading until killed. Naturally, the output can be
+ redirected to a desirable location. This is preferred, because it is going
diff --git a/usb/usb-gadget-double-free_irq-in-at91udc_probe.patch b/usb/usb-gadget-double-free_irq-in-at91udc_probe.patch
new file mode 100644
index 00000000000000..9c102fc811b23b
--- /dev/null
+++ b/usb/usb-gadget-double-free_irq-in-at91udc_probe.patch
@@ -0,0 +1,27 @@
+From roel.kluin@gmail.com Tue Aug 25 22:52:03 2009
+From: Roel Kluin <roel.kluin@gmail.com>
+Date: Mon, 24 Aug 2009 18:27:23 +0200
+Subject: USB: gadget: double free_irq() in at91udc_probe()
+To: David Brownell <dbrownell@users.sourceforge.net>, linux-usb@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
+Message-ID: <4A92BF6B.8090408@gmail.com>
+
+
+If request_irq() fails, udp_irq is freed twice.
+
+Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/at91_udc.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/usb/gadget/at91_udc.c
++++ b/drivers/usb/gadget/at91_udc.c
+@@ -1754,7 +1754,6 @@ static int __init at91udc_probe(struct p
+ IRQF_DISABLED, driver_name, udc)) {
+ DBG("request vbus irq %d failed\n",
+ udc->board.vbus_pin);
+- free_irq(udc->udp_irq, udc);
+ retval = -EBUSY;
+ goto fail3;
+ }
diff --git a/usb/usb-omap-isp1301-compile-fix.patch b/usb/usb-omap-isp1301-compile-fix.patch
new file mode 100644
index 00000000000000..d6bf43bc8cfab4
--- /dev/null
+++ b/usb/usb-omap-isp1301-compile-fix.patch
@@ -0,0 +1,79 @@
+From gadiyar@ti.com Tue Aug 25 22:52:26 2009
+From: Anand Gadiyar <gadiyar@ti.com>
+Date: Mon, 24 Aug 2009 20:14:45 +0530
+Subject: USB: OMAP: ISP1301: Compile fix
+To: linux-usb@vger.kernel.org
+Cc: Anand Gadiyar <gadiyar@ti.com>, David Brownell <dbrownell@users.sourceforge.net>
+Message-ID: <1251125085-24274-1-git-send-email-gadiyar@ti.com>
+
+
+OMAP: ISP1301: Compile fix
+
+Fix this build error on non- OMAP-H2/H3/H4 systems:
+(factored out two empty functions as part of the fix)
+
+ CC drivers/usb/otg/isp1301_omap.o
+drivers/usb/otg/isp1301_omap.c: In function 'otg_update_isp':
+drivers/usb/otg/isp1301_omap.c:635: error: implicit declaration of function 'notresponding'
+drivers/usb/otg/isp1301_omap.c: In function 'b_peripheral':
+drivers/usb/otg/isp1301_omap.c:973: error: implicit declaration of function 'enable_vbus_draw'
+drivers/usb/otg/isp1301_omap.c: In function 'isp_update_otg':
+drivers/usb/otg/isp1301_omap.c:1003: error: implicit declaration of function 'enable_vbus_source'
+make[2]: *** [drivers/usb/otg/isp1301_omap.o] Error 1
+make[1]: *** [drivers/usb/otg] Error 2
+make: *** [drivers] Error 2
+
+Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/otg/isp1301_omap.c | 23 +++--------------------
+ 1 file changed, 3 insertions(+), 20 deletions(-)
+
+--- a/drivers/usb/otg/isp1301_omap.c
++++ b/drivers/usb/otg/isp1301_omap.c
+@@ -117,24 +117,7 @@ static void enable_vbus_draw(struct isp1
+ pr_debug(" VBUS %d mA error %d\n", mA, status);
+ }
+
+-static void enable_vbus_source(struct isp1301 *isp)
+-{
+- /* this board won't supply more than 8mA vbus power.
+- * some boards can switch a 100ma "unit load" (or more).
+- */
+-}
+-
+-
+-/* products will deliver OTG messages with LEDs, GUI, etc */
+-static inline void notresponding(struct isp1301 *isp)
+-{
+- printk(KERN_NOTICE "OTG device not responding.\n");
+-}
+-
+-
+-#endif
+-
+-#if defined(CONFIG_MACH_OMAP_H4)
++#else
+
+ static void enable_vbus_draw(struct isp1301 *isp, unsigned mA)
+ {
+@@ -144,6 +127,8 @@ static void enable_vbus_draw(struct isp1
+ */
+ }
+
++#endif
++
+ static void enable_vbus_source(struct isp1301 *isp)
+ {
+ /* this board won't supply more than 8mA vbus power.
+@@ -159,8 +144,6 @@ static inline void notresponding(struct
+ }
+
+
+-#endif
+-
+ /*-------------------------------------------------------------------------*/
+
+ static struct i2c_driver isp1301_driver;
diff --git a/usb/usb-unusual_devs.h-drop-some-unneeded-floppy-entries.patch b/usb/usb-unusual_devs.h-drop-some-unneeded-floppy-entries.patch
new file mode 100644
index 00000000000000..066f1836526052
--- /dev/null
+++ b/usb/usb-unusual_devs.h-drop-some-unneeded-floppy-entries.patch
@@ -0,0 +1,74 @@
+From zaitcev@redhat.com Tue Aug 25 22:53:18 2009
+From: Pete Zaitcev <zaitcev@redhat.com>
+Date: Thu, 20 Aug 2009 20:00:19 -0600
+Subject: USB: unusual_devs.h: drop some unneeded floppy entries
+To: greg@kroah.com
+Cc: linux-usb@vger.kernel.org
+Message-ID: <20090820200019.270b2e98@redhat.com>
+
+
+We set pdt_1f_for_no_lun for UFI devices, so most floppy entiries should
+be unnecessary. This patch removes three entries which I'm certain are.
+ - For Mitsumi I have a customer with RHEL 5 (bz#514296)
+ - For SMSC I accessed Novell's Bugzilla and verified the entry
+ - For Y-E I tested the patch with the actual device
+
+Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
+Signed-off-by: Phil Dibowitz <phil@ipom.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/storage/unusual_devs.h | 22 +---------------------
+ 1 file changed, 1 insertion(+), 21 deletions(-)
+
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -66,13 +66,6 @@ UNUSUAL_DEV( 0x03eb, 0x2002, 0x0100, 0x
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_IGNORE_RESIDUE),
+
+-/* modified by Tobias Lorenz <tobias.lorenz@gmx.net> */
+-UNUSUAL_DEV( 0x03ee, 0x6901, 0x0000, 0x0200,
+- "Mitsumi",
+- "USB FDD",
+- US_SC_DEVICE, US_PR_DEVICE, NULL,
+- US_FL_SINGLE_LUN ),
+-
+ /* Reported by Rodolfo Quesada <rquesada@roqz.net> */
+ UNUSUAL_DEV( 0x03ee, 0x6906, 0x0003, 0x0003,
+ "VIA Technologies Inc.",
+@@ -233,13 +226,6 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_MAX_SECTORS_64 ),
+
+-/* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
+-UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210,
+- "SMSC",
+- "FDC GOLD-2.30",
+- US_SC_DEVICE, US_PR_DEVICE, NULL,
+- US_FL_SINGLE_LUN ),
+-
+ #ifdef NO_SDDR09
+ UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100,
+ "Microtech",
+@@ -664,19 +650,13 @@ UNUSUAL_DEV( 0x055d, 0x2020, 0x0000, 0x
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_SINGLE_LUN ),
+
+-
++/* We keep this entry to force the transport; firmware 3.00 and later is ok. */
+ UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299,
+ "Y-E Data",
+ "Flashbuster-U",
+ US_SC_DEVICE, US_PR_CB, NULL,
+ US_FL_SINGLE_LUN),
+
+-UNUSUAL_DEV( 0x057b, 0x0000, 0x0300, 0x9999,
+- "Y-E Data",
+- "Flashbuster-U",
+- US_SC_DEVICE, US_PR_DEVICE, NULL,
+- US_FL_SINGLE_LUN),
+-
+ /* Reported by Johann Cardon <johann.cardon@free.fr>
+ * This entry is needed only because the device reports
+ * bInterfaceClass = 0xff (vendor-specific)