aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
AgeCommit message (Collapse)Author
2006-01-04[PATCH] USB: Use ARRAY_SIZE macroTobias Klauser
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of ARRAY_SIZE. Some trailing whitespaces are also removed. Patch is compile-tested on i386. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04[PATCH] USB Gadget: dummy_hcd: updates to hcd->stateAlan Stern
This patch (as613) moves the updates to hcd->state in the dummy_hcd driver to where they now belong. It also uses the new HC_FLAG_HW_ACCESSIBLE flag in a way that simulates a real PCI controller, and it adds checks for attempts to resume the bus while the controller is suspended or to suspend the controller while the bus is active. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04[PATCH] USB Gadget: file_storage: remove "volatile" declarationsAlan Stern
This patch (as612) removes the "volatile" declarations from the file-storage gadget. It turns out that they aren't needed for anything much; adding a few memory barriers does a sufficient job. The patch also removes a wait_queue. Not much point having a queue when only one task is ever going to be on it! Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04[PATCH] USB: Cleanups for usb gadget mass-storagePavel Machek
Remove useless initalizers. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
2006-01-04[PATCH] USB: One potential problem in gadget/serial.cFengwei Yin
It looks like that the gs_serial module maybe sleep with spinlock in gs_close. Sometimes, system hang when I remove the gs_serial module. From: Fengwei Yin <xaityyy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04[PATCH] USB: dummy_hcd: rename variablesAlan Stern
The recent platform_device update has reintroduced into dummy_hcd.c the dreaded dev->dev syndrome. This harkens back to when an earlier version of that driver included the unforgettable line: dev->dev.dev.driver_data = dev; This patch (as602) renames the platform_device variables to "pdev", in the hope of reducing confusion. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04[PATCH] USB: file-storage gadget: Add reference count for childrenAlan Stern
This patch (as601) adds a proper reference count to the file-storage gadget's main data structure, to keep track of references held by child devices (LUNs in this case). Before this, the driver would wait for each child to be released before unbinding. While there's nothing really wrong with that (you can't create a hang by doing "rmmod g_file_storage </sys/.../lun0/ro" since the open file will prevent rmmod from running), the code might as well follow the standard procedures. Besides, this shrinks the size of the structure by a few words... :-) Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-17[PATCH] USB: fix build breakage in dummy_hcd.cGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-11Merge master.kernel.org:/home/rmk/linux-2.6-drvmodelLinus Torvalds
2005-11-10[PATCH] PCI: removed unneeded .owner field from struct pci_driverGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-09[DRIVER MODEL] Convert platform drivers to use struct platform_driverRussell King
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-09[PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reasonOlaf Hering
This patch removes almost all inclusions of linux/version.h. The 3 #defines are unused in most of the touched files. A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is unfortunatly in linux/version.h. There are also lots of #ifdef for long obsolete kernels, this was not touched. In a few places, the linux/version.h include was move to where the LINUX_VERSION_CODE was used. quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'` search pattern: /UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-29Create platform_device.h to contain all the platform device details.Russell King
Convert everyone who uses platform_bus_type to include linux/platform_device.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] USB: gadget drivers - add .owner initialisationBen Dooks
Ensure the the device_driver and usb_gadget_driver have their .owner fields initialised to associate the module owner to the driver. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] add usb transceiver set_suspend() methodJuha Yrj?l?
When a USB device is put into suspend mode, the current drawn from VBUS has to be less than 500 uA. Some transceivers need to be put into a special power-saving mode to accomplish this, and won't have a separate OTG driver handling that. This adds a suspend method to the "otg_transceiver" struct -- misnamed, it's not only for OTG -- and calls it from the OMAP UDC driver. Signed-off-by: Juha Yrj?l? <juha.yrjola@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] omap_udc dma off-by-one fixDavid Brownell
The change to make DMA work two bytes at a time omitted an important tweak that affects the file_storage gadget: it needs to recognize when the host writes an odd number of bytes. (The network layer ignores such extra bytes.) This patch resolves that issue by checking the relevant bit and adjusting the rx byte count, so that for example a legal 13 byte request doesn't morph into an illegal 14 byte one any more. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] USB: Rename hcd->hub_suspend to hcd->bus_suspendAlan Stern
This patch (as580) is perhaps the only result from the long discussion I had with David about his changes to the root-hub suspend/resume code. It renames the hub_suspend and hub_resume methods in struct usb_hcd to bus_suspend and bus_resume. These are more descriptive names, since the methods really do suspend or resume an entire USB bus, and less likely to be confused with the hub_suspend and hub_resume routines in hub.c. It also takes David's advice about removing the layer of bus glue, where those methods are called. And it implements a related change that David made to the other HCDs but forgot to put into dummy_hcd. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] g_file_storage: fix obscure race conditionAlan Stern
This patch (as575) fixes an unlikely race in the g_file_storage driver. The problem can occur only when the driver is unbound before its initialization routine has finished. I also took the opportunity to replace kmalloc/memset with kzalloc. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] USB: File-Storage gadget: use the kthread APIAlan Stern
This patch (as566) converts the File-Storage gadget over to the kthread API. The new code doesn't use kthread_stop because the control thread needs to terminate asynchronously when it receives a signal. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/usb/gadget/file_storage.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-)
2005-10-28Merge ../bleed-2.6Greg KH
2005-10-28[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacksRussell King
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
Minor manual fixups for gfp_t clashes.
2005-10-28[PATCH] gfp_t: drivers/usbAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-28[ARM] 3044/1: Fix sparse warnings about incompatible pointer types for ↵Ian Campbell
register defined in pxa-regs.h Patch from Ian Campbell The sparse warning initially surfaced in sound/arm/pxa2xx-ac97.c because it was using u32 * variables to hold the unsigned long * register addresses. I submitted an ALSA patch for this http://thread.gmane.org/gmane.linux.alsa.devel/27804 issue and it was suggested that it might be preferable to change the register definitions to use u32. Most other subarches seem to use u32 for their register type, at least the ones which use a __REG macro (like the PXA) do. Nico indicated in the thread above that he wouldn't mind this patch. Changing the type required fixes for opposite warnings in the pxa2xx usb gadget code but that was the only new warning introduced on defconfig or lubbock, mainstone and our own PXA255 boards. Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-22[PATCH] USB: fix pxa2xx_udc compile warningsRichard Purdie
This patch fixes several types in the PXA25x udc driver and hence fixes several compiler warnings. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-12[PATCH] USB gadgetfs: fixes an error on writing to endpoint filePavol Kurina
this patch fixes an "Invalid argument" error returned by a write to an endpoint-file after reopening it in the gadgetfs module in the kernel 2.6.12. This was testet only with dummy_hcd module! Signed-off-by: Pavol Kurina <kurina@gmx.net> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2005-09-08[PATCH] USB: Gadget library: centralize gadget controller numbersDavid Brownell
This patch centralizes the assignment of bcdDevice numbers for different gadget controllers. This won't improve the object code at all, but it does save a lot of repetitive and error-prone source code ... and will simplify the work of supporting a new controller driver, since most new gadget drivers will no longer need patches (unless some hardware quirks limit USB protocol messaging). Added minor cleanups and identifer hooks for the UDC in the Freescale iMX series processors. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-12[PATCH] USB: omap_udc tweaksdavid-b@pacbell.net
Minor OMAP updates that somehow got dropped from previous patches. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-12[PATCH] USB: gadget/ether build fixes.Ian Campbell
I also needed the following on 2.6.13-rc1 without CONFIG_USB_ETH_RNDIS, symbol fs_status_desc isn't available in that case on PXA255. This builds both with and without ETH_RNDIS, but I haven't actually tested either. Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-12[PATCH] USB: gadget/ether fixesIan Campbell
Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-12[PATCH] USB: net2280 warning fixAndrew Morton
drivers/usb/gadget/net2280.c: In function 'show_registers': drivers/usb/gadget/net2280.c:1501: warning: assignment discards qualifiers from pointer target type Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-07-12[PATCH] USB: Fix kmalloc's flags type in USBOlav Kongas
Greg, This patch fixes the kmalloc() flags argument type in USB subsystem; hopefully all of its occurences. The patch was made against patch-2.6.12-git2 from Jun 20. Cleanup of flags for kmalloc() in USB subsystem. Signed-off-by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: resolve ethernet gadget build glitch on pxaDavid Brownell
This fixes a build error on pxa25x processes with pxa2xx_udc and CONFIG_USB_ETH=m # CONFIG_USB_ETH_RNDIS is not set The error is because on that CPU there's no status transfer support except with RNDIS. Workaround, enable the RNDIS support too. Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB gadget: drain rndis response queue on disconnectDavid Brownell
Drain the rndis response queue on disconnect. This fixes a problem in which an rndis response left in the queue from a previous session could cause a subsequent session to fail. Signed-off-by: Andy Lowe <alowe@mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: fix drivers/usb/gadget/ether.c compile errorDavid Brownell
This fixes a compile glitch with CONFIG_USB_ETH_RNDIS disabled, and replaces some inline #ifdeffery (and other code) with inline functions which can evaluate to constants. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: dummy_hcd: add suspend/resume supportAlan Stern
This patch adds support to dummy_hcd for suspending and resuming the root hub and the emulated platform devices. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: dummy_hcd: sparse cleanupsAlan Stern
This patch fixes the byte-ordering issue for setup packets in the dummy_hcd driver and cleans up a few things that sparse -Wbitwise dislikes. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: pxa2xx_udc updatesDavid Brownell
This has several small updates to the px2xx UDC driver: * small fixes from Eugeny S. Mints <emints@ru.mvista.com> - local_irq_save() around potential endpoint disable race - fix handling of enqueue to OUT endpoints (potential oops) * add shutdown() method to disable any D+ pullup * rename methods accessing raw signals, referencing the signals * describes itself as for "pxa25x", since pxa27x is different Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: goku_udc updates (sparse, SETUP api change)David Brownell
Sparse updates; and the API change for SETUP packets being in USB byteorder. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: net2280 updates (sparse, SETUP api change)David Brownell
This is mostly "sparse" related updates, one of which was a missing le32_to_cpu() should have affected big-endian hardware. Notable is the API change: setup packets are now provided in USB byte order. This affects only big-endian hardware, and the gadget drivers have been updated in a separate patch. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: gadget driver updates (SETUP api change)David Brownell
This updates most of the gadget framework to expect SETUP packets use USB byteorder (matching the annotation in <linux/usb_ch9.h> and usage in the host side stack): - definition in <linux/usb_gadget.h> - gadget drivers: Ethernet/RNDIS, serial/ACM, file_storage, gadgetfs. - dummy_hcd It also includes some other similar changes as suggested by "sparse", which was used to detect byteorder bugs. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: Kconfig fixes for usb/gadgetDavid Brownell
This prevents gadget drivers from being selected when no controller has been selected, by adding an additional boolean and depending on it. It's mostly to help "allmodconfig". Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB dummy_hcd: Use root-hub interrupts instead of pollingAlan Stern
This patch makes the dummy_hcd driver use emulated root-hub interrupts instead of polling. It's in the spirit of similar changes being made to the other HCDs. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB dummy_hcd: Centralize link state computationsAlan Stern
This patch adds to the dummy_hcd driver a new routine for keeping track of all changes in the state of the emulated USB link. The logic is now kept in one spot instead of spread around, and it's easier to verify and update the code. The behavior of the port features has been corrected in a few respects as well (for instance, if the POWER feature is clear then none of the other features can be set). Also added is support for the (relatively new) _connect() and _disconnect() calls of the Gadget API. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB dummy_hcd: Use separate pdevs for HC and UDCAlan Stern
This patch makes the dummy_hcd driver create separate platform devices for the emulated host controller and emulated device controller. This gives a more accurate simulation and will permit testing of situations where only one of the two devices is suspended. This also changes the name of the host controller platform device to match the name of the driver. That way the normal platform bus probe mechanism will handle binding the driver to the device. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: dummy_hcd: USB_PORT_FEAT changed to USB_PORT_STATAlan Stern
This patch makes some cosmetic changes to dummy_hcd: Minor alterations of comments and whitespace. Replace USB_PORT_FEAT_xxx with USB_PORT_STAT_xxx. This is appropriate as the values are stored in a status variable and they aren't feature indices. Also it allows the elimination of a bunch of awkward bit shift operations. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB dummy_hcd: Partial OTG emulationAlan Stern
Partial OTG support for dummy_hcd, mostly as a framework for further work. It emulates the new OTG flags in the host and peripheral frameworks, if that option is configured. But it's incomplete: - Resetting the peripheral needs to clear the OTG state bits; a second enumeration won't work correctly. - This stops modeling HNP right when roles should switch the first time. It should probably disconnect, then set the usb_bus.is_b_host and usb_gadget.is_a_peripheral flags; then it'd enumerate almost normally, except for the role reversal. Roles could then switch a second time, back to "normal" (with those flags cleared). - SRP should be modeled as "resume from port-unpowered", which is a state that usbcore doesn't yet use. HNP can be triggered by enabling the OTG whitelist and configuring a gadget driver that's not in that list; or by configuring Gadget Zero to identify itself as the HNP test device. Sent-by: David Brownell <david-b@pacbell.net> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: more omap_udc updates (dma and omap1710)David Brownell
More omap_udc updates: * OMAP 1710 updates - new UDC bit for clearing endpoint toggle, affecting CLEAR_HALT - new OTG bits affecting wakeup * Fix the bug Vladimir noted, that IN-DMA transfer code path kicks in for under 1024 bytes (not "up to 1024 bytes") * Handle transceiver setup more intelligently - use transceiver whenever one's available; this can be handy for GPIO based, loopback, or transceiverless configs - cleanup correctly after the "unrecognized HMC" case * DMA performance tweaks - allow burst/pack for memory access - use 16 bit DMA access most of the time on TIPB * Add workarounds for some DMA errata (not observed "in the wild"): - DMA CSAC/CDAC reads returning zero - RX/TX DMA config registers bit 12 always reads as zero (TI patch) * More "sparse" warnings removed, notably "changing" the SETUP packet to return data in USB byteorder (an API change, null effect on OMAP except for these warnings). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: ethernet gadget updates (mostly cleanup)David Brownell
Some cleanup for the the Ethernet part of the Ethernet/RNDIS gadget driver: - Remove remnants of ancient endpoint init logic; this is simpler, clearer - Save a smidgeon of space in the object file - Get rid of some #ifdeffery, mostly by using some newish inlines - Reset more driver state as part of USB reset - Remove a needless wrapper around an RNDIS call - Improve and comment the status interrupt handling: * RNDIS sometimes needs to queue these transfers (rarely in normal cases, but reproducibly while Windows was deadlocking its USB stack) * Mark requests as busy/not - Enable the SET_NETDEV_DEV() call; sysfs seems to behave sanely now This is a net shrink of source code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-27[PATCH] USB: rndis updates (mostly cleanup)David Brownell
Some bugfixes and lots of cleanup (net code shrink): - On reset, force the RNDIS state machine its initial state - Hook up the RNDIS (outgoing) filters to the CDC mechanism - Lots of cleanup: * Eliminate duplicate copy of OID table; * Unify handlying of the OID "query" response data pointer; * Reduce code duplication for calculating query response lengths; * Remove some checks for "can't happen" errors; * Get rid of debugging #ifdefs by making the debug flag an integer level Most of the patch, by volume, relates to those query response cleanups. It incidentally shaves off a few hundred bytes of object code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>