diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-23 19:16:02 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-23 19:16:02 -0700 |
commit | 822e44fcf9ca052f4708172a2384f67b96649603 (patch) | |
tree | 0f1f1d78f4ce6e9bf2a5c44afa7515d614560d64 /usb | |
parent | bf103007abc2ee6e77e76586a64d678f27b364c4 (diff) | |
download | patches-822e44fcf9ca052f4708172a2384f67b96649603.tar.gz |
usb patches added
Diffstat (limited to 'usb')
21 files changed, 1940 insertions, 7 deletions
diff --git a/usb/usb-add-some-basic-wusb-definitions.patch b/usb/usb-add-some-basic-wusb-definitions.patch new file mode 100644 index 0000000000000..e59672045fca2 --- /dev/null +++ b/usb/usb-add-some-basic-wusb-definitions.patch @@ -0,0 +1,57 @@ +From inaky@linux.intel.com Mon Jun 19 18:19:17 2006 +From: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> +To: gregkh@suse.de +Subject: USB: Add some basic WUSB definitions +Date: Mon, 19 Jun 2006 18:19:01 -0700 +Cc: linux-uwb@bughost.org, linux-usb-devel@lists.sourceforge.net +Content-Disposition: inline +Message-Id: <200606191819.06274.inaky.perez-gonzalez@intel.com> + + +This patch adds basic Wireless USB 1.0 definitions to usb_ch9.h that +fit into the existing set of declarations. Boils down to two new +recipients for requests (ports and remote pipes), rpipe reset and +abort request codes and wire adapter and remote pipe descriptor +types. + +Wire adapters are the USB <-> Wireless USB adaptors; remote pipes +are used by those adapters to pipe the host <-> endpoint traffic. + +Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/usb_ch9.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- gregkh-2.6.orig/include/linux/usb_ch9.h ++++ gregkh-2.6/include/linux/usb_ch9.h +@@ -51,6 +51,9 @@ + #define USB_RECIP_INTERFACE 0x01 + #define USB_RECIP_ENDPOINT 0x02 + #define USB_RECIP_OTHER 0x03 ++/* From Wireless USB 1.0 */ ++#define USB_RECIP_PORT 0x04 ++#define USB_RECIP_RPIPE 0x05 + + /* + * Standard requests, for the bRequest field of a SETUP packet. +@@ -73,7 +76,9 @@ + + #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ + #define USB_REQ_GET_ENCRYPTION 0x0E ++#define USB_REQ_RPIPE_ABORT 0x0E + #define USB_REQ_SET_HANDSHAKE 0x0F ++#define USB_REQ_RPIPE_RESET 0x0F + #define USB_REQ_GET_HANDSHAKE 0x10 + #define USB_REQ_SET_CONNECTION 0x11 + #define USB_REQ_SET_SECURITY_DATA 0x12 +@@ -159,6 +164,8 @@ struct usb_ctrlrequest { + #define USB_DT_BOS 0x0f + #define USB_DT_DEVICE_CAPABILITY 0x10 + #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 ++#define USB_DT_WIRE_ADAPTER 0x21 ++#define USB_DT_RPIPE 0x22 + + /* conventional codes for class-specific descriptors */ + #define USB_DT_CS_DEVICE 0x21 diff --git a/usb/usb-addition-of-vendor-product-id-pair-for-pl2303-driver.patch b/usb/usb-addition-of-vendor-product-id-pair-for-pl2303-driver.patch new file mode 100644 index 0000000000000..50d9358c4b1d1 --- /dev/null +++ b/usb/usb-addition-of-vendor-product-id-pair-for-pl2303-driver.patch @@ -0,0 +1,66 @@ +From pmoulder@poole.csse.monash.edu.au Mon Jun 19 07:57:00 2006 +Date: Mon, 19 Jun 2006 22:47:49 +1000 +From: Peter Moulder <Peter.Moulder@infotech.monash.edu.au> +Subject: USB: Addition of vendor/product id pair for pl2303 driver +To: Greg Kroah-Hartman <greg@kroah.com> +Message-id: <20060619124749.GA13418@mail.csse.monash.edu.au> + +From: Peter Moulder <Peter.Moulder@infotech.monash.edu.au> + +Text from the back of the box, for your information/amusement: + + USB DATA CABLE + FOR K700 Series + + The USB Cable is an ideal link between your mobile phone and PC. Employing + the user-friendiy [sic] USB standard,its capacity for rapid data transfer enables functions + such as synchronization of phone book and calendar,as well as Internet browsing via + a modem-enabled phone.Autual [sic] connection speed is dependent on phone capacity. + + MADE IN CHINA + + +From: Peter Moulder <Peter.Moulder@infotech.monash.edu.au> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/usb/usb-serial.txt | 4 ++-- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 1 + + 3 files changed, 4 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/Documentation/usb/usb-serial.txt ++++ gregkh-2.6/Documentation/usb/usb-serial.txt +@@ -399,10 +399,10 @@ REINER SCT cyberJack pinpad/e-com USB ch + + Prolific PL2303 Driver + +- This driver support any device that has the PL2303 chip from Prolific ++ This driver supports any device that has the PL2303 chip from Prolific + in it. This includes a number of single port USB to serial + converters and USB GPS devices. Devices from Aten (the UC-232) and +- IO-Data work with this driver. ++ IO-Data work with this driver, as does the DCU-11 mobile-phone cable. + + For any questions or problems with this driver, please contact Greg + Kroah-Hartman at greg@kroah.com +--- gregkh-2.6.orig/drivers/usb/serial/pl2303.c ++++ gregkh-2.6/drivers/usb/serial/pl2303.c +@@ -53,6 +53,7 @@ struct pl2303_buf { + static struct usb_device_id id_table [] = { + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, ++ { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, +--- gregkh-2.6.orig/drivers/usb/serial/pl2303.h ++++ gregkh-2.6/drivers/usb/serial/pl2303.h +@@ -10,6 +10,7 @@ + #define PL2303_VENDOR_ID 0x067b + #define PL2303_PRODUCT_ID 0x2303 + #define PL2303_PRODUCT_ID_RSAQ2 0x04bb ++#define PL2303_PRODUCT_ID_DCU11 0x1234 + #define PL2303_PRODUCT_ID_PHAROS 0xaaa0 + #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 + diff --git a/usb/usb-au1200-ehci-and-ohci-fixes.patch b/usb/usb-au1200-ehci-and-ohci-fixes.patch new file mode 100644 index 0000000000000..11ea49522b55b --- /dev/null +++ b/usb/usb-au1200-ehci-and-ohci-fixes.patch @@ -0,0 +1,108 @@ +From ralf@linux-mips.org Fri Jun 23 13:36:11 2006 +Date: Fri, 23 Jun 2006 21:36:07 +0100 +From: Ralf Baechle <ralf@linux-mips.org> +To: gregkh@suse.de, dbrownell@users.sourceforge.net +Subject: USB: au1200: EHCI and OHCI fixes +Message-ID: <20060623203607.GA4653@linux-mips.org> +Content-Disposition: inline + +From: Daniel Mack <daniel@caiaq.de> + +I received an DBAU1200 eval kit from AMD a few days ago and tried to +enable the USB2 port, but the current linux-2.6 GIT did not even +compile with CONFIG_SOC_1200, CONFIG_SOC_AU1X00, CONFIG_USB_EHCI and +CONFIG_USB_OHCI set. +Furthermore, in ehci-hcd.c, platform_driver_register() was called with +an improper argument of type 'struct device_driver *' which of course +ended up in a kernel oops. How could that ever have worked on your +machines? + +Anyway, here's a trivial patch that makes the USB subsystem working +on my board for both OHCI and EHCI. +It also removes the /* FIXME use "struct platform_driver" */. + +Signed-off-by: Daniel Mack <daniel@caiaq.de> +Signed-off-by: Ralf Baechle <ralf@linux-mips.org> +Acked-by: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-au1xxx.c | 23 ++++++++++------------- + drivers/usb/host/ohci-au1xxx.c | 1 + + 2 files changed, 11 insertions(+), 13 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/host/ehci-au1xxx.c ++++ gregkh-2.6/drivers/usb/host/ehci-au1xxx.c +@@ -41,8 +41,6 @@ + #endif + #define USBH_DISABLE (USB_MCFG_EBMEN | USB_MCFG_EMEMEN) + +-#endif /* Au1200 */ +- + extern int usb_disabled(void); + + /*-------------------------------------------------------------------------*/ +@@ -107,9 +105,9 @@ int usb_ehci_au1xxx_probe(const struct h + + /* Au1200 AB USB does not support coherent memory */ + if (!(read_c0_prid() & 0xff)) { +- pr_info("%s: this is chip revision AB!\n", dev->dev.name); ++ pr_info("%s: this is chip revision AB!\n", dev->name); + pr_info("%s: update your board or re-configure the kernel\n", +- dev->dev.name); ++ dev->name); + return -ENODEV; + } + #endif +@@ -228,9 +226,8 @@ static const struct hc_driver ehci_au1xx + + /*-------------------------------------------------------------------------*/ + +-static int ehci_hcd_au1xxx_drv_probe(struct device *dev) ++static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) + { +- struct platform_device *pdev = to_platform_device(dev); + struct usb_hcd *hcd = NULL; + int ret; + +@@ -243,10 +240,9 @@ static int ehci_hcd_au1xxx_drv_probe(str + return ret; + } + +-static int ehci_hcd_au1xxx_drv_remove(struct device *dev) ++static int ehci_hcd_au1xxx_drv_remove(struct platform_device *pdev) + { +- struct platform_device *pdev = to_platform_device(dev); +- struct usb_hcd *hcd = dev_get_drvdata(dev); ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); + + usb_ehci_au1xxx_remove(hcd, pdev); + return 0; +@@ -269,12 +265,13 @@ static int ehci_hcd_au1xxx_drv_resume(st + } + */ + MODULE_ALIAS("au1xxx-ehci"); +-/* FIXME use "struct platform_driver" */ +-static struct device_driver ehci_hcd_au1xxx_driver = { +- .name = "au1xxx-ehci", +- .bus = &platform_bus_type, ++static struct platform_driver ehci_hcd_au1xxx_driver = { + .probe = ehci_hcd_au1xxx_drv_probe, + .remove = ehci_hcd_au1xxx_drv_remove, + /*.suspend = ehci_hcd_au1xxx_drv_suspend, */ + /*.resume = ehci_hcd_au1xxx_drv_resume, */ ++ .driver = { ++ .name = "au1xxx-ehci", ++ .bus = &platform_bus_type ++ } + }; +--- gregkh-2.6.orig/drivers/usb/host/ohci-au1xxx.c ++++ gregkh-2.6/drivers/usb/host/ohci-au1xxx.c +@@ -110,6 +110,7 @@ static void au1xxx_start_ohc(struct plat + + printk(KERN_DEBUG __FILE__ + ": Clock to USB host has been enabled \n"); ++#endif + } + + static void au1xxx_stop_ohc(struct platform_device *dev) diff --git a/usb/usb-au1xxx-compile-fixes-for-ohci-for-au1200.patch b/usb/usb-au1xxx-compile-fixes-for-ohci-for-au1200.patch new file mode 100644 index 0000000000000..682961b28d69c --- /dev/null +++ b/usb/usb-au1xxx-compile-fixes-for-ohci-for-au1200.patch @@ -0,0 +1,48 @@ +From ralf@linux-mips.org Fri Jun 23 03:55:48 2006 +Date: Fri, 23 Jun 2006 11:55:43 +0100 +From: Ralf Baechle <ralf@linux-mips.org> +To: gregkh@suse.de, linux-usb-devel@lists.sourceforge.net +Subject: USB: au1xxx: compile fixes for OHCI for au1200 +Message-ID: <20060623105543.GH5896@linux-mips.org> +Content-Disposition: inline + +From: Domen Puncer <domen.puncer@ultra.si> + +Compile fixes for au1200 ohci. + +First part looks a bit hackish... but it works for me. + + +Signed-off-by: Domen Puncer <domen.puncer@ultra.si> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ohci-au1xxx.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/host/ohci-au1xxx.c ++++ gregkh-2.6/drivers/usb/host/ohci-au1xxx.c +@@ -101,9 +101,11 @@ static void au1xxx_start_ohc(struct plat + + #endif /* Au1200 */ + ++#ifndef CONFIG_SOC_AU1200 + /* wait for reset complete (read register twice; see au1500 errata) */ + while (au_readl(USB_HOST_CONFIG), + !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) ++#endif + udelay(1000); + + printk(KERN_DEBUG __FILE__ +@@ -157,9 +159,9 @@ static int usb_ohci_au1xxx_probe(const s + /* Au1200 AB USB does not support coherent memory */ + if (!(read_c0_prid() & 0xff)) { + pr_info("%s: this is chip revision AB !!\n", +- dev->dev.name); ++ dev->name); + pr_info("%s: update your board or re-configure the kernel\n", +- dev->dev.name); ++ dev->name); + return -ENODEV; + } + #endif diff --git a/usb/usb-fix-usb-kernel-doc.patch b/usb/usb-fix-usb-kernel-doc.patch new file mode 100644 index 0000000000000..4ab060cae514c --- /dev/null +++ b/usb/usb-fix-usb-kernel-doc.patch @@ -0,0 +1,29 @@ +From rdunlap@xenotime.net Thu Jun 22 15:22:30 2006 +Date: Thu, 22 Jun 2006 15:12:41 -0700 +From: "Randy.Dunlap" <rdunlap@xenotime.net> +Cc: gregkh <greg@kroah.com> +Subject: USB: fix usb kernel-doc +Message-Id: <20060622151241.6d89dacf.rdunlap@xenotime.net> + +From: Randy Dunlap <rdunlap@xenotime.net> + +Warning(/var/linsrc/linux-2617-g4//include/linux/usb.h:66): No description found for parameter 'ep_dev' + +Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/usb.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/include/linux/usb.h ++++ gregkh-2.6/include/linux/usb.h +@@ -48,7 +48,7 @@ struct ep_device; + * @urb_list: urbs queued to this endpoint; maintained by usbcore + * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) + * with one or more transfer descriptors (TDs) per urb +- * @kobj: kobject for sysfs info ++ * @ep_dev: ep_device for sysfs info + * @extra: descriptors following this endpoint in the configuration + * @extralen: how many bytes of "extra" are valid + * diff --git a/usb/usb-fix-usb-serial-leaks-oopses-on-disconnect.patch b/usb/usb-fix-usb-serial-leaks-oopses-on-disconnect.patch new file mode 100644 index 0000000000000..52d6465013f77 --- /dev/null +++ b/usb/usb-fix-usb-serial-leaks-oopses-on-disconnect.patch @@ -0,0 +1,76 @@ +From zaitcev@redhat.com Wed Jun 21 15:01:08 2006 +Date: Wed, 21 Jun 2006 15:00:45 -0700 +From: Pete Zaitcev <zaitcev@redhat.com> +To: greg@kroah.com +Cc: zaitcev@redhat.com +Subject: USB: fix usb-serial leaks, oopses on disconnect +Message-Id: <20060621150045.aa524555.zaitcev@redhat.com> + +This fix addresses two issues: +- Unattached port structures were not freed +- My initial fix for crash when eventd runs a work in a freed port + did not go far enough + +Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/usb-serial.c | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c ++++ gregkh-2.6/drivers/usb/serial/usb-serial.c +@@ -41,6 +41,8 @@ + #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/" + #define DRIVER_DESC "USB Serial Driver core" + ++static void port_free(struct usb_serial_port *port); ++ + /* Driver structure we register with the USB core */ + static struct usb_driver usb_serial_driver = { + .name = "usbserial", +@@ -147,23 +149,10 @@ static void destroy_serial(struct kref * + port = serial->port[i]; + if (!port) + continue; +- usb_kill_urb(port->read_urb); +- usb_free_urb(port->read_urb); +- usb_kill_urb(port->write_urb); +- usb_free_urb(port->write_urb); +- usb_kill_urb(port->interrupt_in_urb); +- usb_free_urb(port->interrupt_in_urb); +- usb_kill_urb(port->interrupt_out_urb); +- usb_free_urb(port->interrupt_out_urb); +- kfree(port->bulk_in_buffer); +- kfree(port->bulk_out_buffer); +- kfree(port->interrupt_in_buffer); +- kfree(port->interrupt_out_buffer); ++ port_free(port); + } + } + +- flush_scheduled_work(); /* port->work */ +- + usb_put_dev(serial->dev); + + /* free up any memory that we allocated */ +@@ -565,6 +554,11 @@ static void port_release(struct device * + struct usb_serial_port *port = to_usb_serial_port(dev); + + dbg ("%s - %s", __FUNCTION__, dev->bus_id); ++ port_free(port); ++} ++ ++static void port_free(struct usb_serial_port *port) ++{ + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + usb_kill_urb(port->write_urb); +@@ -577,6 +571,7 @@ static void port_release(struct device * + kfree(port->bulk_out_buffer); + kfree(port->interrupt_in_buffer); + kfree(port->interrupt_out_buffer); ++ flush_scheduled_work(); /* port->work */ + kfree(port); + } + diff --git a/usb/usb-fix-visor-leaks.patch b/usb/usb-fix-visor-leaks.patch new file mode 100644 index 0000000000000..b20ab90138686 --- /dev/null +++ b/usb/usb-fix-visor-leaks.patch @@ -0,0 +1,95 @@ +From zaitcev@redhat.com Wed Jun 21 15:03:55 2006 +Date: Wed, 21 Jun 2006 15:03:40 -0700 +From: Pete Zaitcev <zaitcev@redhat.com> +To: greg@kroah.com +Cc: zaitcev@redhat.com +Subject: USB: fix visor leaks +Message-Id: <20060621150340.df69ec81.zaitcev@redhat.com> + +This patch fixes blatant leaks in visor driver and makes it report +mode sensible things in ->write_room (this is only needed if your visor +is a terminal though). + +It is made to fit into 80 columns with a temporary variable. +Might even save a few instructions... + +Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/visor.c | 36 +++++++++++++++++++++++++++++++++--- + 1 file changed, 33 insertions(+), 3 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/serial/visor.c ++++ gregkh-2.6/drivers/usb/serial/visor.c +@@ -436,13 +436,25 @@ static int visor_write (struct usb_seria + + static int visor_write_room (struct usb_serial_port *port) + { ++ struct visor_private *priv = usb_get_serial_port_data(port); ++ unsigned long flags; ++ + dbg("%s - port %d", __FUNCTION__, port->number); + + /* + * We really can take anything the user throws at us + * but let's pick a nice big number to tell the tty +- * layer that we have lots of free space ++ * layer that we have lots of free space, unless we don't. + */ ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) { ++ spin_unlock_irqrestore(&priv->lock, flags); ++ dbg("%s - write limit hit\n", __FUNCTION__); ++ return 0; ++ } ++ spin_unlock_irqrestore(&priv->lock, flags); ++ + return 2048; + } + +@@ -759,15 +771,22 @@ static int visor_calc_num_ports (struct + + static int generic_startup(struct usb_serial *serial) + { ++ struct usb_serial_port **ports = serial->port; + struct visor_private *priv; + int i; + + for (i = 0; i < serial->num_ports; ++i) { + priv = kzalloc (sizeof(*priv), GFP_KERNEL); +- if (!priv) ++ if (!priv) { ++ while (i-- != 0) { ++ priv = usb_get_serial_port_data(ports[i]); ++ usb_set_serial_port_data(ports[i], NULL); ++ kfree(priv); ++ } + return -ENOMEM; ++ } + spin_lock_init(&priv->lock); +- usb_set_serial_port_data(serial->port[i], priv); ++ usb_set_serial_port_data(ports[i], priv); + } + return 0; + } +@@ -877,7 +896,18 @@ static int clie_5_attach (struct usb_ser + + static void visor_shutdown (struct usb_serial *serial) + { ++ struct visor_private *priv; ++ int i; ++ + dbg("%s", __FUNCTION__); ++ ++ for (i = 0; i < serial->num_ports; i++) { ++ priv = usb_get_serial_port_data(serial->port[i]); ++ if (priv) { ++ usb_set_serial_port_data(serial->port[i], NULL); ++ kfree(priv); ++ } ++ } + } + + static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) diff --git a/usb/usb-hub-don-t-return-status-0-from-resume.patch b/usb/usb-hub-don-t-return-status-0-from-resume.patch new file mode 100644 index 0000000000000..54876894d44b6 --- /dev/null +++ b/usb/usb-hub-don-t-return-status-0-from-resume.patch @@ -0,0 +1,33 @@ +From stern@rowland.harvard.edu Mon Jun 19 12:12:45 2006 +Date: Mon, 19 Jun 2006 15:12:38 -0400 (EDT) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com> +cc: USB development list <linux-usb-devel@lists.sourceforge.net> +Subject: USB hub: don't return status > 0 from resume +Message-ID: <Pine.LNX.4.44L0.0606191509050.5722-100000@iolanthe.rowland.org> + +finish_device_resume() in the hub driver isn't careful always to return +a negative code in all the error pathways. It also doesn't return 0 in +all the success pathways. This patch (as724) fixes the behavior. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/hub.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/usb/core/hub.c ++++ gregkh-2.6/drivers/usb/core/hub.c +@@ -1791,7 +1791,10 @@ static int finish_device_resume(struct u + * and device drivers will know about any resume quirks. + */ + status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); +- if (status < 2) ++ if (status >= 0) ++ status = (status == 2 ? 0 : -ENODEV); ++ ++ if (status) + dev_dbg(&udev->dev, + "gone after usb resume? status %d\n", + status); diff --git a/usb/usb-new-device-id-for-thorlabs-motor-driver.patch b/usb/usb-new-device-id-for-thorlabs-motor-driver.patch new file mode 100644 index 0000000000000..86879bc0f36a0 --- /dev/null +++ b/usb/usb-new-device-id-for-thorlabs-motor-driver.patch @@ -0,0 +1,36 @@ +From siddons@bnl.gov Sat Jun 17 15:09:21 2006 +Message-ID: <44947D8B.2040702@bnl.gov> +Date: Sat, 17 Jun 2006 18:09:15 -0400 +From: "D. Peter Siddons" <siddons@bnl.gov> +To: Greg KH <greg@kroah.com> +Subject: USB: new device id for Thorlabs motor driver + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio.h | 5 +++++ + 2 files changed, 6 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.c ++++ gregkh-2.6/drivers/usb/serial/ftdi_sio.c +@@ -501,6 +501,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, + { }, /* Optional parameter entry */ + { } /* Terminating entry */ + }; +--- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.h ++++ gregkh-2.6/drivers/usb/serial/ftdi_sio.h +@@ -442,6 +442,11 @@ + */ + #define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */ + ++/* ++ * ThorLabs USB motor drivers ++ */ ++#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */ ++ + /* Commands */ + #define FTDI_SIO_RESET 0 /* Reset the port */ + #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ diff --git a/usb/usb-new-device-ids-for-ftdi_sio-driver.patch b/usb/usb-new-device-ids-for-ftdi_sio-driver.patch new file mode 100644 index 0000000000000..beff64355f127 --- /dev/null +++ b/usb/usb-new-device-ids-for-ftdi_sio-driver.patch @@ -0,0 +1,39 @@ +From cmariac@starting-point-systems.com Fri Jun 23 08:37:11 2006 +Message-ID: <449C0A75.8050506@starting-point-systems.com> +From: Christophe Mariac <cmariac@starting-point-systems.com> +Date: Fri, 23 Jun 2006 17:36:21 +0200 +To: Greg KH <greg@kroah.com> +Subject: USB: new device ids for ftdi_sio driver + + +From: Christophe Mariac <cmariac@starting-point-systems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio.h | 3 +++ + 2 files changed, 4 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.c ++++ gregkh-2.6/drivers/usb/serial/ftdi_sio.c +@@ -314,6 +314,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, +--- gregkh-2.6.orig/drivers/usb/serial/ftdi_sio.h ++++ gregkh-2.6/drivers/usb/serial/ftdi_sio.h +@@ -36,6 +36,9 @@ + #define FTDI_ACTZWAVE_PID 0xF2D0 + + ++/* www.starting-point-systems.com µChameleon device */ ++#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */ ++ + /* www.irtrans.de device */ + #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ + diff --git a/usb/usb-ohci-avoids-root-hub-timer-polling.patch b/usb/usb-ohci-avoids-root-hub-timer-polling.patch index 026efbce1c258..d185612acd383 100644 --- a/usb/usb-ohci-avoids-root-hub-timer-polling.patch +++ b/usb/usb-ohci-avoids-root-hub-timer-polling.patch @@ -45,7 +45,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> .bus_resume = ohci_bus_resume, --- gregkh-2.6.orig/drivers/usb/host/ohci-au1xxx.c +++ gregkh-2.6/drivers/usb/host/ohci-au1xxx.c -@@ -289,6 +289,7 @@ static const struct hc_driver ohci_au1xx +@@ -292,6 +292,7 @@ static const struct hc_driver ohci_au1xx */ .hub_status_data = ohci_hub_status_data, .hub_control = ohci_hub_control, diff --git a/usb/usb-ohci-bits-for-the-cirrus-ep93xx.patch b/usb/usb-ohci-bits-for-the-cirrus-ep93xx.patch new file mode 100644 index 0000000000000..e86b1e32a8eed --- /dev/null +++ b/usb/usb-ohci-bits-for-the-cirrus-ep93xx.patch @@ -0,0 +1,280 @@ +From linux-usb-devel-bounces@lists.sourceforge.net Fri Jun 23 14:03:01 2006 +Date: Fri, 23 Jun 2006 23:02:01 +0200 +From: Lennert Buytenhek <buytenh@wantstofly.org> +To: David Brownell <david-b@pacbell.net>, Ben Dooks <ben-linux-usb@fluff.org> +Message-ID: <20060623210201.GA4733@xi.wantstofly.org> +Content-Disposition: inline +Subject: USB: ohci bits for the cirrus ep93xx + +This patch adds OHCI glue bits for the USB host interface in the +Cirrus ep93xx (arm920t) CPU. + +Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> +Acked-by: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/Kconfig | 1 + drivers/usb/host/ohci-ep93xx.c | 225 +++++++++++++++++++++++++++++++++++++++++ + drivers/usb/host/ohci-hcd.c | 5 + 3 files changed, 231 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/Kconfig ++++ gregkh-2.6/drivers/usb/Kconfig +@@ -23,6 +23,7 @@ config USB_ARCH_HAS_OHCI + default y if ARCH_LH7A404 + default y if ARCH_S3C2410 + default y if PXA27x ++ default y if ARCH_EP93XX + default y if ARCH_AT91RM9200 + # PPC: + default y if STB03xxx +--- /dev/null ++++ gregkh-2.6/drivers/usb/host/ohci-ep93xx.c +@@ -0,0 +1,225 @@ ++/* ++ * OHCI HCD (Host Controller Driver) for USB. ++ * ++ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> ++ * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> ++ * (C) Copyright 2002 Hewlett-Packard Company ++ * ++ * Bus Glue for ep93xx. ++ * ++ * Written by Christopher Hoover <ch@hpl.hp.com> ++ * Based on fragments of previous driver by Russell King et al. ++ * ++ * Modified for LH7A404 from ohci-sa1111.c ++ * by Durgesh Pattamatta <pattamattad@sharpsec.com> ++ * ++ * Modified for pxa27x from ohci-lh7a404.c ++ * by Nick Bane <nick@cecomputing.co.uk> 26-8-2004 ++ * ++ * Modified for ep93xx from ohci-pxa27x.c ++ * by Lennert Buytenhek <buytenh@wantstofly.org> 28-2-2006 ++ * Based on an earlier driver by Ray Lehtiniemi ++ * ++ * This file is licenced under the GPL. ++ */ ++ ++#include <linux/clk.h> ++#include <linux/device.h> ++#include <linux/signal.h> ++#include <linux/platform_device.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware.h> ++ ++static struct clk *usb_host_clock; ++ ++static void ep93xx_start_hc(struct device *dev) ++{ ++ clk_enable(usb_host_clock); ++} ++ ++static void ep93xx_stop_hc(struct device *dev) ++{ ++ clk_disable(usb_host_clock); ++} ++ ++static int usb_hcd_ep93xx_probe(const struct hc_driver *driver, ++ struct platform_device *pdev) ++{ ++ int retval; ++ struct usb_hcd *hcd; ++ ++ if (pdev->resource[1].flags != IORESOURCE_IRQ) { ++ pr_debug("resource[1] is not IORESOURCE_IRQ"); ++ return -ENOMEM; ++ } ++ ++ hcd = usb_create_hcd(driver, &pdev->dev, "ep93xx"); ++ if (hcd == NULL) ++ return -ENOMEM; ++ ++ hcd->rsrc_start = pdev->resource[0].start; ++ hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; ++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { ++ usb_put_hcd(hcd); ++ retval = -EBUSY; ++ goto err1; ++ } ++ ++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); ++ if (hcd->regs == NULL) { ++ pr_debug("ioremap failed"); ++ retval = -ENOMEM; ++ goto err2; ++ } ++ ++ usb_host_clock = clk_get(&pdev->dev, "usb_host"); ++ ep93xx_start_hc(&pdev->dev); ++ ++ ohci_hcd_init(hcd_to_ohci(hcd)); ++ ++ retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT); ++ if (retval == 0) ++ return retval; ++ ++ ep93xx_stop_hc(&pdev->dev); ++ iounmap(hcd->regs); ++err2: ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++err1: ++ usb_put_hcd(hcd); ++ ++ return retval; ++} ++ ++static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd, ++ struct platform_device *pdev) ++{ ++ usb_remove_hcd(hcd); ++ ep93xx_stop_hc(&pdev->dev); ++ clk_put(usb_host_clock); ++ iounmap(hcd->regs); ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++ usb_put_hcd(hcd); ++} ++ ++static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd) ++{ ++ struct ohci_hcd *ohci = hcd_to_ohci(hcd); ++ int ret; ++ ++ if ((ret = ohci_init(ohci)) < 0) ++ return ret; ++ ++ if ((ret = ohci_run(ohci)) < 0) { ++ err("can't start %s", hcd->self.bus_name); ++ ohci_stop(hcd); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static struct hc_driver ohci_ep93xx_hc_driver = { ++ .description = hcd_name, ++ .product_desc = "EP93xx OHCI", ++ .hcd_priv_size = sizeof(struct ohci_hcd), ++ .irq = ohci_irq, ++ .flags = HCD_USB11 | HCD_MEMORY, ++ .start = ohci_ep93xx_start, ++ .stop = ohci_stop, ++ .urb_enqueue = ohci_urb_enqueue, ++ .urb_dequeue = ohci_urb_dequeue, ++ .endpoint_disable = ohci_endpoint_disable, ++ .get_frame_number = ohci_get_frame, ++ .hub_status_data = ohci_hub_status_data, ++ .hub_control = ohci_hub_control, ++#ifdef CONFIG_PM ++ .bus_suspend = ohci_bus_suspend, ++ .bus_resume = ohci_bus_resume, ++#endif ++ .start_port_reset = ohci_start_port_reset, ++}; ++ ++extern int usb_disabled(void); ++ ++static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = -ENODEV; ++ if (!usb_disabled()) ++ ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev); ++ ++ return ret; ++} ++ ++static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev) ++{ ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); ++ ++ usb_hcd_ep93xx_remove(hcd, pdev); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); ++ struct ochi_hcd *ohci = hcd_to_ohci(hcd); ++ ++ if (time_before(jiffies, ohci->next_statechange)) ++ msleep(5); ++ ohci->next_statechange = jiffies; ++ ++ ep93xx_stop_hc(&pdev->dev); ++ hcd->state = HC_STATE_SUSPENDED; ++ pdev->dev.power.power_state = PMSG_SUSPEND; ++ ++ return 0; ++} ++ ++static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev) ++{ ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); ++ struct ohci_hcd *ohci = hcd_to_ohci(hcd); ++ int status; ++ ++ if (time_before(jiffies, ohci->next_statechange)) ++ msleep(5); ++ ohci->next_statechange = jiffies; ++ ++ ep93xx_start_hc(&pdev->dev); ++ pdev->dev.power.power_state = PMSG_ON; ++ usb_hcd_resume_root_hub(hcd); ++ ++ return 0; ++} ++#endif ++ ++ ++static struct platform_driver ohci_hcd_ep93xx_driver = { ++ .probe = ohci_hcd_ep93xx_drv_probe, ++ .remove = ohci_hcd_ep93xx_drv_remove, ++#ifdef CONFIG_PM ++ .suspend = ohci_hcd_ep93xx_drv_suspend, ++ .resume = ohci_hcd_ep93xx_drv_resume, ++#endif ++ .driver = { ++ .name = "ep93xx-ohci", ++ }, ++}; ++ ++static int __init ohci_hcd_ep93xx_init(void) ++{ ++ return platform_driver_register(&ohci_hcd_ep93xx_driver); ++} ++ ++static void __exit ohci_hcd_ep93xx_cleanup(void) ++{ ++ platform_driver_unregister(&ohci_hcd_ep93xx_driver); ++} ++ ++module_init(ohci_hcd_ep93xx_init); ++module_exit(ohci_hcd_ep93xx_cleanup); +--- gregkh-2.6.orig/drivers/usb/host/ohci-hcd.c ++++ gregkh-2.6/drivers/usb/host/ohci-hcd.c +@@ -902,6 +902,10 @@ MODULE_LICENSE ("GPL"); + #include "ohci-pxa27x.c" + #endif + ++#ifdef CONFIG_ARCH_EP93XX ++#include "ohci-ep93xx.c" ++#endif ++ + #ifdef CONFIG_SOC_AU1X00 + #include "ohci-au1xxx.c" + #endif +@@ -920,6 +924,7 @@ MODULE_LICENSE ("GPL"); + || defined(CONFIG_ARCH_OMAP) \ + || defined (CONFIG_ARCH_LH7A404) \ + || defined (CONFIG_PXA27x) \ ++ || defined (CONFIG_ARCH_EP93XX) \ + || defined (CONFIG_SOC_AU1X00) \ + || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ + || defined (CONFIG_ARCH_AT91RM9200) \ diff --git a/usb/usb-ohci-hub-code-unaligned-access.patch b/usb/usb-ohci-hub-code-unaligned-access.patch new file mode 100644 index 0000000000000..2bc187a2f0ba8 --- /dev/null +++ b/usb/usb-ohci-hub-code-unaligned-access.patch @@ -0,0 +1,38 @@ +From davem@davemloft.net Wed Jun 21 22:26:19 2006 +Date: Wed, 21 Jun 2006 22:26:09 -0700 (PDT) +From: David Miller <davem@davemloft.net> +Message-Id: <20060621.222609.07641180.davem@davemloft.net> +To: gregkh@suse.de +Subject: USB: OHCI hub code unaligned access + + +I noticed this while debugging something unrelated on +sparc64. + +Signed-off-by: David S. Miller <davem@davemloft.net> +Cc: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ohci-hub.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/host/ohci-hub.c ++++ gregkh-2.6/drivers/usb/host/ohci-hub.c +@@ -581,14 +581,14 @@ static int ohci_hub_control ( + break; + case GetHubStatus: + temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE); +- *(__le32 *) buf = cpu_to_le32 (temp); ++ put_unaligned(cpu_to_le32 (temp), (__le32 *) buf); + break; + case GetPortStatus: + if (!wIndex || wIndex > ports) + goto error; + wIndex--; + temp = roothub_portstatus (ohci, wIndex); +- *(__le32 *) buf = cpu_to_le32 (temp); ++ put_unaligned(cpu_to_le32 (temp), (__le32 *) buf); + + #ifndef OHCI_VERBOSE_DEBUG + if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ diff --git a/usb/usb-rename-cypress-cy7c63xxx-driver-to-proper-name-and-fix-up-some-tiny-things.patch b/usb/usb-rename-cypress-cy7c63xxx-driver-to-proper-name-and-fix-up-some-tiny-things.patch new file mode 100644 index 0000000000000..440d10f7f72a3 --- /dev/null +++ b/usb/usb-rename-cypress-cy7c63xxx-driver-to-proper-name-and-fix-up-some-tiny-things.patch @@ -0,0 +1,607 @@ +From srs0=1aj4=aj=fh-wolfenbuettel.de=o.bock@srs.kundenserver.de Thu Jun 22 10:04:52 2006 +From: Oliver Bock <o.bock@fh-wolfenbuettel.de> +To: Greg KH <greg@kroah.com> +Subject: USB: rename Cypress CY7C63xxx driver to proper name and fix up some tiny things +Date: Thu, 22 Jun 2006 19:04:47 +0200 +Cc: Greg Kroah-Hartman <gregkh@suse.de> +Content-Disposition: inline +Message-Id: <200606221904.47759.o.bock@fh-wolfenbuettel.de> + +From: Oliver Bock <o.bock@fh-wolfenbuettel.de> + +This is a new driver for the Cypress CY7C63xxx mirco controller series. +It currently supports the pre-programmed CYC63001A-PC by AK Modul-Bus +GmbH. It's based on a kernel 2.4 driver (cyport) by Marcus Maul which I +ported to kernel 2.6 using sysfs. I intend to support more controllers +of this family (and more features) as soon as I get hold of the required +IDs etc. Please see the source code's header for more information. + +Signed-off-by: Oliver Bock <o.bock@fh-wolfenbuettel.de> + + +--- + drivers/usb/Makefile | 2 + drivers/usb/misc/Kconfig | 10 - + drivers/usb/misc/Makefile | 2 + drivers/usb/misc/cy7c63.c | 244 --------------------------------- + drivers/usb/misc/cypress_cy7c63.c | 279 ++++++++++++++++++++++++++++++++++++++ + 5 files changed, 286 insertions(+), 251 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/Makefile ++++ gregkh-2.6/drivers/usb/Makefile +@@ -48,7 +48,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/ + obj-$(CONFIG_USB_SERIAL) += serial/ + + obj-$(CONFIG_USB_AUERSWALD) += misc/ +-obj-$(CONFIG_USB_CY7C63) += misc/ ++obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/ + obj-$(CONFIG_USB_CYTHERM) += misc/ + obj-$(CONFIG_USB_EMI26) += misc/ + obj-$(CONFIG_USB_EMI62) += misc/ +--- gregkh-2.6.orig/drivers/usb/misc/Kconfig ++++ gregkh-2.6/drivers/usb/misc/Kconfig +@@ -88,19 +88,19 @@ config USB_LED + To compile this driver as a module, choose M here: the + module will be called usbled. + +-config USB_CY7C63 ++config USB_CYPRESS_CY7C63 + tristate "Cypress CY7C63xxx USB driver support" + depends on USB + help + Say Y here if you want to connect a Cypress CY7C63xxx +- micro controller to your computer's USB port. This driver +- supports the pre-programmed devices (incl. firmware) by +- AK Modul-Bus Computer GmbH. ++ micro controller to your computer's USB port. Currently this ++ driver supports the pre-programmed devices (incl. firmware) ++ by AK Modul-Bus Computer GmbH. + + Please see: http://www.ak-modul-bus.de/stat/mikrocontroller.html + + To compile this driver as a module, choose M here: the +- module will be called cy7c63. ++ module will be called cypress_cy7c63. + + config USB_CYTHERM + tristate "Cypress USB thermometer driver support" +--- gregkh-2.6.orig/drivers/usb/misc/Makefile ++++ gregkh-2.6/drivers/usb/misc/Makefile +@@ -4,7 +4,7 @@ + # + + obj-$(CONFIG_USB_AUERSWALD) += auerswald.o +-obj-$(CONFIG_USB_CY7C63) += cy7c63.o ++obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o + obj-$(CONFIG_USB_CYTHERM) += cytherm.o + obj-$(CONFIG_USB_EMI26) += emi26.o + obj-$(CONFIG_USB_EMI62) += emi62.o +--- gregkh-2.6.orig/drivers/usb/misc/cy7c63.c ++++ /dev/null +@@ -1,244 +0,0 @@ +-/* +-* cy7c63.c +-* +-* Copyright (c) 2006 Oliver Bock (bock@fh-wolfenbuettel.de) +-* +-* This driver is based on the Cypress Thermometer USB Driver by +-* Marcus Maul and the 2.0 version of Greg Kroah-Hartman's +-* USB Skeleton driver. +-* +-* Is is a generic driver for the Cypress CY7C63000 family. +-* For the time being it enables you to toggle the single I/O ports +-* of the device. +-* +-* Supported vendors: AK Modul-Bus Computer GmbH +-* Supported devices: CY7C63001A-PC (to be continued...) +-* Supported functions: Read/Write Ports (to be continued...) +-* +-* Chipsets families: CY7C63000, CY7C63001, CY7C63100, CY7C63101 +-* +-* +-* This program is free software; you can redistribute it and/or +-* modify it under the terms of the GNU General Public License as +-* published by the Free Software Foundation, version 2. +-*/ +- +-#include <linux/init.h> +-#include <linux/module.h> +-#include <linux/kernel.h> +-#include <linux/usb.h> +- +-#define DRIVER_AUTHOR "Oliver Bock (bock@fh-wolfenbuettel.de)" +-#define DRIVER_DESC "Cypress CY7C63xxx USB driver" +- +-#define CY7C63_VENDOR_ID 0xa2c +-#define CY7C63_PRODUCT_ID 0x8 +- +-#define CY7C63_READ_PORT 0x4 +-#define CY7C63_WRITE_PORT 0x5 +-#define CY7C63_READ_RAM 0x2 +-#define CY7C63_WRITE_RAM 0x3 +-#define CY7C63_READ_ROM 0x1 +- +-#define CY7C63_READ_PORT_ID0 0 +-#define CY7C63_WRITE_PORT_ID0 0 +-#define CY7C63_READ_PORT_ID1 0x2 +-#define CY7C63_WRITE_PORT_ID1 1 +- +-#define CY7C63_MAX_REQSIZE 8 +- +- +-/* table of devices that work with this driver */ +-static struct usb_device_id cy7c63_table [] = { +- { USB_DEVICE(CY7C63_VENDOR_ID, CY7C63_PRODUCT_ID) }, +- { } +-}; +-MODULE_DEVICE_TABLE(usb, cy7c63_table); +- +-/* structure to hold all of our device specific stuff */ +-struct cy7c63 { +- struct usb_device * udev; +- char port0; +- char port1; +-}; +- +-/* used to send usb control messages to device */ +-int vendor_command(struct cy7c63 *dev, unsigned char request, +- unsigned char address, unsigned char data) { +- +- int retval = 0; +- unsigned int pipe; +- unsigned char *iobuf; +- +- /* allocate some memory for the i/o buffer*/ +- iobuf = kzalloc(CY7C63_MAX_REQSIZE, GFP_KERNEL); +- if (!iobuf) { +- dev_err(&dev->udev->dev, "Out of memory!\n"); +- retval = -ENOMEM; +- goto error; +- } +- +- dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data); +- +- /* prepare usb control message and send it upstream */ +- pipe = usb_rcvctrlpipe(dev->udev, 0); +- retval = usb_control_msg(dev->udev, pipe, request, +- USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, +- address, data, iobuf, CY7C63_MAX_REQSIZE, +- USB_CTRL_GET_TIMEOUT); +- +- /* store returned data (more READs to be added!) */ +- switch (request) { +- case CY7C63_READ_PORT: +- if (address == CY7C63_READ_PORT_ID0) { +- dev->port0 = iobuf[1]; +- dev_dbg(&dev->udev->dev, +- "READ_PORT0 returned: %d\n",dev->port0); +- } +- else if (address == CY7C63_READ_PORT_ID1) { +- dev->port1 = iobuf[1]; +- dev_dbg(&dev->udev->dev, +- "READ_PORT1 returned: %d\n",dev->port1); +- } +- break; +- } +- +- kfree(iobuf); +-error: +- return retval; +-} +- +-#define get_set_port(num,read_id,write_id) \ +-static ssize_t set_port##num(struct device *dev, struct device_attribute *attr, \ +- const char *buf, size_t count) { \ +- \ +- int value; \ +- int result = 0; \ +- \ +- struct usb_interface *intf = to_usb_interface(dev); \ +- struct cy7c63 *cyp = usb_get_intfdata(intf); \ +- \ +- dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", num); \ +- \ +- /* validate input data */ \ +- if (sscanf(buf, "%d", &value) < 1) { \ +- result = -EINVAL; \ +- goto error; \ +- } \ +- if (value>255 || value<0) { \ +- result = -EINVAL; \ +- goto error; \ +- } \ +- \ +- result = vendor_command(cyp, CY7C63_WRITE_PORT, write_id, \ +- (unsigned char)value); \ +- \ +- dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n",result); \ +-error: \ +- return result < 0 ? result : count; \ +-} \ +- \ +-static ssize_t get_port##num(struct device *dev, \ +- struct device_attribute *attr, char *buf) { \ +- \ +- int result = 0; \ +- \ +- struct usb_interface *intf = to_usb_interface(dev); \ +- struct cy7c63 *cyp = usb_get_intfdata(intf); \ +- \ +- dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", num); \ +- \ +- result = vendor_command(cyp, CY7C63_READ_PORT, read_id, 0); \ +- \ +- dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); \ +- \ +- return sprintf(buf, "%d", cyp->port##num); \ +-} \ +-static DEVICE_ATTR(port##num, S_IWUGO | S_IRUGO, get_port##num, set_port##num); +- +-get_set_port(0, CY7C63_READ_PORT_ID0, CY7C63_WRITE_PORT_ID0); +-get_set_port(1, CY7C63_READ_PORT_ID1, CY7C63_WRITE_PORT_ID1); +- +-static int cy7c63_probe(struct usb_interface *interface, +- const struct usb_device_id *id) { +- +- struct cy7c63 *dev = NULL; +- int retval = -ENOMEM; +- +- /* allocate memory for our device state and initialize it */ +- dev = kzalloc(sizeof(*dev), GFP_KERNEL); +- if (dev == NULL) { +- dev_err(&dev->udev->dev, "Out of memory!\n"); +- goto error; +- } +- +- dev->udev = usb_get_dev(interface_to_usbdev(interface)); +- +- /* save our data pointer in this interface device */ +- usb_set_intfdata(interface, dev); +- +- /* create device attribute files */ +- device_create_file(&interface->dev, &dev_attr_port0); +- device_create_file(&interface->dev, &dev_attr_port1); +- +- /* let the user know what node this device is now attached to */ +- dev_info(&interface->dev, +- "Cypress CY7C63xxx device now attached\n"); +- +- retval = 0; +-error: +- return retval; +-} +- +-static void cy7c63_disconnect(struct usb_interface *interface) { +- +- struct cy7c63 *dev; +- +- dev = usb_get_intfdata(interface); +- usb_set_intfdata(interface, NULL); +- +- /* remove device attribute files */ +- device_remove_file(&interface->dev, &dev_attr_port0); +- device_remove_file(&interface->dev, &dev_attr_port1); +- +- usb_put_dev(dev->udev); +- +- dev_info(&interface->dev, +- "Cypress CY7C63xxx device now disconnected\n"); +- +- kfree(dev); +-} +- +-static struct usb_driver cy7c63_driver = { +- .name = "cy7c63", +- .probe = cy7c63_probe, +- .disconnect = cy7c63_disconnect, +- .id_table = cy7c63_table, +-}; +- +-static int __init cy7c63_init(void) { +- +- int result; +- +- /* register this driver with the USB subsystem */ +- result = usb_register(&cy7c63_driver); +- if (result) { +- err("Function usb_register failed! Error number: %d\n", result); +- } +- +- return result; +-} +- +-static void __exit cy7c63_exit(void) { +- +- /* deregister this driver with the USB subsystem */ +- usb_deregister(&cy7c63_driver); +-} +- +-module_init(cy7c63_init); +-module_exit(cy7c63_exit); +- +-MODULE_AUTHOR(DRIVER_AUTHOR); +-MODULE_DESCRIPTION(DRIVER_DESC); +- +-MODULE_LICENSE("GPL"); +--- /dev/null ++++ gregkh-2.6/drivers/usb/misc/cypress_cy7c63.c +@@ -0,0 +1,279 @@ ++/* ++* cypress_cy7c63.c ++* ++* Copyright (c) 2006 Oliver Bock (o.bock@fh-wolfenbuettel.de) ++* ++* This driver is based on the Cypress USB Driver by Marcus Maul ++* (cyport) and the 2.0 version of Greg Kroah-Hartman's ++* USB Skeleton driver. ++* ++* This is a generic driver for the Cypress CY7C63xxx family. ++* For the time being it enables you to read from and write to ++* the single I/O ports of the device. ++* ++* Supported vendors: AK Modul-Bus Computer GmbH ++* Supported devices: CY7C63001A-PC (to be continued...) ++* Supported functions: Read/Write Ports (to be continued...) ++* ++* ++* This program is free software; you can redistribute it and/or ++* modify it under the terms of the GNU General Public License as ++* published by the Free Software Foundation, version 2. ++*/ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/usb.h> ++ ++#define DRIVER_AUTHOR "Oliver Bock (o.bock@fh-wolfenbuettel.de)" ++#define DRIVER_DESC "Cypress CY7C63xxx USB driver" ++ ++#define CYPRESS_VENDOR_ID 0xa2c ++#define CYPRESS_PRODUCT_ID 0x8 ++ ++#define CYPRESS_READ_PORT 0x4 ++#define CYPRESS_WRITE_PORT 0x5 ++ ++#define CYPRESS_READ_RAM 0x2 ++#define CYPRESS_WRITE_RAM 0x3 ++#define CYPRESS_READ_ROM 0x1 ++ ++#define CYPRESS_READ_PORT_ID0 0 ++#define CYPRESS_WRITE_PORT_ID0 0 ++#define CYPRESS_READ_PORT_ID1 0x2 ++#define CYPRESS_WRITE_PORT_ID1 1 ++ ++#define CYPRESS_MAX_REQSIZE 8 ++ ++ ++/* table of devices that work with this driver */ ++static struct usb_device_id cypress_table [] = { ++ { USB_DEVICE(CYPRESS_VENDOR_ID, CYPRESS_PRODUCT_ID) }, ++ { } ++}; ++MODULE_DEVICE_TABLE(usb, cypress_table); ++ ++/* structure to hold all of our device specific stuff */ ++struct cypress { ++ struct usb_device * udev; ++ unsigned char port[2]; ++}; ++ ++/* used to send usb control messages to device */ ++static int vendor_command(struct cypress *dev, unsigned char request, ++ unsigned char address, unsigned char data) ++{ ++ int retval = 0; ++ unsigned int pipe; ++ unsigned char *iobuf; ++ ++ /* allocate some memory for the i/o buffer*/ ++ iobuf = kzalloc(CYPRESS_MAX_REQSIZE, GFP_KERNEL); ++ if (!iobuf) { ++ dev_err(&dev->udev->dev, "Out of memory!\n"); ++ retval = -ENOMEM; ++ goto error; ++ } ++ ++ dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data); ++ ++ /* prepare usb control message and send it upstream */ ++ pipe = usb_rcvctrlpipe(dev->udev, 0); ++ retval = usb_control_msg(dev->udev, pipe, request, ++ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, ++ address, data, iobuf, CYPRESS_MAX_REQSIZE, ++ USB_CTRL_GET_TIMEOUT); ++ ++ /* store returned data (more READs to be added) */ ++ switch (request) { ++ case CYPRESS_READ_PORT: ++ if (address == CYPRESS_READ_PORT_ID0) { ++ dev->port[0] = iobuf[1]; ++ dev_dbg(&dev->udev->dev, ++ "READ_PORT0 returned: %d\n", ++ dev->port[0]); ++ } ++ else if (address == CYPRESS_READ_PORT_ID1) { ++ dev->port[1] = iobuf[1]; ++ dev_dbg(&dev->udev->dev, ++ "READ_PORT1 returned: %d\n", ++ dev->port[1]); ++ } ++ break; ++ } ++ ++ kfree(iobuf); ++error: ++ return retval; ++} ++ ++/* write port value */ ++static ssize_t write_port(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count, ++ int port_num, int write_id) ++{ ++ int value = -1; ++ int result = 0; ++ ++ struct usb_interface *intf = to_usb_interface(dev); ++ struct cypress *cyp = usb_get_intfdata(intf); ++ ++ dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", port_num); ++ ++ /* validate input data */ ++ if (sscanf(buf, "%d", &value) < 1) { ++ result = -EINVAL; ++ goto error; ++ } ++ if (value < 0 || value > 255) { ++ result = -EINVAL; ++ goto error; ++ } ++ ++ result = vendor_command(cyp, CYPRESS_WRITE_PORT, write_id, ++ (unsigned char)value); ++ ++ dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); ++error: ++ return result < 0 ? result : count; ++} ++ ++/* attribute callback handler (write) */ ++static ssize_t set_port0_handler(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ return write_port(dev, attr, buf, count, 0, CYPRESS_WRITE_PORT_ID0); ++} ++ ++/* attribute callback handler (write) */ ++static ssize_t set_port1_handler(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ return write_port(dev, attr, buf, count, 1, CYPRESS_WRITE_PORT_ID1); ++} ++ ++/* read port value */ ++static ssize_t read_port(struct device *dev, struct device_attribute *attr, ++ char *buf, int port_num, int read_id) ++{ ++ int result = 0; ++ ++ struct usb_interface *intf = to_usb_interface(dev); ++ struct cypress *cyp = usb_get_intfdata(intf); ++ ++ dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", port_num); ++ ++ result = vendor_command(cyp, CYPRESS_READ_PORT, read_id, 0); ++ ++ dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result); ++ ++ return sprintf(buf, "%d", cyp->port[port_num]); ++} ++ ++/* attribute callback handler (read) */ ++static ssize_t get_port0_handler(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ return read_port(dev, attr, buf, 0, CYPRESS_READ_PORT_ID0); ++} ++ ++/* attribute callback handler (read) */ ++static ssize_t get_port1_handler(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1); ++} ++ ++static DEVICE_ATTR(port0, S_IWUGO | S_IRUGO, ++ get_port0_handler, set_port0_handler); ++ ++static DEVICE_ATTR(port1, S_IWUGO | S_IRUGO, ++ get_port1_handler, set_port1_handler); ++ ++ ++static int cypress_probe(struct usb_interface *interface, ++ const struct usb_device_id *id) ++{ ++ struct cypress *dev = NULL; ++ int retval = -ENOMEM; ++ ++ /* allocate memory for our device state and initialize it */ ++ dev = kzalloc(sizeof(*dev), GFP_KERNEL); ++ if (dev == NULL) { ++ dev_err(&dev->udev->dev, "Out of memory!\n"); ++ goto error; ++ } ++ ++ dev->udev = usb_get_dev(interface_to_usbdev(interface)); ++ ++ /* save our data pointer in this interface device */ ++ usb_set_intfdata(interface, dev); ++ ++ /* create device attribute files */ ++ device_create_file(&interface->dev, &dev_attr_port0); ++ device_create_file(&interface->dev, &dev_attr_port1); ++ ++ /* let the user know that the device is now attached */ ++ dev_info(&interface->dev, ++ "Cypress CY7C63xxx device now attached\n"); ++ ++ retval = 0; ++error: ++ return retval; ++} ++ ++static void cypress_disconnect(struct usb_interface *interface) ++{ ++ struct cypress *dev; ++ ++ dev = usb_get_intfdata(interface); ++ usb_set_intfdata(interface, NULL); ++ ++ /* remove device attribute files */ ++ device_remove_file(&interface->dev, &dev_attr_port0); ++ device_remove_file(&interface->dev, &dev_attr_port1); ++ ++ usb_put_dev(dev->udev); ++ ++ dev_info(&interface->dev, ++ "Cypress CY7C63xxx device now disconnected\n"); ++ ++ kfree(dev); ++} ++ ++static struct usb_driver cypress_driver = { ++ .name = "cypress_cy7c63", ++ .probe = cypress_probe, ++ .disconnect = cypress_disconnect, ++ .id_table = cypress_table, ++}; ++ ++static int __init cypress_init(void) ++{ ++ int result; ++ ++ /* register this driver with the USB subsystem */ ++ result = usb_register(&cypress_driver); ++ if (result) { ++ err("Function usb_register failed! Error number: %d\n", result); ++ } ++ ++ return result; ++} ++ ++static void __exit cypress_exit(void) ++{ ++ /* deregister this driver with the USB subsystem */ ++ usb_deregister(&cypress_driver); ++} ++ ++module_init(cypress_init); ++module_exit(cypress_exit); ++ ++MODULE_AUTHOR(DRIVER_AUTHOR); ++MODULE_DESCRIPTION(DRIVER_DESC); ++ ++MODULE_LICENSE("GPL"); diff --git a/usb/usb-serial-dynamic-id.patch b/usb/usb-serial-dynamic-id.patch index fa7a146342bf3..01efd6cde087b 100644 --- a/usb/usb-serial-dynamic-id.patch +++ b/usb/usb-serial-dynamic-id.patch @@ -192,8 +192,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- gregkh-2.6.orig/drivers/usb/serial/usb-serial.c +++ gregkh-2.6/drivers/usb/serial/usb-serial.c -@@ -42,7 +42,7 @@ - #define DRIVER_DESC "USB Serial Driver core" +@@ -44,7 +44,7 @@ + static void port_free(struct usb_serial_port *port); /* Driver structure we register with the USB core */ -static struct usb_driver usb_serial_driver = { @@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> .name = "usbserial", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, -@@ -599,6 +599,39 @@ static struct usb_serial * create_serial +@@ -594,6 +594,39 @@ static struct usb_serial * create_serial return serial; } @@ -241,7 +241,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> static struct usb_serial_driver *search_serial_device(struct usb_interface *iface) { struct list_head *p; -@@ -608,11 +641,9 @@ static struct usb_serial_driver *search_ +@@ -603,11 +636,9 @@ static struct usb_serial_driver *search_ /* Check if the usb id matches a known device */ list_for_each(p, &usb_serial_driver_list) { t = list_entry(p, struct usb_serial_driver, driver_list); @@ -255,7 +255,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } return NULL; -@@ -664,7 +695,7 @@ int usb_serial_probe(struct usb_interfac +@@ -659,7 +690,7 @@ int usb_serial_probe(struct usb_interfac return -EIO; } diff --git a/usb/usb-storage-fix-race-between-reset-and-disconnect.patch b/usb/usb-storage-fix-race-between-reset-and-disconnect.patch new file mode 100644 index 0000000000000..f6c51699daa59 --- /dev/null +++ b/usb/usb-storage-fix-race-between-reset-and-disconnect.patch @@ -0,0 +1,81 @@ +From stern@rowland.harvard.edu Mon Jun 19 11:50:19 2006 +Date: Mon, 19 Jun 2006 14:50:15 -0400 (EDT) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com> +cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>, USB Storage list <usb-storage@lists.one-eyed-alien.net> +Subject: usb-storage: fix race between reset and disconnect +Message-ID: <Pine.LNX.4.44L0.0606191442070.5722-100000@iolanthe.rowland.org> + +My recent patch converting usb-storage to use +usb_reset_composite_device() added a bug, a race between reset and +disconnect. It was necessary to drop the private lock while executing a +reset, and if a disconnect occurs at that time it will cause a crash. + +This patch (as722) fixes the problem by explicitly checking for an early +termination after executing each command. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/storage/usb.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/storage/usb.c ++++ gregkh-2.6/drivers/usb/storage/usb.c +@@ -374,8 +374,12 @@ static int usb_stor_control_thread(void + /* lock access to the state */ + scsi_lock(host); + ++ /* did the command already complete because of a disconnect? */ ++ if (!us->srb) ++ ; /* nothing to do */ ++ + /* indicate that the command is done */ +- if (us->srb->result != DID_ABORT << 16) { ++ else if (us->srb->result != DID_ABORT << 16) { + US_DEBUGP("scsi cmd done, result=0x%x\n", + us->srb->result); + us->srb->scsi_done(us->srb); +@@ -837,32 +841,34 @@ static void dissociate_dev(struct us_dat + * the host */ + static void quiesce_and_remove_host(struct us_data *us) + { ++ struct Scsi_Host *host = us_to_host(us); ++ + /* Prevent new USB transfers, stop the current command, and + * interrupt a SCSI-scan or device-reset delay */ ++ scsi_lock(host); + set_bit(US_FLIDX_DISCONNECTING, &us->flags); ++ scsi_unlock(host); + usb_stor_stop_transport(us); + wake_up(&us->delay_wait); + + /* It doesn't matter if the SCSI-scanning thread is still running. + * The thread will exit when it sees the DISCONNECTING flag. */ + +- /* Wait for the current command to finish, then remove the host */ +- mutex_lock(&us->dev_mutex); +- mutex_unlock(&us->dev_mutex); +- + /* queuecommand won't accept any new commands and the control + * thread won't execute a previously-queued command. If there + * is such a command pending, complete it with an error. */ ++ mutex_lock(&us->dev_mutex); + if (us->srb) { + us->srb->result = DID_NO_CONNECT << 16; +- scsi_lock(us_to_host(us)); ++ scsi_lock(host); + us->srb->scsi_done(us->srb); + us->srb = NULL; +- scsi_unlock(us_to_host(us)); ++ scsi_unlock(host); + } ++ mutex_unlock(&us->dev_mutex); + + /* Now we own no commands so it's safe to remove the SCSI host */ +- scsi_remove_host(us_to_host(us)); ++ scsi_remove_host(host); + } + + /* Second stage of disconnect processing: deallocate all resources */ diff --git a/usb/usb-storage-unusual_devs-entry-for-motorola-razr-v3x.patch b/usb/usb-storage-unusual_devs-entry-for-motorola-razr-v3x.patch new file mode 100644 index 0000000000000..5d4f94ba4c0f5 --- /dev/null +++ b/usb/usb-storage-unusual_devs-entry-for-motorola-razr-v3x.patch @@ -0,0 +1,39 @@ +From stern@rowland.harvard.edu Mon Jun 19 14:07:44 2006 +Date: Mon, 19 Jun 2006 17:07:39 -0400 (EDT) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com> +cc: Davide Perini <perini.davide@dpsoftware.org>, Phil Dibowitz <phil@ipom.com> +Subject: [PATCH] usb-storage: unusual_devs entry for Motorola RAZR V3x +Message-ID: <Pine.LNX.4.44L0.0606191703000.5722-100000@iolanthe.rowland.org> + +From: Davide Perini <perini.davide@dpsoftware.org> + +This patch (as725) adds an unusual_devs entry for the Motorola RAZR V3x. + +From: Davide Perini <perini.davide@dpsoftware.org> +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/storage/unusual_devs.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/storage/unusual_devs.h ++++ gregkh-2.6/drivers/usb/storage/unusual_devs.h +@@ -1228,6 +1228,15 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + ++/* patch submitted by Davide Perini <perini.davide@dpsoftware.org> ++ * and Renato Perini <rperini@email.it> ++ */ ++UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001, ++ "Motorola", ++ "RAZR V3x", ++ US_SC_DEVICE, US_PR_DEVICE, NULL, ++ US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), ++ + /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ + UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, + "MPIO", diff --git a/usb/usb-support-for-susteen-datapilot-universal-2-cable-in-pl2303.patch b/usb/usb-support-for-susteen-datapilot-universal-2-cable-in-pl2303.patch new file mode 100644 index 0000000000000..a7c00d3a72e28 --- /dev/null +++ b/usb/usb-support-for-susteen-datapilot-universal-2-cable-in-pl2303.patch @@ -0,0 +1,42 @@ +From mmeno@idealcorp.com Wed Jun 21 12:25:50 2006 +Message-ID: <44999D41.7010404@idealcorp.com> +Date: Wed, 21 Jun 2006 15:25:53 -0400 +From: Matthew Meno <mmeno@idealcorp.com> +To: Greg Kroah-Hartman <greg@kroah.com> +Subject: USB: Support for Susteen Datapilot Universal-2 cable in pl2303 + +The Susteen Datapilot cable +(http://www.susteen.com/productdetail/71/producthl/Notempty) has an +internal pl2303 to communicate with a set of dummy connector-ends that +connect to a variety of cell phones. I've found that it works right out +of the box by simply adding the product/vendor id to the pl2303 driver. + +Signed-off-by: Matt Meno <mmeno@idealcorp.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 4 ++++ + 2 files changed, 5 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/serial/pl2303.c ++++ gregkh-2.6/drivers/usb/serial/pl2303.c +@@ -81,6 +81,7 @@ static struct usb_device_id id_table [] + { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, + { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, + { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, ++ { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, + { } /* Terminating entry */ + }; + +--- gregkh-2.6.orig/drivers/usb/serial/pl2303.h ++++ gregkh-2.6/drivers/usb/serial/pl2303.h +@@ -85,3 +85,7 @@ + /* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */ + #define OTI_VENDOR_ID 0x0ea0 + #define OTI_PRODUCT_ID 0x6858 ++ ++/* DATAPILOT Universal-2 Phone Cable */ ++#define DATAPILOT_U2_VENDOR_ID 0x0731 ++#define DATAPILOT_U2_PRODUCT_ID 0x2003 diff --git a/usb/usb-update-for-acm-in-quirks-and-debug.patch b/usb/usb-update-for-acm-in-quirks-and-debug.patch new file mode 100644 index 0000000000000..a42e2eaee4a1a --- /dev/null +++ b/usb/usb-update-for-acm-in-quirks-and-debug.patch @@ -0,0 +1,223 @@ +From oliver@neukum.name Fri Jun 23 00:26:51 2006 +From: Oliver Neukum <oliver@neukum.name> +To: greg@kroah.com +Subject: USB: update for acm in quirks and debug +Content-Disposition: inline +Date: Fri, 23 Jun 2006 09:14:17 +0200 +Message-Id: <200606230914.18140.oliver@neukum.name> + +this adds +better debugging output & +an update of the quirk list +to the acm driver + +Signed-off-by: Oliver Neukum <oliver@neukum.name> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 49 +++++++++++++++++++++++--------------------- + 1 file changed, 26 insertions(+), 23 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/class/cdc-acm.c ++++ gregkh-2.6/drivers/usb/class/cdc-acm.c +@@ -291,13 +291,13 @@ static void acm_read_bulk(struct urb *ur + struct acm_ru *rcv = urb->context; + struct acm *acm = rcv->instance; + int status = urb->status; +- dbg("Entering acm_read_bulk with status %d\n", urb->status); ++ dbg("Entering acm_read_bulk with status %d", urb->status); + + if (!ACM_READY(acm)) + return; + + if (status) +- dev_dbg(&acm->data->dev, "bulk rx status %d\n", status); ++ dev_dbg(&acm->data->dev, "bulk rx status %d", status); + + buf = rcv->buffer; + buf->size = urb->actual_length; +@@ -343,7 +343,7 @@ next_buffer: + list_del(&buf->list); + spin_unlock(&acm->read_lock); + +- dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size); ++ dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); + + tty_buffer_request_room(tty, buf->size); + if (!acm->throttle) +@@ -394,7 +394,7 @@ urbs: + rcv->urb->transfer_dma = buf->dma; + rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + +- dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf); ++ dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf); + + /* This shouldn't kill the driver as unsuccessful URBs are returned to the + free-urbs-pool and resubmited ASAP */ +@@ -413,7 +413,7 @@ static void acm_write_bulk(struct urb *u + { + struct acm *acm = (struct acm *)urb->context; + +- dbg("Entering acm_write_bulk with status %d\n", urb->status); ++ dbg("Entering acm_write_bulk with status %d", urb->status); + + acm_write_done(acm); + acm_write_start(acm); +@@ -424,7 +424,7 @@ static void acm_write_bulk(struct urb *u + static void acm_softint(void *private) + { + struct acm *acm = private; +- dbg("Entering acm_softint.\n"); ++ dbg("Entering acm_softint."); + + if (!ACM_READY(acm)) + return; +@@ -440,7 +440,7 @@ static int acm_tty_open(struct tty_struc + struct acm *acm; + int rv = -EINVAL; + int i; +- dbg("Entering acm_tty_open.\n"); ++ dbg("Entering acm_tty_open."); + + mutex_lock(&open_mutex); + +@@ -541,7 +541,7 @@ static int acm_tty_write(struct tty_stru + int wbn; + struct acm_wb *wb; + +- dbg("Entering acm_tty_write to write %d bytes,\n", count); ++ dbg("Entering acm_tty_write to write %d bytes,", count); + + if (!ACM_READY(acm)) + return -EINVAL; +@@ -793,7 +793,7 @@ static int acm_probe (struct usb_interfa + + if (!buflen) { + if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) { +- dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n"); ++ dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint"); + buflen = intf->cur_altsetting->endpoint->extralen; + buffer = intf->cur_altsetting->endpoint->extra; + } else { +@@ -842,24 +842,24 @@ next_desc: + + if (!union_header) { + if (call_interface_num > 0) { +- dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n"); ++ dev_dbg(&intf->dev,"No union descriptor, using call management descriptor"); + data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num)); + control_interface = intf; + } else { +- dev_dbg(&intf->dev,"No union descriptor, giving up\n"); ++ dev_dbg(&intf->dev,"No union descriptor, giving up"); + return -ENODEV; + } + } else { + control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0); + data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0)); + if (!control_interface || !data_interface) { +- dev_dbg(&intf->dev,"no interfaces\n"); ++ dev_dbg(&intf->dev,"no interfaces"); + return -ENODEV; + } + } + + if (data_interface_num != call_interface_num) +- dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n"); ++ dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported."); + + skip_normal_probe: + +@@ -867,7 +867,7 @@ skip_normal_probe: + if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) { + if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) { + struct usb_interface *t; +- dev_dbg(&intf->dev,"Your device has switched interfaces.\n"); ++ dev_dbg(&intf->dev,"Your device has switched interfaces."); + + t = control_interface; + control_interface = data_interface; +@@ -878,7 +878,7 @@ skip_normal_probe: + } + + if (usb_interface_claimed(data_interface)) { /* valid in this context */ +- dev_dbg(&intf->dev,"The data interface isn't available\n"); ++ dev_dbg(&intf->dev,"The data interface isn't available"); + return -EBUSY; + } + +@@ -895,7 +895,7 @@ skip_normal_probe: + if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) { + /* descriptors are swapped */ + struct usb_endpoint_descriptor *t; +- dev_dbg(&intf->dev,"The data interface has switched endpoints\n"); ++ dev_dbg(&intf->dev,"The data interface has switched endpoints"); + + t = epread; + epread = epwrite; +@@ -910,7 +910,7 @@ skip_normal_probe: + } + + if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) { +- dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (acm kzalloc)"); + goto alloc_fail; + } + +@@ -936,26 +936,26 @@ skip_normal_probe: + + buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); + if (!buf) { +- dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)"); + goto alloc_fail2; + } + acm->ctrl_buffer = buf; + + if (acm_write_buffers_alloc(acm) < 0) { +- dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (write buffer alloc)"); + goto alloc_fail4; + } + + acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); + if (!acm->ctrlurb) { +- dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)"); + goto alloc_fail5; + } + for (i = 0; i < num_rx_buf; i++) { + struct acm_ru *rcv = &(acm->ru[i]); + + if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) { +- dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n"); ++ dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)"); + goto alloc_fail7; + } + +@@ -966,13 +966,13 @@ skip_normal_probe: + struct acm_rb *buf = &(acm->rb[i]); + + if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) { +- dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)"); + goto alloc_fail7; + } + } + acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); + if (!acm->writeurb) { +- dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n"); ++ dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)"); + goto alloc_fail7; + } + +@@ -1086,6 +1086,9 @@ static struct usb_device_id acm_ids[] = + { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */ + .driver_info = SINGLE_RX_URB, /* firmware bug */ + }, ++ { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */ ++ .driver_info = SINGLE_RX_URB, /* firmware bug */ ++ }, + /* control interfaces with various AT-command sets */ + { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, + USB_CDC_ACM_PROTO_AT_V25TER) }, diff --git a/usb/usbfs-use-the-correct-signal-number-for-disconnection.patch b/usb/usbfs-use-the-correct-signal-number-for-disconnection.patch new file mode 100644 index 0000000000000..6f5e250f18bbb --- /dev/null +++ b/usb/usbfs-use-the-correct-signal-number-for-disconnection.patch @@ -0,0 +1,36 @@ +From stern@rowland.harvard.edu Thu Jun 22 10:28:13 2006 +Date: Thu, 22 Jun 2006 13:28:11 -0400 (EDT) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com> +cc: USB development list <linux-usb-devel@lists.sourceforge.net>, + Zoran Marceta <Zoran.Marceta@micronasnit.com> +Subject: usbfs: use the correct signal number for disconnection +Message-ID: <Pine.LNX.4.44L0.0606221325140.8819-100000@iolanthe.rowland.org> + +From: Zoran Marceta <Zoran.Marceta@micronasnit.com> + + +usbfs stores the wrong signal number in the siginfo structure used for +notifying user programs about device disconnect. This patch (as726) +fixes it. + +From: Zoran Marceta <Zoran.Marceta@micronasnit.com> +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/core/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/usb/core/inode.c ++++ gregkh-2.6/drivers/usb/core/inode.c +@@ -696,7 +696,7 @@ static void usbfs_remove_device(struct u + wake_up_all(&ds->wait); + list_del_init(&ds->list); + if (ds->discsignr) { +- sinfo.si_signo = SIGPIPE; ++ sinfo.si_signo = ds->discsignr; + sinfo.si_errno = EPIPE; + sinfo.si_code = SI_ASYNCIO; + sinfo.si_addr = ds->disccontext; diff --git a/usb/usbip.patch b/usb/usbip.patch index 249b7d126900a..215db582687ed 100644 --- a/usb/usbip.patch +++ b/usb/usbip.patch @@ -29,7 +29,7 @@ a link to the userspace tools needed to get this to work. --- gregkh-2.6.orig/drivers/usb/Kconfig +++ gregkh-2.6/drivers/usb/Kconfig -@@ -79,6 +79,8 @@ source "drivers/usb/core/Kconfig" +@@ -80,6 +80,8 @@ source "drivers/usb/core/Kconfig" source "drivers/usb/host/Kconfig" |