aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
AgeCommit message (Collapse)Author
2009-09-23USB: gadget: Read buffer overflowRoel Kluin
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>
2009-09-23USB: at91: Add USB gadget driver selection for at91sam9g45 seriesNicolas Ferre
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>
2009-09-23USB: dummy-hcd: accept mismatch between wLength and transfer lengthAlan Stern
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>
2009-09-23USB: gadget: s3c-hsotg: missing parenthesesRoel Kluin
Add missing parentheses Signed-off-by: Roel Kluin <roel.kluin@gmail.com> CC: Ben Dooks <ben@simtec.co.uk> 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>
2009-09-23USB: gadget: Drop NULL test on list_entry resultJulia Lawall
list_entry, which is an alias for container_of, cannot return NULL, as there is no way to add a NULL value to a doubly linked list. A simplified version of the semantic match that findds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r@ expression x,E; statement S1,S2; position p,p1; @@ *x = list_entry@p(...) ... when != x = E *if@p1 (x == NULL) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: gadget: pxa25x: basic transceiver supportPhilipp Zabel
This adds very basic otg_transceiver support, with vbus_session and vbus_draw callbacks. Now VBUS sensing can be handled by an external driver which registers the otg_transceiver interface. It also allows gadget drivers to configure the current drawn from VBUS. The UDC driver just passes their requests along to the transceiver driver. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB audio gadget: Un-inline generic_[gs]et_cmdLaurent Pinchart
Those functions are used only used to fill the set/get members of usb_audio_control. It doesn't make much sense to inline them. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB audio gadget: Prefix all macro definitions with UAC_ in linux/usb/audio.hLaurent Pinchart
linux/usb/audio.h is a public header file that includes definitions exported to userspace. To avoid namespace clashes, prefix all macro definitions with UAC_. Existing macros and structures prefixed with USB_AC_ and USB_AS_ are renamed for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23USB: Move endpoint sync type definitions from usb/audio.h to usb/ch9.hLaurent Pinchart
And use the new definitions in the USB Audio Class gadget driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-22const: mark remaining super_operations constAlexey Dobriyan
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-16Merge branch 'master' of ↵Paul Mundt
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: arch/sh/kernel/vmlinux.lds.S
2009-09-02netdev: drivers should make ethtool_ops constStephen Hemminger
No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-01usbnet: convert to netdev_tx_tStephen Hemminger
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-24usb: gadget: m66592-udc needs linux/err.h.Paul Mundt
In certain configurations linux/err.h is not included through alternate means, resulting in: drivers/usb/gadget/m66592-udc.c:1646: error: implicit declaration of function 'IS_ERR' drivers/usb/gadget/m66592-udc.c:1649: error: implicit declaration of function 'PTR_ERR' distcc[15083] ERROR: compile drivers/usb/gadget/m66592-udc.c on localhost failed make[3]: *** [drivers/usb/gadget/m66592-udc.o] Error 1 make[2]: *** [drivers/usb/gadget] Error 2 make[1]: *** [drivers] Error 2 make: *** [sub-make] Error 2 Caught with an ARM config in -next. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21usb: r8a66597-udc: implement the set_wedge methodYoshihiro Shimoda
fix the problem that MSC Tests of USBCV detects some warnings. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20usb: r8a66597-udc disable interrupts on shutdown fixMagnus Damm
This patch improves the disable_controller() function in the r8a66597-udc driver to disable all interrupts and also clear status flags. With this patch in place the driver survives kexec. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20usb: r8a66597-udc buffer management updateMagnus Damm
This patch updates the r8a66597-udc buffer management code. Use fixed buffers for bulk and isochronous pipes, also make sure to handle the isochronous-as-bulk case. With fixed buffers there is no need to keep track of used buffers with bi_bufnum. Also, this fixes a potential buffer offset problem where the base offset incorrectly varies with the number of pipes used. The m66592 driver recently got fixed in a similar way. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20usb: add clock support to r8a66597 gadget driverMagnus Damm
Add support for the clock framework to the r8a66597 gadget driver. This is needed to control the clock driving the USB block. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20usb: gadget: R8A66597 peripheral controller support.Yoshihiro Shimoda
While in-tree support for the R8A66597 host side has been supported for some time, the peripheral side has so far been unsupported. This adds a new USB gadget driver which bridges the gap and finally wires up the peripheral side as well. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Tested-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-12f_phonet: use page-sized rather than MTU-sized RX buffersRémi Denis-Courmont
Instead of a large (physically) linear buffer, we generate a set of paged sk_buff, so no extra memory copy is involved. This removes high-order allocations and saves quite a bit of memory. Phonet MTU is 65541 bytes, so the two buffers were padded to 128 kilo-bytes each. Now, we create 17 page buffers, almost a 75% memory use reduction. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12f_phonet: lock-less MTU changeRémi Denis-Courmont
With the current driver, the MTU is purely indicative, so there is no need to synchronize with the receive path. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-12Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: arch/microblaze/include/asm/socket.h
2009-07-23usb: m66592-udc platform data on_chip supportMagnus Damm
Convert the m66592-udc driver to use the on_chip flag from platform data to enable on chip behaviour instead of relying on CONFIG_SUPERH_BUILT_IN_M66592 ugliness. This makes the code cleaner and also allows us to support both external and internal m66592 with the same kernel. It also makes the Kconfig part more future proof since we with this patch can add support for new processors with on-chip m66592 without modifying the Kconfig. The patch adds a m66592 header file for platform data and ties in platform data to the existing m66592 devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-20Merge branches 'sh/hwblk' and 'sh/platform-updates'Paul Mundt
2009-07-13Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (48 commits) USB: otg: fix module reinsert issue USB: handle zero-length usbfs submissions correctly USB: EHCI: report actual_length for iso transfers USB: option: remove unnecessary and erroneous code USB: cypress_m8: remove invalid Clear-Halt USB: musb_host: undo incorrect change in musb_advance_schedule() USB: fix LANGID=0 regression USB: serial: sierra driver id_table additions USB serial: Add ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter. USB: fix race leading to a write after kfree in usbfs USB: Sierra: fix oops upon device close USB: option.c: add A-Link 3GU device id USB: Serial: Add support for Arkham Technology adapters USB: Fix option_ms regression in 2.6.31-rc2 USB: gadget audio: select SND_PCM USB: ftdi: support NDI devices Revert USB: usbfs: deprecate and hide option for !embedded USB: usb.h: fix kernel-doc notation USB: RNDIS gadget, fix issues talking from PXA USB: serial: FTDI with product code FB80 and vendor id 0403 ...
2009-07-12USB: gadget audio: select SND_PCMRandy Dunlap
Fix USB gadget audio: select SND_PCM, like many other sound drivers do, to fix build errors: drivers/built-in.o: In function `f_audio_playback_work': audio.c:(.text+0x15a3e7): undefined reference to `snd_pcm_kernel_ioctl' audio.c:(.text+0x15a471): undefined reference to `snd_pcm_lib_write' drivers/built-in.o: In function `_snd_pcm_hw_param_set': audio.c:(.text+0x15aca7): undefined reference to `snd_interval_refine' drivers/built-in.o: In function `gaudio_setup': (.init.text+0x12adf): undefined reference to `_snd_pcm_hw_params_any' drivers/built-in.o: In function `gaudio_setup': (.init.text+0x12b43): undefined reference to `snd_pcm_kernel_ioctl' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: RNDIS gadget, fix issues talking from PXADavid Brownell
The reworked Ethernet gadget has an RNDIS interop problem when used with the CDC subset driver ... e.g. on PXA 2xx and 3xx hardware, which currently has a hard time talking to MS-Windows hosts. The issue is that Microsoft requires USB_CLASS_COMM. Fix by tweaking the CDC subset driver to not switch to USB_CLASS_VENDOR_SPEC if RNDIS is used in some other device configuration. [ UPDATED: some "statements" were comma-terminated; fix that. ] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Aric Blumer <aric@sdgsystems.net> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: gadget: pxa25x compiler warning fixDavid Brownell
Fix config-dependent compiler warning: CC drivers/usb/gadget/pxa25x_udc.o drivers/usb/gadget/pxa25x_udc.c: In function 'pxa25x_udc_irq': drivers/usb/gadget/pxa25x_udc.c:1806: warning: array subscript is above array bounds Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: gadget: pxa25x uses gpio_is_validPhilipp Zabel
Use gpio_is_valid instead of assuming that every GPIO number != 0 is valid while 0 is not. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: gadget: rndis conformance tweakQiuping Chen
Support OID_802_3_MAC_OPTIONS in gen_ndis_query_resp() of rndis.c to make RNDIS gadget pass 1c_SetMulticast subtest in Microsoft NDISTest6: http://www.microsoft.com/whdc/DevTools/tools/NDIStest.mspx The other tests in NDISTest6 are passed. [ dbrownell@users.sourceforge.net: remove OID_802_3_MAXIMUM_LIST_SIZE setting ... it was bogus, this code only handles one entry, not 32. And we don't know what would break if we lied about that... ] Signed-off-by: Helen Chen <helen.chen@intel.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: gadget: audio: provide correct device idGreg Kroah-Hartman
The audio gadget driver should use a "Linux" device id, instead of relying on NetChip's vendor id. So provide one out of our reserved namespace. Cc: Bryan Wu <cooloney@kernel.org> Cc: Mike Frysinger <vapier@gentoo.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12USB: gadget: fix imx_udc entry in KconfigPaulius Zaleckas
Move USB_GADGET_IMX to the right section of Kconfig as this controller is available only as integrated on i.MX CPU. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan
* Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-05net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functionsPatrick McHardy
This patch is the result of an automatic spatch transformation to convert all ndo_start_xmit() return values of 0 to NETDEV_TX_OK. Some occurences are missed by the automatic conversion, those will be handled in a seperate patch. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-05usb: m66592-udc buffer management updateMagnus Damm
This patch updates the m66592-udc buffer management code. Use fixed buffers for bulk and isochronous pipes, also make sure to handle the isochronous-as-bulk case. With fixed buffers there is no need to keep track of used buffers with bi_bufnum. Also, this fixes a potential buffer offset problem where the base offset incorrectly varies with the number of pipes used. With this patch applied it is possible to use m66592-udc for both Ethernet and Serial using CONFIG_USB_CDC_COMPOSITE. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (143 commits) USB: xhci depends on PCI. USB: xhci: Add Makefile, MAINTAINERS, and Kconfig entries. USB: xhci: Respect critical sections. USB: xHCI: Fix interrupt moderation. USB: xhci: Remove packed attribute from structures. usb; xhci: Fix TRB offset calculations. USB: xhci: replace if-elseif-else with switch-case USB: xhci: Make xhci-mem.c include linux/dmapool.h USB: xhci: drop spinlock in xhci_urb_enqueue() error path. USB: Change names of SuperSpeed ep companion descriptor structs. USB: xhci: Avoid compiler reordering in Link TRB giveback. USB: xhci: Clean up xhci_irq() function. USB: xhci: Avoid global namespace pollution. USB: xhci: Fix Link TRB handoff bit twiddling. USB: xhci: Fix register write order. USB: xhci: fix some compiler warnings in xhci.h USB: xhci: fix lots of compiler warnings. USB: xhci: use xhci_handle_event instead of handle_event USB: xhci: URB cancellation support. USB: xhci: Scatter gather list support for bulk transfers. ...
2009-06-15USB: atmel_usba_udc: change way of specifying bias functionNicolas Ferre
The toggle_bias() function was specified differently for avr32 and at91 architectures. Now, new at91 have the same behavior as avr32. Consequently, we change to a particular chip function definition: only for at91sam9rl. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: Add Intel Langwell USB Device Controller driverXiaochen Shen
Intel Langwell USB Device Controller is a High-Speed USB OTG device controller in Intel Moorestown platform. It can work in OTG device mode with Intel Langwell USB OTG transceiver driver as well as device-only mode. The number of programmable endpoints is different through controller revision. NOTE: This patch is the first version Intel Langwell USB OTG device controller driver. The bug fixing is on going for some hardware and software issues. Intel Langwell USB OTG transceiver driver and EHCI driver patches will be submitted later. Supported features: - USB OTG protocol support with Intel Langwell USB OTG transceiver driver (turn on CONFIG_USB_LANGWELL_OTG) - Support control, bulk, interrupt and isochronous endpoints (isochronous not tested) - PCI D0/D3 power management support - Link Power Management (LPM) support Tested gadget drivers: - g_file_storage - g_ether - g_zero The passed tests: - g_file_storage: USBCV Chapter 9 tests - g_file_storage: USBCV MSC tests - g_file_storage: from/to host files copying - g_ether: ping, ftp and scp files from/to host - Hotplug, with and without hubs Known issues: - g_ether: failed part of USBCV chap9 tests - LPM support not fully tested TODO: - g_ether: pass all USBCV chap9 tests - g_zero: pass usbtest tests - Stress tests on different gadget drivers - On-chip private SRAM caching support Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: gadget: add USB Audio Gadget driverBryan Wu
Funtions added: - setup all the USB audio class device descriptors - handle class specific setup request - receive data from USB host by ISO transfer - play audio data by ALSA sound card - open and setup playback PCM interface - set default playback PCM parameters - provide playback functions for USB audio driver - provide PCM parameters set/get functions Test on: - Host: Ubuntu 8.10, kernel 2.6.27 - Gadget: EZKIT-BF548 with ASoC AD1980 codec Todo: - add real Mute control code - add real Volume control code - maybe find another way to replace dynamic buffer handling with static buffer allocation - test on Windows system - provide control interface to handle mute/volume control - provide capture interface in the future - test on BF527, other USB device controler and other audio codec 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>
2009-06-15USB: Gadget driver for Samsung HS/OtG blockBen Dooks
Driver support for the new high-speed/OtG block that is in the newer line of Samsung SoC devices such as the S3C64XX series. This driver does not currntly have DMA support enabled due to issues with buffer alignment which need to be sorted out. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: gadget: Add i.MX3x support to the fsl_usb2_udc driverGuennadi Liakhovetski
This patch adds support for i.MX3x (only tested with i.MX31 so far) ARM SoCs to the fsl_usb2_udc driver. It also moves PHY configuration before controller reset, because otherwise an ULPI PHY doesn't get a reset and doesn't function after a reboot. The problem with longer control transfers is still not fixed. The patch renames the fsl_usb2_udc.c file to fsl_udc_core.c to preserve the same module name for user-space backwards compatibility. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: gadget : Fix RNDIS code to pass USB Compliance tests (USBCV) with g_etherMaulik Mankad
This patch fixes a bug in the RNDIS code. Due to this bug gether_connect() fails as the port remains un-initialized. As a result following USB Compliance Tests were failing. (1)EndpointDescriptorTest_DeviceConfigured (2)Interface Descriptor Test. (3)Halt Endpoint Test. (4)SetConfigurationTest The fix aligns rndis code with the CDC ECM for xxx_set_alt(). The above listed USB Compliance test passes with this fix. Tested working fine on SDP with OMAP 3430. Signed-off-by: Maulik Mankad <x0082077@ti.com> CC: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: gadget: imx_udc: don't queue more data when zlp is to be sentDaniel Glöckner
When a zero-length packet has been requested and another packet is written into the fifo, the MX1 tends to send the first byte of the previous packet instead of the first byte of the current packet. The CRC is adjusted accordingly so that this packet is _not_ discarded by the host. Waiting for the ZLPS bit to clear avoids these bad packets. Signed-off-by: Daniel Glöckner <dg@emlix.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: gadget: g_serial: append zlp when tx buffer becomes emptyDaniel Glöckner
Some usb serial host drivers expect a short packet before they forward the data to the application. This is caused by them trying to read more than one packet at a time. So when the gadget sends an exact multiple of the maximum packet size, it should append a zero-length packet. Signed-off-by: Daniel Glöckner <dg@emlix.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: imx_udc: fix leak in imx_ep_alloc_request()Daniel Mack
cppcheck found another leak in drivers/usb/gadget/imx_udc.c Cc: Mike Lee <eemike@gmail.com> Cc: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Daniel Mack <daniel@caiaq.de> 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>
2009-06-15USB: g_file_storage: use the "unaligned" accessorsAlan Stern
This patch (as1233) makes g_file_storage use the "unaligned" accessors. This is based on work originally done by Harvey Harrison. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: pxa27x_udc: single-thread setup requestsRobert Jarzmik
Since the PXA 27x UDC automatically ACK's some control packets such as SET_INTERFACE, the gadgets may not get a chance to process the request before another control packet is received. The Linux gadgets do not expect to receive setup callbacks out of order. The file storage gadget only saves the "highest" priority request. The PXA27x UDC driver must make sure it only sends one up at a time, allowing the gadget to make changes before continuing. In theory, the host would be NACK'd while the gadget processes the change but the UDC has already ACK'd the request. If another request is sent by the host that is not automatically ACK'd by the UDC, then the throttling happens properly to regain sync. The observed case was the file_storage gadget timing out on a BulkReset request because the SET_INTERFACE was being processed by the gadget. Since SET_INTERFACE is higher priority than BulkReset, the BulkReset was dropped. This was exacerbated by turning on the debug which delayed the fsg signal processing thread. This also fixes the "should never get in WAIT_ACK_SET_CONF_INTERF state here!!!" warning. Reported-by: Vernon Sauder <vernoninhand@gmail.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> index 51790b0..1937d8c 100644
2009-06-15USB: pxa27x_udc: compatibility with pxa320 SoCRobert Jarzmik
Got pxa27x_udc working on the pxa320 Nomad platform. The problem was that the pxa3xx UDC is not quite compatible with the pxa27x UDC in how it handles back-to-back control packets. The pxa27x probably drops them by default, but the pxa320 does not, and you have to detect it and set the OPC bit to clear the zero-length packet. Signed-off-by: Aric Blumer <aric@sdgsystems.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15USB: pxa27x_udc: introduce pxa27x_clear_otgph()David Brownell
Follow pxa27x change in OTGPH handling, and use the newly defined pxa27x_clear_otgph(). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Eric Miao <eric.miao@marvell.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2009-06-15USB: gadgetfs: use helper functions to determine endpoint type and directionMatthias Kaehlcke
Use helper functions to determine the type and direction of an endpoint instead of fiddling with bEndpointAddress and bmAttributes Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>