From 78c73414f4f6744e2ea5a07b263a9698aa6f2416 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Wed, 8 Oct 2008 16:14:23 +0400 Subject: USB: ohci: add support for tmio-ohci cell Some Toshiba Mobile I/O chips have OHCI controller built in. E.g. the tc6393xb chip found in several Toshiba e-Series PDAs and in Sharp Zaurus SL-6000 PDA. This adds platform glue to support OHCI function of the chip. Signed-off-by: Dmitry Baryshkov Acked-by: Ian Molton Cc: Ian Molton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/Kconfig | 3 +- drivers/usb/host/Kconfig | 1 - drivers/usb/host/ohci-hcd.c | 21 +++ drivers/usb/host/ohci-tmio.c | 376 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 399 insertions(+), 2 deletions(-) create mode 100644 drivers/usb/host/ohci-tmio.c (limited to 'drivers') diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index bcefbddeba50..3be4730ebd2d 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -36,7 +36,8 @@ config USB_ARCH_HAS_OHCI default y if PXA3xx default y if ARCH_EP93XX default y if ARCH_AT91 - default y if ARCH_PNX4008 + default y if ARCH_PNX4008 && I2C + default y if MFD_TC6393XB # PPC: default y if STB03xxx default y if PPC_MPC52xx diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 228797e54f9c..ba1c77141b43 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -138,7 +138,6 @@ config USB_OHCI_HCD tristate "OHCI HCD support" depends on USB && USB_ARCH_HAS_OHCI select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 - select I2C if ARCH_PNX4008 ---help--- The Open Host Controller Interface (OHCI) is a standard for accessing USB 1.1 host controller hardware. It does more in hardware than Intel's diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 8647dab0d7f9..8aa3f4556a32 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1075,12 +1075,18 @@ MODULE_LICENSE ("GPL"); #define SM501_OHCI_DRIVER ohci_hcd_sm501_driver #endif +#ifdef CONFIG_MFD_TC6393XB +#include "ohci-tmio.c" +#define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver +#endif + #if !defined(PCI_DRIVER) && \ !defined(PLATFORM_DRIVER) && \ !defined(OF_PLATFORM_DRIVER) && \ !defined(SA1111_DRIVER) && \ !defined(PS3_SYSTEM_BUS_DRIVER) && \ !defined(SM501_OHCI_DRIVER) && \ + !defined(TMIO_OHCI_DRIVER) && \ !defined(SSB_OHCI_DRIVER) #error "missing bus glue for ohci-hcd" #endif @@ -1147,13 +1153,25 @@ static int __init ohci_hcd_mod_init(void) goto error_sm501; #endif +#ifdef TMIO_OHCI_DRIVER + retval = platform_driver_register(&TMIO_OHCI_DRIVER); + if (retval < 0) + goto error_tmio; +#endif + return retval; /* Error path */ +#ifdef TMIO_OHCI_DRIVER + platform_driver_unregister(&TMIO_OHCI_DRIVER); + error_tmio: +#endif #ifdef SM501_OHCI_DRIVER + platform_driver_unregister(&SM501_OHCI_DRIVER); error_sm501: #endif #ifdef SSB_OHCI_DRIVER + ssb_driver_unregister(&SSB_OHCI_DRIVER); error_ssb: #endif #ifdef PCI_DRIVER @@ -1189,6 +1207,9 @@ module_init(ohci_hcd_mod_init); static void __exit ohci_hcd_mod_exit(void) { +#ifdef TMIO_OHCI_DRIVER + platform_driver_unregister(&TMIO_OHCI_DRIVER); +#endif #ifdef SM501_OHCI_DRIVER platform_driver_unregister(&SM501_OHCI_DRIVER); #endif diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c new file mode 100644 index 000000000000..f9f134af0bd1 --- /dev/null +++ b/drivers/usb/host/ohci-tmio.c @@ -0,0 +1,376 @@ +/* + * OHCI HCD(Host Controller Driver) for USB. + * + *(C) Copyright 1999 Roman Weissgaerber + *(C) Copyright 2000-2002 David Brownell + *(C) Copyright 2002 Hewlett-Packard Company + * + * Bus glue for Toshiba Mobile IO(TMIO) Controller's OHCI core + * (C) Copyright 2005 Chris Humbert + * (C) Copyright 2007, 2008 Dmitry Baryshkov + * + * This is known to work with the following variants: + * TC6393XB revision 3 (32kB SRAM) + * + * The TMIO's OHCI core DMAs through a small internal buffer that + * is directly addressable by the CPU. + * + * Written from sparse documentation from Toshiba and Sharp's driver + * for the 2.4 kernel, + * usb-ohci-tc6393.c(C) Copyright 2004 Lineo Solutions, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/*#include +#include +#include +#include +#include +#include */ +#include +#include +#include +#include + +/*-------------------------------------------------------------------------*/ + +/* + * USB Host Controller Configuration Register + */ +#define CCR_REVID 0x08 /* b Revision ID */ +#define CCR_BASE 0x10 /* l USB Control Register Base Address Low */ +#define CCR_ILME 0x40 /* b Internal Local Memory Enable */ +#define CCR_PM 0x4c /* w Power Management */ +#define CCR_INTC 0x50 /* b INT Control */ +#define CCR_LMW1L 0x54 /* w Local Memory Window 1 LMADRS Low */ +#define CCR_LMW1H 0x56 /* w Local Memory Window 1 LMADRS High */ +#define CCR_LMW1BL 0x58 /* w Local Memory Window 1 Base Address Low */ +#define CCR_LMW1BH 0x5A /* w Local Memory Window 1 Base Address High */ +#define CCR_LMW2L 0x5C /* w Local Memory Window 2 LMADRS Low */ +#define CCR_LMW2H 0x5E /* w Local Memory Window 2 LMADRS High */ +#define CCR_LMW2BL 0x60 /* w Local Memory Window 2 Base Address Low */ +#define CCR_LMW2BH 0x62 /* w Local Memory Window 2 Base Address High */ +#define CCR_MISC 0xFC /* b MISC */ + +#define CCR_PM_GKEN 0x0001 +#define CCR_PM_CKRNEN 0x0002 +#define CCR_PM_USBPW1 0x0004 +#define CCR_PM_USBPW2 0x0008 +#define CCR_PM_USBPW3 0x0008 +#define CCR_PM_PMEE 0x0100 +#define CCR_PM_PMES 0x8000 + +/*-------------------------------------------------------------------------*/ + +struct tmio_hcd { + void __iomem *ccr; + spinlock_t lock; /* protects RMW cycles */ +}; + +#define hcd_to_tmio(hcd) ((struct tmio_hcd *)(hcd_to_ohci(hcd) + 1)) + +/*-------------------------------------------------------------------------*/ + +static void tmio_write_pm(struct platform_device *dev) +{ + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + u16 pm; + unsigned long flags; + + spin_lock_irqsave(&tmio->lock, flags); + + pm = CCR_PM_GKEN | CCR_PM_CKRNEN | + CCR_PM_PMEE | CCR_PM_PMES; + + tmio_iowrite16(pm, tmio->ccr + CCR_PM); + spin_unlock_irqrestore(&tmio->lock, flags); +} + +static void tmio_stop_hc(struct platform_device *dev) +{ + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + u16 pm; + + pm = CCR_PM_GKEN | CCR_PM_CKRNEN; + switch (ohci->num_ports) { + default: + dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports); + case 3: + pm |= CCR_PM_USBPW3; + case 2: + pm |= CCR_PM_USBPW2; + case 1: + pm |= CCR_PM_USBPW1; + } + tmio_iowrite8(0, tmio->ccr + CCR_INTC); + tmio_iowrite8(0, tmio->ccr + CCR_ILME); + tmio_iowrite16(0, tmio->ccr + CCR_BASE); + tmio_iowrite16(0, tmio->ccr + CCR_BASE + 2); + tmio_iowrite16(pm, tmio->ccr + CCR_PM); +} + +static void tmio_start_hc(struct platform_device *dev) +{ + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + unsigned long base = hcd->rsrc_start; + + tmio_write_pm(dev); + tmio_iowrite16(base, tmio->ccr + CCR_BASE); + tmio_iowrite16(base >> 16, tmio->ccr + CCR_BASE + 2); + tmio_iowrite8(1, tmio->ccr + CCR_ILME); + tmio_iowrite8(2, tmio->ccr + CCR_INTC); + + dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n", + tmio_ioread8(tmio->ccr + CCR_REVID), hcd->rsrc_start, hcd->irq); +} + +static int ohci_tmio_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 const struct hc_driver ohci_tmio_hc_driver = { + .description = hcd_name, + .product_desc = "TMIO OHCI USB Host Controller", + .hcd_priv_size = sizeof(struct ohci_hcd) + sizeof (struct tmio_hcd), + + /* generic hardware linkage */ + .irq = ohci_irq, + .flags = HCD_USB11 | HCD_MEMORY | HCD_LOCAL_MEM, + + /* basic lifecycle operations */ + .start = ohci_tmio_start, + .stop = ohci_stop, + .shutdown = ohci_shutdown, + + /* managing i/o requests and associated device resources */ + .urb_enqueue = ohci_urb_enqueue, + .urb_dequeue = ohci_urb_dequeue, + .endpoint_disable = ohci_endpoint_disable, + + /* scheduling support */ + .get_frame_number = ohci_get_frame, + + /* root hub support */ + .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, +}; + +/*-------------------------------------------------------------------------*/ +static struct platform_driver ohci_hcd_tmio_driver; + +static int __devinit ohci_hcd_tmio_drv_probe(struct platform_device *dev) +{ + struct mfd_cell *cell = dev->dev.platform_data; + struct resource *regs = platform_get_resource(dev, IORESOURCE_MEM, 0); + struct resource *config = platform_get_resource(dev, IORESOURCE_MEM, 1); + struct resource *sram = platform_get_resource(dev, IORESOURCE_MEM, 2); + int irq = platform_get_irq(dev, 0); + struct tmio_hcd *tmio; + struct ohci_hcd *ohci; + struct usb_hcd *hcd; + int ret; + + if (usb_disabled()) + return -ENODEV; + + if (!cell) + return -EINVAL; + + hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev->dev.bus_id); + if (!hcd) { + ret = -ENOMEM; + goto err_usb_create_hcd; + } + + hcd->rsrc_start = regs->start; + hcd->rsrc_len = regs->end - regs->start + 1; + + tmio = hcd_to_tmio(hcd); + + spin_lock_init(&tmio->lock); + + tmio->ccr = ioremap(config->start, config->end - config->start + 1); + if (!tmio->ccr) { + ret = -ENOMEM; + goto err_ioremap_ccr; + } + + hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); + if (!hcd->regs) { + ret = -ENOMEM; + goto err_ioremap_regs; + } + + if (!dma_declare_coherent_memory(&dev->dev, sram->start, + sram->start, + sram->end - sram->start + 1, + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE)) { + ret = -EBUSY; + goto err_dma_declare; + } + + if (cell->enable) { + ret = cell->enable(dev); + if (ret) + goto err_enable; + } + + tmio_start_hc(dev); + ohci = hcd_to_ohci(hcd); + ohci_hcd_init(ohci); + + ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); + if (ret) + goto err_add_hcd; + + if (ret == 0) + return ret; + + usb_remove_hcd(hcd); + +err_add_hcd: + tmio_stop_hc(dev); + if (cell->disable) + cell->disable(dev); +err_enable: + dma_release_declared_memory(&dev->dev); +err_dma_declare: + iounmap(hcd->regs); +err_ioremap_regs: + iounmap(tmio->ccr); +err_ioremap_ccr: + usb_put_hcd(hcd); +err_usb_create_hcd: + + return ret; +} + +static int __devexit ohci_hcd_tmio_drv_remove(struct platform_device *dev) +{ + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + struct mfd_cell *cell = dev->dev.platform_data; + + usb_remove_hcd(hcd); + tmio_stop_hc(dev); + if (cell->disable) + cell->disable(dev); + dma_release_declared_memory(&dev->dev); + iounmap(hcd->regs); + iounmap(tmio->ccr); + usb_put_hcd(hcd); + + platform_set_drvdata(dev, NULL); + + return 0; +} + +#ifdef CONFIG_PM +static int ohci_hcd_tmio_drv_suspend(struct platform_device *dev, pm_message_t state) +{ + struct mfd_cell *cell = dev->dev.platform_data; + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + unsigned long flags; + u8 misc; + int ret; + + if (time_before(jiffies, ohci->next_statechange)) + msleep(5); + ohci->next_statechange = jiffies; + + spin_lock_irqsave(&tmio->lock, flags); + + misc = tmio_ioread8(tmio->ccr + CCR_MISC); + misc |= 1 << 3; /* USSUSP */ + tmio_iowrite8(misc, tmio->ccr + CCR_MISC); + + spin_unlock_irqrestore(&tmio->lock, flags); + + if (cell->suspend) { + ret = cell->suspend(dev); + if (ret) + return ret; + } + + hcd->state = HC_STATE_SUSPENDED; + + return 0; +} + +static int ohci_hcd_tmio_drv_resume(struct platform_device *dev) +{ + struct mfd_cell *cell = dev->dev.platform_data; + struct usb_hcd *hcd = platform_get_drvdata(dev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + unsigned long flags; + u8 misc; + int ret; + + if (time_before(jiffies, ohci->next_statechange)) + msleep(5); + ohci->next_statechange = jiffies; + + if (cell->resume) { + ret = cell->resume(dev); + if (ret) + return ret; + } + + tmio_start_hc(dev); + + spin_lock_irqsave(&tmio->lock, flags); + + misc = tmio_ioread8(tmio->ccr + CCR_MISC); + misc &= ~(1 << 3); /* USSUSP */ + tmio_iowrite8(misc, tmio->ccr + CCR_MISC); + + spin_unlock_irqrestore(&tmio->lock, flags); + + ohci_finish_controller_resume(hcd); + + return 0; +} +#else +#define ohci_hcd_tmio_drv_suspend NULL +#define ohci_hcd_tmio_drv_resume NULL +#endif + +static struct platform_driver ohci_hcd_tmio_driver = { + .probe = ohci_hcd_tmio_drv_probe, + .remove = __devexit_p(ohci_hcd_tmio_drv_remove), + .shutdown = usb_hcd_platform_shutdown, + .suspend = ohci_hcd_tmio_drv_suspend, + .resume = ohci_hcd_tmio_drv_resume, + .driver = { + .name = "tmio-ohci", + .owner = THIS_MODULE, + }, +}; -- cgit v1.2.3 From d66937d71a67724870e03fa35af686e7efe85caf Mon Sep 17 00:00:00 2001 From: Zhaolei Date: Mon, 20 Oct 2008 18:53:04 +0800 Subject: USB: Fix debugfs_create_file's error checking method for usb/gadget/s3c2410_udc debugfs_create_file() returns NULL if an error occurs, returns -ENODEV when debugfs is not enabled in the kernel. Signed-off-by: Zhao Lei Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/s3c2410_udc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 48f51b12d2e2..00ba06b44752 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c @@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev) udc->regs_info = debugfs_create_file("registers", S_IRUGO, s3c2410_udc_debugfs_root, udc, &s3c2410_udc_debugfs_fops); - if (IS_ERR(udc->regs_info)) { - dev_warn(dev, "debugfs file creation failed %ld\n", - PTR_ERR(udc->regs_info)); - udc->regs_info = NULL; - } + if (!udc->regs_info) + dev_warn(dev, "debugfs file creation failed\n"); } dev_dbg(dev, "probe ok\n"); -- cgit v1.2.3 From 3030ca4cf4abbdd2dd850a14d20e9fca5937ffb5 Mon Sep 17 00:00:00 2001 From: Phil Dibowitz Date: Sun, 19 Oct 2008 08:17:54 +0200 Subject: USB: storage: Avoid I/O errors when issuing SCSI ioctls to JMicron USB/ATA bridge Here's the patch that implements the fix you suggested to avoid the I/O errors that I was running into with my new USB enclosure with a JMicron USB/ATA bridge, while issuing scsi-io USN or other such queries used by Fedora's mkinitrd. http://bugzilla.kernel.org/show_bug.cgi?id=9638#c85 /proc/bus/usb/devices: T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=04 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=152d ProdID=2329 Rev= 1.00 S: Manufacturer=JMicron S: Product=USB to ATA/ATAPI Bridge S: SerialNumber=DE5088854FFF C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms (patch applied and retested on a modified 2.6.27.2-libre.24.rc1.fc10) Signed-off-by: Phil Dibowitz Cc: Alexandre Oliva Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index cd155475cb6e..061df9b46138 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -1745,6 +1745,15 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), +/* Reported by Alexandre Oliva + * JMicron responds to USN and several other SCSI ioctls with a + * residue that causes subsequent I/O requests to fail. */ +UNUSUAL_DEV( 0x152d, 0x2329, 0x0100, 0x0100, + "JMicron", + "USB to ATA/ATAPI Bridge", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + /* Reported by Robert Schedel * Note: this is a 'super top' device like the above 14cd/6600 device */ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, -- cgit v1.2.3 From bfd8408d68975759aba1b466af6f5388d7adb836 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Sat, 18 Oct 2008 18:20:02 +0700 Subject: USB: add ZTE MF626 USB GSM modem entry Signed-off-by: Mikhail Gusarov Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 3d87eabcd922..5a9a1959ae7b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -207,6 +207,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po /* ZTE PRODUCTS */ #define ZTE_VENDOR_ID 0x19d2 #define ZTE_PRODUCT_MF628 0x0015 +#define ZTE_PRODUCT_MF626 0x0031 #define ZTE_PRODUCT_CDMA_TECH 0xfffe /* Ericsson products */ @@ -336,6 +337,7 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) }, -- cgit v1.2.3 From 1460e5e44cc5ecad7704f63b10dcb3a59d0e008b Mon Sep 17 00:00:00 2001 From: fangxiaozhi Date: Wed, 15 Oct 2008 14:15:36 +0800 Subject: USB: support Huawei data card product IDs In this patch, we want to do one thing: add more Huawei product IDs into the USB driver. Then it can support more Huawei data card devices. So to declare the unusual device for new Huawei data card devices in unusual_devs.h and to declare more new product IDs in option.c. To modify the data value and length in the function of usb_stor_huawei_e220_init in initializers.c That's because based on the USB standard, while sending SET_FETURE_D to the device, it requires the corresponding data to be zero, and its sending length also must be zero. In our old solution, it can be compatible with our WCDMA data card devices, but can not support our CDMA data card devices. But in this new solution, it can be compatible with all of our data card devices. Signed-off-by: fangxiaozhi Signed-off-by: Phil Dibowitz Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 94 +++++++++++++ drivers/usb/storage/initializers.c | 3 +- drivers/usb/storage/unusual_devs.h | 273 ++++++++++++++++++++++++++++++++++--- 3 files changed, 349 insertions(+), 21 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5a9a1959ae7b..bd07eaa300b9 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -95,11 +95,20 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po #define HUAWEI_PRODUCT_E220 0x1003 #define HUAWEI_PRODUCT_E220BIS 0x1004 #define HUAWEI_PRODUCT_E1401 0x1401 +#define HUAWEI_PRODUCT_E1402 0x1402 #define HUAWEI_PRODUCT_E1403 0x1403 +#define HUAWEI_PRODUCT_E1404 0x1404 #define HUAWEI_PRODUCT_E1405 0x1405 #define HUAWEI_PRODUCT_E1406 0x1406 +#define HUAWEI_PRODUCT_E1407 0x1407 #define HUAWEI_PRODUCT_E1408 0x1408 #define HUAWEI_PRODUCT_E1409 0x1409 +#define HUAWEI_PRODUCT_E140A 0x140A +#define HUAWEI_PRODUCT_E140B 0x140B +#define HUAWEI_PRODUCT_E140C 0x140C +#define HUAWEI_PRODUCT_E140D 0x140D +#define HUAWEI_PRODUCT_E140E 0x140E +#define HUAWEI_PRODUCT_E140F 0x140F #define HUAWEI_PRODUCT_E1410 0x1410 #define HUAWEI_PRODUCT_E1411 0x1411 #define HUAWEI_PRODUCT_E1412 0x1412 @@ -110,6 +119,44 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po #define HUAWEI_PRODUCT_E1417 0x1417 #define HUAWEI_PRODUCT_E1418 0x1418 #define HUAWEI_PRODUCT_E1419 0x1419 +#define HUAWEI_PRODUCT_E141A 0x141A +#define HUAWEI_PRODUCT_E141B 0x141B +#define HUAWEI_PRODUCT_E141C 0x141C +#define HUAWEI_PRODUCT_E141D 0x141D +#define HUAWEI_PRODUCT_E141E 0x141E +#define HUAWEI_PRODUCT_E141F 0x141F +#define HUAWEI_PRODUCT_E1420 0x1420 +#define HUAWEI_PRODUCT_E1421 0x1421 +#define HUAWEI_PRODUCT_E1422 0x1422 +#define HUAWEI_PRODUCT_E1423 0x1423 +#define HUAWEI_PRODUCT_E1424 0x1424 +#define HUAWEI_PRODUCT_E1425 0x1425 +#define HUAWEI_PRODUCT_E1426 0x1426 +#define HUAWEI_PRODUCT_E1427 0x1427 +#define HUAWEI_PRODUCT_E1428 0x1428 +#define HUAWEI_PRODUCT_E1429 0x1429 +#define HUAWEI_PRODUCT_E142A 0x142A +#define HUAWEI_PRODUCT_E142B 0x142B +#define HUAWEI_PRODUCT_E142C 0x142C +#define HUAWEI_PRODUCT_E142D 0x142D +#define HUAWEI_PRODUCT_E142E 0x142E +#define HUAWEI_PRODUCT_E142F 0x142F +#define HUAWEI_PRODUCT_E1430 0x1430 +#define HUAWEI_PRODUCT_E1431 0x1431 +#define HUAWEI_PRODUCT_E1432 0x1432 +#define HUAWEI_PRODUCT_E1433 0x1433 +#define HUAWEI_PRODUCT_E1434 0x1434 +#define HUAWEI_PRODUCT_E1435 0x1435 +#define HUAWEI_PRODUCT_E1436 0x1436 +#define HUAWEI_PRODUCT_E1437 0x1437 +#define HUAWEI_PRODUCT_E1438 0x1438 +#define HUAWEI_PRODUCT_E1439 0x1439 +#define HUAWEI_PRODUCT_E143A 0x143A +#define HUAWEI_PRODUCT_E143B 0x143B +#define HUAWEI_PRODUCT_E143C 0x143C +#define HUAWEI_PRODUCT_E143D 0x143D +#define HUAWEI_PRODUCT_E143E 0x143E +#define HUAWEI_PRODUCT_E143F 0x143F #define NOVATELWIRELESS_VENDOR_ID 0x1410 @@ -249,11 +296,20 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1402, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1404, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1407, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140A, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140B, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140C, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140D, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140E, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140F, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412, 0xff, 0xff, 0xff) }, @@ -264,6 +320,44 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141A, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141B, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141C, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141D, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141E, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141F, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1420, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1421, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1422, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1423, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1424, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1425, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1426, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1427, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1428, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1429, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142A, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142B, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142C, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142D, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142E, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142F, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1430, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1431, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1432, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1433, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1434, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1435, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1436, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1437, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1438, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1439, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143A, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143B, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143C, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) }, { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c index 4995bb595aef..2dd9bd4bff56 100644 --- a/drivers/usb/storage/initializers.c +++ b/drivers/usb/storage/initializers.c @@ -95,11 +95,10 @@ int usb_stor_huawei_e220_init(struct us_data *us) { int result; - us->iobuf[0] = 0x1; result = usb_stor_control_msg(us, us->send_ctrl_pipe, USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE, - 0x01, 0x0, us->iobuf, 0x1, 1000); + 0x01, 0x0, NULL, 0x0, 1000); US_DEBUGP("usb_control_msg performing result is %d\n", result); return (result ? 0 : -1); } diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 061df9b46138..d0de1feee91e 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -1628,97 +1628,332 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x0100, /* Reported by fangxiaozhi * This brings the HUAWEI data card devices into multi-port mode */ -UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, 0), -UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000, +UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000, + "HUAWEI MOBILE", + "Mass Storage", + US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, + 0), +UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000, "HUAWEI MOBILE", "Mass Storage", US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init, -- cgit v1.2.3 From 8aafdf6a1528b0672a0527be473d9be5a12289d3 Mon Sep 17 00:00:00 2001 From: roel kluin Date: Tue, 21 Oct 2008 00:36:44 -0400 Subject: USB: usbtest.c: length, sglen and vary are unsigned, so cannot be negative length, sglen and vary are unsigned, so cannot be negative see vi drivers/usb/misc/usbtest.c +18 struct usbtest_param { ... unsigned iterations; unsigned length; unsigned vary; unsigned sglen; ... }; Signed-off-by: Roel Kluin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/usbtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index b358c4e1cf21..444c69c447be 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1561,8 +1561,7 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf) if (code != USBTEST_REQUEST) return -EOPNOTSUPP; - if (param->iterations <= 0 || param->length < 0 - || param->sglen < 0 || param->vary < 0) + if (param->iterations <= 0) return -EINVAL; if (mutex_lock_interruptible(&dev->lock)) -- cgit v1.2.3 From 8fc7aeab3851ed8c3ecf28901ca2c6f0400955c7 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 20 Oct 2008 09:52:12 -0400 Subject: USB: Speedtouch: add pre_reset and post_reset routines This patch (as1150) fixes a problem in the speedtch driver. When it resets the modem during probe it will be unbound from the other interfaces it has claimed, because it doesn't define a pre_reset and a post_reset method. The patch defines "do-nothing" methods. This fixes Bugzilla #11767. Signed-off-by: Alan Stern Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/atm/speedtch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 76fce44c2f9a..3e862401a638 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -722,6 +722,16 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de flush_scheduled_work(); } +static int speedtch_pre_reset(struct usb_interface *intf) +{ + return 0; +} + +static int speedtch_post_reset(struct usb_interface *intf) +{ + return 0; +} + /********** ** USB ** @@ -740,6 +750,8 @@ static struct usb_driver speedtch_usb_driver = { .name = speedtch_driver_name, .probe = speedtch_usb_probe, .disconnect = usbatm_usb_disconnect, + .pre_reset = speedtch_pre_reset, + .post_reset = speedtch_post_reset, .id_table = speedtch_usb_ids }; -- cgit v1.2.3 From dd9ebf1421902df806c0ed6fac296badaca06161 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 13 Oct 2008 09:14:52 -0700 Subject: usb/gadget: fix kernel-doc warning Fix kernel-doc warning, wrong parameter name listed: Warning(lin2627-g3-kdocfixes//drivers/usb/gadget/config.c:183): No description found for parameter 'match' Signed-off-by: Randy Dunlap Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index 1ca1c326392a..e1191b9a316a 100644 --- a/drivers/usb/gadget/config.c +++ b/drivers/usb/gadget/config.c @@ -168,7 +168,7 @@ usb_copy_descriptors(struct usb_descriptor_header **src) * usb_find_endpoint - find a copy of an endpoint descriptor * @src: original vector of descriptors * @copy: copy of @src - * @ep: endpoint descriptor found in @src + * @match: endpoint descriptor found in @src * * This returns the copy of the @match descriptor made for @copy. Its * intended use is to help remembering the endpoint descriptor to use -- cgit v1.2.3 From 3131f7b0ab9ed461daa2464fffd9df784d1f730d Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 13 Oct 2008 20:06:00 +0200 Subject: USB: Fix unneeded endpoint check in pxa27x_udc The request allocation code doesn't need to check if the endpoint is not NULL, as the only caller in include/linux/usb/gadget.h, usb_ep_alloc_request() needs the endpoint pointer to have a correct value to trigger the allocation code. Signed-off-by: Robert Jarzmik Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/pxa27x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index bcf375ca3d72..caa37c95802c 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c @@ -650,7 +650,7 @@ pxa_ep_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags) struct pxa27x_request *req; req = kzalloc(sizeof *req, gfp_flags); - if (!req || !_ep) + if (!req) return NULL; INIT_LIST_HEAD(&req->queue); -- cgit v1.2.3 From aa5380b904e7f896db0931320160bdea93e41f6a Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 13 Oct 2008 14:05:20 +0200 Subject: USB: cdc-wdm: make module autoload work this fixes an omission that led to no alias being computed for the cdc-wdm module. Signed-off-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/cdc-wdm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 7429f70b9d06..5a8ecc045e3f 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -42,6 +42,8 @@ static struct usb_device_id wdm_ids[] = { { } }; +MODULE_DEVICE_TABLE (usb, wdm_ids); + #define WDM_MINOR_BASE 176 -- cgit v1.2.3 From e8fab4ce763c36869624c5388714ff19c30a91a7 Mon Sep 17 00:00:00 2001 From: Frédéric Marchal Date: Mon, 13 Oct 2008 14:00:11 +0200 Subject: USB: Unusual dev for Mio moov 330 gps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here is an entry for the unusual_devs.h file to handle a Mio Moov 330 GPS that stops responding when it is requested to transfer more than 64KB. The patch is taken against kernel-2.6.27-git3. Signed-off-by: Frédéric Marchal Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index d0de1feee91e..a2b9ebbef38e 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -2062,6 +2062,15 @@ UNUSUAL_DEV( 0x2770, 0x915d, 0x0010, 0x0010, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), +/* Reported by Frederic Marchal + * Mio Moov 330 + */ +UNUSUAL_DEV( 0x3340, 0xffff, 0x0000, 0x0000, + "Mitac", + "Mio DigiWalker USB Sync", + US_SC_DEVICE,US_PR_DEVICE,NULL, + US_FL_MAX_SECTORS_64 ), + /* Reported by Andrey Rahmatullin */ UNUSUAL_DEV( 0x4102, 0x1020, 0x0100, 0x0100, "iRiver", -- cgit v1.2.3 From a496c64f1363ec4d67ebdc1e1f619ad6372a574c Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Tue, 21 Oct 2008 10:39:04 +0200 Subject: USB: fix memory leak in cdc-acm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a memory leak on disconnect in cdc-acm Thanks to 施金前 for finding it. Signed-off-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/cdc-acm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index fab23ee8702b..20104443081a 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -849,9 +849,10 @@ static void acm_write_buffers_free(struct acm *acm) { int i; struct acm_wb *wb; + struct usb_device *usb_dev = interface_to_usbdev(acm->control); for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) { - usb_buffer_free(acm->dev, acm->writesize, wb->buf, wb->dmah); + usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah); } } -- cgit v1.2.3 From 6c6409459a18a825ce12ecb003d5686af61f7a2f Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 21 Oct 2008 15:40:03 -0400 Subject: USB: don't rebind drivers after failed resume or reset This patch (as1152) may help prevent some problems associated with the new policy of unbinding drivers that don't support suspend/resume or pre_reset/post_reset. If for any reason the resume or reset fails, and the device is logically disconnected, there's no point in trying to rebind the driver. So the patch checks for success before carrying out the unbind/rebind. There was a report from one user that this fixed a problem he was experiencing, but the details never became fully clear. In any case, adding these tests can't hurt. Signed-off-by: Alan Stern Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/driver.c | 3 ++- drivers/usb/core/hub.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index e935be7eb468..3d7793d93031 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1610,7 +1610,8 @@ int usb_external_resume_device(struct usb_device *udev) status = usb_resume_both(udev); udev->last_busy = jiffies; usb_pm_unlock(udev); - do_unbind_rebind(udev, DO_REBIND); + if (status == 0) + do_unbind_rebind(udev, DO_REBIND); /* Now that the device is awake, we can start trying to autosuspend * it again. */ diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d73ce262c365..9b3f16bd12cb 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3504,7 +3504,7 @@ int usb_reset_device(struct usb_device *udev) USB_INTERFACE_BOUND) rebind = 1; } - if (rebind) + if (ret == 0 && rebind) usb_rebind_intf(cintf); } } -- cgit v1.2.3