summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* USB: Clean up root hub string descriptorsGeorge Spelvin2009-09-231-47/+64
| | | | | | | | | | The previous code had a bug that would add a trailing null byte to the returned descriptor. Signed-off-by: George Spelvin <linux@horizon.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: double put_tty_driver(gs_tty_driver) in gserial_setup()Roel Kluin2009-09-231-1/+0
| | | | | | | | | | | | If the driver cannot be registered, put_tty_driver(gs_tty_driver) occurred here as well as at label fail. put_tty_driver() already occurs at label fail Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: make usb_buffer_map_sg consistent with docJiri Slaby2009-09-231-2/+2
| | | | | | | | | | | | | | | | | | usb_buffer_map_sg should return negative on error according to its documentation. But dma_map_sg returns 0 on error. Take this into account and return -ENOMEM in such situation. While at it, return -EINVAL instead of -1 when wrong input is passed in. If this wasn't done, usb_sg_* operations used after usb_sg_init which returned 0 may cause oopses/deadlocks since we don't init structures/entries, esp. completion and status entry. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: change deschedule logic for interrupt QHsAlan Stern2009-09-233-34/+40
| | | | | | | | | | | | | | | | | | | This patch (as1281) changes the way ehci-hcd deschedules interrupt QHs, copying the approach used for async QHs. The caller is no longer responsible for rescheduling the QH if its queue is non-empty; instead the reschedule is done directly by intr_deschedule(), after calling qh_completions(). This is exactly the same as how end_unlink_async() works. ehci_urb_dequeue() and intr_deschedule() now correctly handle the case where they are called while another interrupt URB for the same QH is being given back. This was a surprisingly large blind spot. And scan_periodic() now respects the new needs_rescan flag. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: rescan the queue after an unlinkAlan Stern2009-09-233-12/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1280) fixes an obscure bug in ehci-hcd's dequeuing logic for async URBs. If a later URB is unlinked and the completion routine unlinks an earlier URB, then the earlier URB won't be given back in a timely manner because the endpoint queue isn't rescanned as it should be. Similar bugs occur if an endpoint is reset or a halt is cleared while a completion routine is running, because the subroutines don't test for the COMPLETING state. All these problems are solved by adding a new needs_rescan flag to the ehci_qh structure. If the flag is set while scanning through an idle QH, the scan will be repeated. If the QH isn't idle then an unlink cycle will be initiated, and the proper action will be taken when it becomes idle. Also, an unnecessary test is removed from qh_link_async(): That routine is never called if the QH's state isn't IDLE. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fsl_qe_udc: Add fsl,mpc8323-qe-usb compatible entryAnton Vorontsov2009-09-231-0/+4
| | | | | | | | | | | Current bindings specify that "fsl,mpc8323-qe-usb" compatible entry should be used as a base match for QE UDCs, so update the driver to comply with the bindings. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB-serial: pl2303: use 1.5 instead of 2 stop bits with 5 data bitsFrank Schaefer2009-09-231-2/+10
| | | | | | | | This is how "real" UARTs (e.g. 16550) work and AFAIK what RS232 specifies, too. Make the driver more compliant. Signed-off-by: Frank Schaefer <schaefer.frank@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB-serial: pl2303: add space/mark parityFrank Schaefer2009-09-231-4/+14
| | | | | | | The device supports it, so why not use it ? Works fine ! Signed-off-by: Frank Schaefer <schaefer.frank@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB-serial: pl2303: fix baud rate handling in case of unsupported valuesFrank Schaefer2009-09-231-2/+38
| | | | | | | | | | | | | | | | | | | | | | According to the datasheets, the PL2303 supports a set of 25 baudrates. The baudrate is set as a 4 byte value directly. During my experiments with device 067b:2303 (PL2303X), I noticed that - the bridge-controller always uses 9600 baud if invalid/unsupported baud rate values are set - the baud rate value returned by usb_control_msg(..., GET_LINE_REQUEST, ...) does not reflect the actually used baudrate. Always the last set value is returned, even if it was invalid and not used by the controller. This patch fixes the following issues with the current code: 1.) make sure that only supported baudrates are set (are there any buggy chip revisions out there which don't "like" other values... ?). 2.) always set the baudrate to the next nearest supported baudrate. 3.) applications can now read back the resulting baudrate properly, because tty_encode_baud_rate(...) is now fed with the actually used baudrate. Signed-off-by: Frank Schaefer <schaefer.frank@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: add a way to select the default VCCOlivier Bornet2009-09-231-1/+6
| | | | | | | Using the module parameter vcc_default, you can choose the default VCC value. Signed-off-by: Olivier Bornet <Olivier.Bornet@puck.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: increment version numberOlivier Bornet2009-09-231-1/+1
| | | | | Signed-off-by: Olivier Bornet <Olivier.Bornet@puck.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: add support for changing VCCOlivier Bornet2009-09-231-0/+93
| | | | | | | | You can now set the IUU reader to 3.3V VCC instead of 5V VCC, using the sysfs parameter vcc_mode. Valid values are 3 and 5. Signed-off-by: Olivier Bornet <Olivier.Bornet@puck.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: clean-up parameter's descriptionsOlivier Bornet2009-09-231-5/+6
| | | | | Signed-off-by: Olivier Bornet <Olivier.Bornet@puck.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: Don't reset the device at closeOlivier Bornet2009-09-231-4/+0
| | | | | | | | Resetting the device cause the device to have a new name in the /dev. Signed-off-by: Olivier Bornet <Olivier.Bornet@puck.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: correct termination condition for reads.Steve Holland2009-09-231-1/+2
| | | | | | | | | Follow T&M convention of obeying EOM flag. Avoid exception cases where instrument response size matches a buffer size. Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: inhibit corruptionSteve Holland2009-09-231-0/+4
| | | | | | | | | Limit data copied to userspace to amount requested. Prevents a faulty instrument from overwriting user memory. Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: Fix short reads in usbtmc_read()Steve Holland2009-09-231-4/+4
| | | | | | | | | The header size should not be included in the number of bytes requested of the instrument Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USb: Break support for WinChipHead CH341 340 USB->Serial "chip"Tim Small2009-09-231-0/+52
| | | | | | | | | Here is a patch to the ch341 driver which adds serial break support. Signed-off-by: Tim Small <tim@seoss.co.uk> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c2410: unregister should call unbind, not disconnectAlan Stern2009-09-231-2/+1
| | | | | | | | | | This patch (as1275) fixes the s3c2410 device controller driver. Its usb_gadget_unregister_driver() routine is supposed to call the gadget driver's unbind method, not the disconnect method. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Add EEM gadget driverBrian Niebuhr2009-09-238-48/+699
| | | | | | | | | | | | | | | | | | This patch adds a CDC EEM ethernet gadget driver. CDC EEM is a newer USB ethernet specification that uses a simpler interface than the older CDC ECM. This makes CDC EEM usable by a wider set of USB hardware. By default the ethernet gadget will still use CDC ECM/Subset, but kernel configuration and/or a module parameter will allow alternative use of the CDC EEM protocol. Changes since last version: - Brought in missing RNDIS changes that caused compile error - Modified 'sentinel CRC' checking to match EEM host driver Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove unneeded printks from microtek driverOliver Neukum2009-09-231-37/+0
| | | | | | | | | These printks can be removed as they only provide information about the driver not the device and nobody has ever provided feedback. Signed-off-by: Oliver Neukum <oliver@neukum.org>
* USB: use kfifo to buffer usb-generic serial writesDavid VomLehn2009-09-233-81/+134
| | | | | | | | | | | | | | | | | | When do_output_char() attempts to write a carriage return/line feed sequence, it first checks to see how much buffer room is available. If there are at least two characters free, it will write the carriage return/line feed with two calls to tty_put_char(). It calls the tty_operation functions write() for devices that don't support the tty_operations function put_char(). If the USB generic serial device's write URB is not in use, it will return the buffer size when asked how much room is available. The write() of the carriage return will cause it to mark the write URB busy, so the subsequent write() of the line feed will be ignored. This patch uses the kfifo infrastructure to implement a write FIFO that accurately returns the amount of space available in the buffer. Signed-off-by: David VomLehn <dvomlehn@cisco.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ohci-ep93xx.c: remove unused variableH Hartley Sweeten2009-09-231-1/+0
| | | | | | | | | | | | Remove unused variable in ohci-ep93xx.c. This only shows up when CONFIG_PM is enabled. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: otg: fix twl4030-usb buildRandy Dunlap2009-09-231-1/+1
| | | | | | | | | | | | | | | | subsys_initcall_sync() is only defined for built-in code, not for loadable modules, so this driver build fails when built as a module. However, the _sync() forms of the initcalls are not implemented, so this should not be used -- just use the non-sync form of it. drivers/usb/otg/twl4030-usb.c:777: warning: data definition has no type or storage class drivers/usb/otg/twl4030-usb.c:777: warning: type defaults to 'int' in declaration of 'subsys_initcall_sync' drivers/usb/otg/twl4030-usb.c:777: warning: parameter names (without types) in function declaration Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Fix CDC EEM host driver 'sentinel' CRC validationBrian Niebuhr2009-09-231-7/+10
| | | | | | | | | | | | | This is an alternate solution to the EEM 'sentinel' CRC valiation issue. CDC EEM allows using a 'sentinel' ethernet frame CRC of 0xdeadbeef in place of a real CRC. The 'sentinel' value is transmitted in big-endian order whereas the normal CRC is little-endian. This patch handles both cases appropriately. Signed-off-by: Brian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Update Freescale UDC entry in MAINTAINERSLi Yang2009-09-231-2/+2
| | | | | | | | | | | Change the F entry for file rename, and make it also cover fsl_qe_udc driver. Update the name accordingly. Signed-off-by: Li Yang <leoli@freescale.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: isp1362: Correct use of ! and &Julia Lawall2009-09-231-4/+8
| | | | | | | | | | | | | | | | | Correct priority problem in the use of ! and &. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E; constant C; @@ - !E & C + !(E & C) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: ensure all watchdog timer events are deleted when suspending usbJon Hunter2009-09-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch was previously discussed in the following thread: http://thread.gmane.org/gmane.linux.usb.general/19472/focus=19484 On the OMAP3 device the usbhost controller is in a separate internal power-domain. So when the usbhost is inactive or suspend is called, we can disable clocks and power-down the usbhost to save power. Recently we found that after calling ehci_bus_suspend() and disabling the usbhost clocks we would see the ehci watchdog timer event fire. This was causing a kernel panic because the usbhost controllers clocks were disabled and inside the watchdog timer function the clocks were not being re-enabled, so when the ehci registers were accessed this resulted in a CPU data-abort. To avoid this panic, per recommendation from Alan Stern (see above thread), we make sure any pending timer events (that may have been scheduled by calling ehci_work within the ehci_bus_suspend() function) are deleted before returning. Signed-off-by: Fei Yang <fei.yang@motorola.com> Signed-off-by: Jon Hunter <jon-hunter@ti.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: otg: twl4030-usb.c: mark .init as subsys_initcall_syncMing Lei2009-09-231-1/+1
| | | | | | | | | | | | | | | | This patch fixes the .probe failure of twl4030_usb driver if it is compiled into kernel. Since twl4030_usb USB transceiver .probe depends on twl4030-regulator, marking twl4030_usb_init as subsys_initcall_sync can make it called after twl4030-regulator initialization is finished, then twl4030_usb USB transceiver driver can be probed successfully. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: musb: fix put_device() call sequenceAjay Kumar Gupta2009-09-231-4/+4
| | | | | | | | | | | | | Invoke put_device(musb->xceiv->dev) before musb_platform_exit()as xceiv is getting unregistered in musb_platform_exit(). Fixes put_device() panic when module insert/removal is performed multiple times. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Work around BIOS bugs by quiescing USB controllers earlierDavid Woodhouse2009-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are seeing a number of crashes in SMM, when VT-d is enabled while 'Legacy USB support' is enabled in various BIOSes. The BIOS is supposed to indicate which addresses it uses for DMA in a special ACPI table ("RMRR"), so that we can punch a hole for it when we set up the IOMMU. The problem is, as usual, that BIOS engineers are totally incompetent. They write code which will crash if the DMA goes AWOL, and then they either neglect to provide an RMRR table at all, or they put the wrong addresses in it. And of course they don't do _any_ QA, since that would take too much time away from their crack-smoking habit. The real fix, of course, is for consumers to refuse to buy motherboards which only have closed-source firmware available. If we had _open_ firmware, bugs like this would be easy to fix. Since that's something I can only dream about, this patch implements an alternative -- ensuring that the USB controllers are handed off from the BIOS and quiesced _before_ the IOMMU is initialised. That would have been a much better design than this RMRR nonsense in the first place, of course. The bootloader has no business doing DMA after the OS has booted anyway. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: increase usbdevfs max isoc buffer sizeMarkus Rechberger2009-09-231-1/+2
| | | | | | | | | | | | | | | | The current limit only allows isochronous transfers up to 32kbyte/urb, updating this to 192 kbyte/urb improves the reliability of the transfer. USB 2.0 transfer is possible with 32kbyte but increases the chance of corrupted/incomplete data when the system is performing some other tasks in the background. http://www.spinics.net/lists/linux-usb/msg19955.html Signed-off-by: Markus Rechberger <mrechberger@gmail.com> Cc: Oliver Neukum <oliver@neukum.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: isp1362: fix pulldown register defines and conf logicKen MacLeod2009-09-232-3/+3
| | | | | | | | | HCHWCFG_PULLDOWN_DS2 and HCHWCFG_PULLDOWN_DS1 were swapped. Incorrect operator precedence in isp1362_hc_start() hid part of the problem. This fixes a problem where Port 1 in Host mode fails to see disconnects. Signed-Off-By: Ken MacLeod <ken@bitsko.slc.ut.us> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: audio driver seg-fault fixRobin Callender2009-09-231-4/+6
| | | | | | | | | | | | | | | | | | The included patch can be applied to the new usb gadget audio driver. It addresses a seg-fault in uncovered in g_audio.ko. The fault occurs in the function u_audio.c::gaudio_open_end_dev() when device /dev/snd/pcmC0D0c (FILE_PCM_CAPTURE) is not present. I suspect there may be similar problems with device /dev/snd/pcmC0D0p (FILE_PCM_PLAYBACK) handling also. I leave that for the developer(s), as I was unsure as to the side-effects of not calling playback_default_hw_params() in the initialization phase. Signed-off-by: Robin Callender <robin_callender@hotmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Read buffer overflowRoel Kluin2009-09-231-1/+1
| | | | | | | | | Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb-storage fails to attach to Huawei Datacard cdrom devicefangxiaozhi2009-09-231-1/+1
| | | | | | | | | | | In this patch, we always make the return value of function usb_stor_huawei_e220_init to be zero. Then it will not prevent usb-storage driver from attaching to the CDROM device of Huawei Datacard. Signed-off-by: fangxiaozhi <huananhu@huawei.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ark3116: add IrDA support for Gembird UIR-22Ondrej Zary2009-09-231-1/+23
| | | | | | | | | | | | | | | Add IrDA support to ark3116 driver. This makes Gembird UIR-22 USB to IrDA adapter work (vendor ID 0x18ec, device ID 0x3118). This adapter contains ARK3116T USB serial chip and an IrDA transceiver, thus a command like "irattach /dev/ttyUSB0 -s" is needed. All magic numbers were captured using usbsnoop from windows driver that came with the device. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ohci-pxa27x: Allow NOCP and OCPM to be clearedAric Blumer2009-09-231-0/+4
| | | | | | | | | | | | | Some ohci-pxa27x platforms may require OCPM and NOCP in UHCRHDA to be clear, but the existing code was only allowing setting. This patch ensures that these bits are clear if the respective flags are not set. This is particularly important for the PXA3xx family where the documentation says OCPM must be cleared, but it is set after reset. Signed-off-by: Aric Blumer <aric@sdgsystems.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: OHCI: Remove unnecessary includes of reboot.hAnand Gadiyar2009-09-233-3/+0
| | | | | | | | | EHCI: OHCI: Remove unnecessary includes of reboot.h Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: audio: guard kernel-only code with __KERNEL__Michael S. Tsirkin2009-09-231-0/+4
| | | | | | | | | | | include/linux/usb/audio.h is exported to userspace, so part of this file that is for internal kernel usage need to be guarded with ifdef __KERNEL__. This way make headers_install will stript it out. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: at91: modify OHCI driver to allow shared interruptsNicolas Ferre2009-09-231-1/+1
| | | | | | | | | | | | | At91sam9g45 series has a set of high speed USB interfaces. The host driver is an EHCI with its companion OHCI. OHCI is always handled by ohci-at91.c. This wrapper is just modified to allow IRQ sharing between two controllers. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: at91: Add USB gadget driver selection for at91sam9g45 seriesNicolas Ferre2009-09-231-2/+2
| | | | | | | | | | | | Add gadget USB drivers for at91sam9g45 series. Those SOC include high speed USB interfaces. The gadget driver is the already available atmel_usba_udc. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: at91: Add USB EHCI driver for at91sam9g45 seriesNicolas Ferre2009-09-233-0/+236
| | | | | | | | | | | Add host USB High speed driver for at91sam9g45 series. The host driver is an EHCI with its companion OHCI. EHCI is handled by the new ehci-atmel.c whereas the OHCI is always handled by ohci-at91.c. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
* USB: uhci: rm repeatedly evaluation for urbp->qhBob Liu2009-09-231-1/+0
| | | | | | | Signed-off-by: Bob Liu <yjfpb04@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: fix printk format warningsRandy Dunlap2009-09-231-1/+1
| | | | | | | | | | Fix printk format warnings: drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32' drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbsGuus Sliepen2009-09-231-4/+18
| | | | | | | | | | | | | | | | | According to the specifications, an instrument should not return more data in a DEV_DEP_MSG_IN urb than requested. However, some instruments can send more than requested. This could cause the kernel to write the extra data past the end of the buffer provided by read(). Fix this by checking that the value of the TranserSize field is not larger than the urb itself and not larger than the size of the userspace buffer. Also correctly decrement the remaining size of the buffer when userspace read()s more than USBTMC_SIZE_IOBUFFER. Signed-off-by: Guus Sliepen <guus@sliepen.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: NXP ISP1362 USB host driverLothar Wassmann2009-09-236-0/+4044
| | | | | | | | | Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: dummy-hcd: accept mismatch between wLength and transfer lengthAlan Stern2009-09-231-5/+0
| | | | | | | | | | | | | | | | | This patch (as1269) fixes a bug in the way dummy_hcd handles control URBs. Currently it returns a -EOVERFLOW error if the wLength value in the setup packet is different from the URB's transfer_buffer_length. Other host controller drivers don't do this. There's no reason the two length values have to be equal, and in fact they sometimes aren't -- a driver might set the transfer length to the maxpacket value in order to handle buggy devices that don't respect wLength. This patch simply removes the unnecessary check and error return. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: don't lose mode switch events on suspended devicesAlan Stern2009-09-231-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1268) changes the way usbcore handles child devices that undergo a disconnection and reconnection while the parent hub is suspended. Currently, if the child isn't enabled for remote wakeup we leave it alone, figuring that it will go through a reset-resume when somebody tries to use it. However this isn't a good approach if the reason for the disconnection is that the child decided to switch modes or in some other way alter its descriptors. In that case we want to re-enumerate it as soon as possible, not wait until somebody forces a reset-resume. To resolve the issue, this patch treats reconnected suspended child devices as though they had requested a remote wakeup, even if they weren't enabled for it. The mode switch or descriptor change will be detected during the reset part of the reset-resume, and the device will be re-enumerated immediately. The disadvantage of this change is that it will cause autosuspended devices to be resumed when the computer wakes up from a system sleep during which the root hub was reset or lost power. This shouldn't matter much; some people would even argue that autosuspended devices should _always_ be resumed when the system wakes up! Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: "Yang Fei-AFY095" <fei.yang@motorola.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: check for hub driver not bound to root hub deviceAlan Stern2009-09-231-3/+7
| | | | | | | | | | | | | | | | | | | | This patch (as1267) changes usb_kick_khubd() and hdev_to_hub() to make them more resilient against situations where a hub device isn't bound to the hub driver. The code assumes that if a root hub was successfully registered then it must be bound to the hub driver. But this assumption can fail if the user manually unbinds the hub driver, or more importantly, if the host controller dies causing usb_set_configuration to fail. To protect against these possibilities, make hdev_to_hub() check that the hub device is configured before dereferencing the active configuration, and make usb_kick_khubd() check that the pointer to the hub's private data structure isn't NULL. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud