- 21 5月, 2010 40 次提交
-
-
由 Michal Nazarewicz 提交于
The FunctionFS is a USB composite function that can be used with the composite framework to create an USB gadget. >From kernel point of view it is just a composite function with some unique behaviour. It may be added to an USB configuration only after the user space driver has registered by writing descriptors and strings (the user space program has to provide the same information that kernel level composite functions provide when they are added to the configuration). >From user space point of view it is a file system which when mounted provide an "ep0" file. User space driver need to write descriptors and strings to that file. It does not need to worry about endpoints, interfaces or strings numbers but simply provide descriptors such as if the function was the only one (endpoints and strings numbers starting from one and interface numbers starting from core). The FunctionFS changes numbers of those as needed also handling situation when numbers differ in different configurations. When descriptors and strings are written "ep#" files appear (one for each declared endpoint) which handle communication on a single endpoint. Again, FunctionFS takes care of the real numbers and changing of the configuration (which means that "ep1" file may be really mapped to (say) endpoint 3 (and when configuration changes to (say) endpoint 2)). "ep0" is used for receiving events and handling setup requests. When all files are closed the function disables itself. Signed-off-by: NMichal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Michal Nazarewicz 提交于
__init, __initdata and __exit tags have have been removed from various files to make it possible for gadgets that do not use the __init/__exit tags to use those. Files in question are related to: * the core composite framework, * the mass storage function (fixing a section mismatch) and * ethernet driver (ACM, ECM, RNDIS). Signed-off-by: NMichal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Michal Nazarewicz 提交于
This patch modifies the fs/timerfd.c to use the newly created wait_event_interruptible_locked_irq() macro. This replaces an open code implementation with a single macro call. Signed-off-by: NMichal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tejun Heo <tj@kernel.org> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Michal Nazarewicz 提交于
New wait_event_interruptible{,_exclusive}_locked{,_irq} macros added. They work just like versions without _locked* suffix but require the wait queue's lock to be held. Also __wake_up_locked() is now exported as to pair it with the above macros. The use case of this new facility is when one uses wait queue's lock to protect a data structure. This may be advantageous if the structure needs to be protected by a spinlock anyway. In particular, with additional spinlock the following code has to be used to wait for a condition: spin_lock(&data.lock); ... for (ret = 0; !ret && !(condition); ) { spin_unlock(&data.lock); ret = wait_event_interruptible(data.wqh, (condition)); spin_lock(&data.lock); } ... spin_unlock(&data.lock); This looks bizarre plus wait_event_interruptible() locks the wait queue's lock anyway so there is a unlock+lock sequence where it could be avoided. To avoid those problems and benefit from wait queue's lock, a code similar to the following should be used: /* Waiting */ spin_lock(&data.wqh.lock); ... ret = wait_event_interruptible_locked(data.wqh, (condition)); ... spin_unlock(&data.wqh.lock); /* Waiting exclusively */ spin_lock(&data.whq.lock); ... ret = wait_event_interruptible_exclusive_locked(data.whq, (condition)); ... spin_unlock(&data.whq.lock); /* Waking up */ spin_lock(&data.wqh.lock); ... wake_up_locked(&data.wqh); ... spin_unlock(&data.wqh.lock); When spin_lock_irq() is used matching versions of macros need to be used (*_locked_irq()). Signed-off-by: NMichal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Takashi Iwai <tiwai@suse.de> Cc: David Howells <dhowells@redhat.com> Cc: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Mike Galbraith <efault@gmx.de> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Randy Dunlap 提交于
g_webcam uses v4l[2] interfaces, so it should depend on VIDEO_DEV. ERROR: "v4l2_event_unsubscribe" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_event_queue" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_device_release" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_usercopy" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_event_dequeue" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_register_device" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_device_alloc" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_event_subscribe" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_unregister_device" [drivers/usb/gadget/g_webcam.ko] ndefined! ERROR: "v4l2_event_pending" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_fh_init" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_event_init" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "video_devdata" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_event_alloc" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_fh_add" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_fh_del" [drivers/usb/gadget/g_webcam.ko] undefined! ERROR: "v4l2_fh_exit" [drivers/usb/gadget/g_webcam.ko] undefined! Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com> Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Johan Hovold 提交于
Remove multi-urb write from the generic driver and simplify the prepare_write_buffer prototype: int (*prepare_write_buffer)(struct usb_serial_port *port, void *dest, size_t size); The default implementation simply fills dest with data from port write fifo but drivers can override it if they need to process the outgoing data (e.g. add headers). Turn ftdi_sio into a generic fifo-based driver, which lowers CPU usage significantly for small writes while retaining maximum throughput. Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Johan Hovold 提交于
Reimplement fifo-based writes in the generic driver using a multiple pre-allocated urb scheme. In contrast to multi-urb writes, no allocations (of urbs or buffers) are made during run-time and there is less pressure on the host stack queues as currently only two urbs are used (implementation is generic and can handle more than two urbs as well, though). Initial tests using ftdi_sio show that the implementation achieves the same (maximum) throughput at high baudrates as multi-urb writes. The CPU usage is much lower than for multi-urb writes for small write requests and only slightly higher for large (e.g. 2k) requests (due to extra copy via fifo?). Also outperforms multi-urb writes for small write requests on an embedded arm-9 system, where multi-urb writes are CPU-bound at high baudrates (perf reveals that a lot of time is spent in the host stack enqueue function -- could perhaps be a bug as well). Keeping the original write_urb, buffer and flag for now as there are other drivers depending on them. Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Johan Hovold 提交于
Kill circular buffers for tx and rx as well as read work thread, and switch to generic kfifo-based write implementation. This is an example of how prepare_write_buffer and process_read_urb can be used to handle protocols with packet headers. Please note the diffstat which shows that the same functionality is now provided using only a tenth of the code (including whitespace and comments, though). Tested-by: NNaranjo, Manuel Francisco <naranjo.manuel@gmail.com> Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Johan Hovold 提交于
The original SIO devices require a control byte for every packet written. Clean up the unnecessarily messy implementation of this. Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Johan Hovold 提交于
Switch to the generic, multi-urb, write implementation. Note that this will also make it fairly easy to use the generic fifo-based write implementation: simply unset the multi_urb_write flag and modify prepare_write_buffer (or unset if not using a legacy SIO device). This may be desirable for instance on an embedded system where optimal throughput at high baudrates may not be as important as other factors (e.g. no allocations during runtime and less pressure on host stack). Signed-off-by: NJohan Hovold <jhovold@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Tobias Klauser 提交于
Use the resource_size function instead of manually calculating the resource size. This reduces the chance of introducing off-by-one errors. Signed-off-by: NTobias Klauser <tklauser@distanz.ch> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alan Stern 提交于
This patch (as1377) simplifies the code in usb_sg_init(), without changing its functionality. It also removes a couple of unused fields from the usb_sg_request structure. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Laurent Pinchart 提交于
This webcam gadget instantiates a UVC camera (360p and 720p resolutions in YUYV and MJPEG). Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Laurent Pinchart 提交于
This USB video class function driver implements a video capture device from the host's point of view. It creates a V4L2 output device on the gadget's side to transfer data from a userspace application over USB. The UVC-specific descriptors are passed by the gadget driver to the UVC function driver, making them completely configurable without any modification to the function's driver code. Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Matthew Wilcox 提交于
Change the type of the URB's 'sg' pointer from a usb_sg_request to a scatterlist. This allows drivers to submit scatter-gather lists without using the usb_sg_wait() interface. It has the added benefit of removing the typecasts that were added as part of patch as1368 (and slightly decreasing the number of pointer dereferences). Signed-off-by: NMatthew Wilcox <willy@linux.intel.com> Reviewed-by: NAlan Stern <stern@rowland.harvard.edu> Tested-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Matthew Wilcox 提交于
The stronger type-checking would have prevented a bug I had. Signed-off-by: NMatthew Wilcox <willy@linux.intel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Matthew Wilcox 提交于
Converting a pipe number to a struct usb_host_endpoint pointer is a little messy. Introduce a new convenience function to hide the mess. Signed-off-by: NMatthew Wilcox <willy@linux.intel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Matthew Wilcox 提交于
The Pipe Usage descriptor is needed for USB Attached SCSI Signed-off-by: NMatthew Wilcox <willy@linux.intel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Bill Pemberton 提交于
Signed-off-by: NBill Pemberton <wfp5p@virginia.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Bill Pemberton 提交于
Signed-off-by: NBill Pemberton <wfp5p@virginia.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Bill Pemberton 提交于
Signed-off-by: NBill Pemberton <wfp5p@virginia.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Bill Pemberton 提交于
qset_print() was not declared static although it is not used outside of debug.c Signed-off-by: NBill Pemberton <wfp5p@virginia.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Hans de Goede 提交于
These Appotech controllers are found in Picture Frames, they provide a (buggy) emulation of a cdrom drive which contains the windows software Uploading of pictures happens over the corresponding /dev/sg device. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Cc: stable <stable@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Dinh Nguyen 提交于
The max packet length bit mask used for isochronous endpoints should be 0x7FF instead of 0x8FF. 0x8FF will actually clear higher-order bits in the max packet length field. This patch applies to 2.6.34-rc6. Signed-off-by: NDinh Nguyen <Dinh.Nguyen@freescale.com> Cc: stable <stable@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Ajay Kumar Gupta 提交于
AM3517 is based on ES3.1 thus ES2.x related programming is invalid for it so updating ES2.x programming. Also fixed below checkpatch warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Ajay Kumar Gupta 提交于
Fixes below compilation warning: drivers/usb/host/ehci-hcd.c:425: warning: 'ehci_port_power' defined but not used Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Dan Williams 提交于
Another CDC-ACM + vendor specific interface layout. Signed-off-by: NDan Williams <dcbw@redhat.com> Cc: stable <stable@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 zhao1980ming 提交于
this patch adds ZTE modem devices Signed-off-by: NJoey <zhao.ming9@zte.com.cn> Cc: stable <stable@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Sarah Sharp 提交于
When a device is disconnected, xhci_free_virt_device() is called. Ramya found that if the device had streams enabled, and then the driver freed the streams with a call to usb_free_streams(), then about a minute after he had called this, his machine crashed with a Bad DMA error. It turns out that xhci_free_virt_device() would attempt to free the endpoint's stream_info data structure if it wasn't NULL, and the free streams function was not setting it to NULL after freeing it. Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: NRamya Desai <ramya.desai@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alan Stern 提交于
Now that URB_NO_SETUP_DMA_MAP is no longer in use, this patch (as1376) removes all references to it. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alan Stern 提交于
This patch (as1375) eliminates the usb_host_ss_ep_comp structure used for storing a dynamically-allocated copy of the SuperSpeed endpoint companion descriptor. The SuperSpeed descriptor is placed directly in the usb_host_endpoint structure, alongside the standard endpoint descriptor. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alan Stern 提交于
This patch (as1374) cleans up a few loose ends in the include/linux/usb/ch11.h header file and exports it to userspace. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Cc: Eric Lescouet <Eric.Lescouet@virtuallogix.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alan Stern 提交于
This patch (as1373) fixes a couple of drivers outside the USB subtree. Devices are now disabled or enabled for autosuspend by calling a core function instead of setting a flag. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Peter Korsgaard 提交于
Otherwise reloads will fail. Signed-off-by: NPeter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alessio Igor Bogani 提交于
BKL isn't anymore present into this file thus it is no necessary still include smp_lock.h. Signed-off-by: NAlessio Igor Bogani <abogani@texware.it> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Alessio Igor Bogani 提交于
BKL is not needed here because necessary locking is already provided by mutex sisusb->lock. Signed-off-by: NAlessio Igor Bogani <abogani@texware.it> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Fabien Chouteau 提交于
This patch adds handling of the "Start/Stop Unit" SCSI request to simulate media ejection. Signed-off-by: NFabien Chouteau <fabien.chouteau@barco.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Fabien Chouteau 提交于
This patch adds a sysfs entry (/sys/devices/platform/_UDC_/gadget/suspended) to show the suspend state of an USB composite gadget. Signed-off-by: NFabien Chouteau <fabien.chouteau@barco.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Randy Dunlap 提交于
Fix usb sparse warnings: drivers/usb/host/isp1362-hcd.c:2220:50: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:43:24: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:49:24: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:161:24: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:198:16: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:319:31: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:1231:33: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-pci.c:177:23: warning: non-ANSI function declaration of function 'xhci_register_pci' drivers/usb/host/xhci-pci.c:182:26: warning: non-ANSI function declaration of function 'xhci_unregister_pci' drivers/usb/host/xhci-ring.c:342:32: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:525:34: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:1009:32: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:1031:32: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:1041:16: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:1096:30: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-ring.c:1100:27: warning: Using plain integer as NULL pointer drivers/usb/host/xhci-mem.c:224:27: warning: symbol 'xhci_alloc_container_ctx' was not declared. Should it be static? drivers/usb/host/xhci-mem.c:242:6: warning: symbol 'xhci_free_container_ctx' was not declared. Should it be static? Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com> Cc: Lothar Wassmann <LW@KARO-electronics.de> Signed-off By: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-
由 Michal Nazarewicz 提交于
usb_gat_configuratio() used two pointers to point to the same memory. Code simplified, by removing one of them. Signed-off-by: NMichal Nazarewicz <mina86@mina86.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
-