summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-05-20USB: musb: support host/gadget role switching on Blackfin partsCliff Cai1-6/+63
Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: debugfs: musb_exit_debugfs() can be called on probeFelipe Balbi2-3/+6
when we fail to probe(), we can call musb_exit_debugfs(). Allow that by removing section annotations. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: option.c: option_indat_callback: Resubmit some unsuccessful URBsJames Maki1-19/+30
All unsuccessful (non-zero status) URBs were being dropped. After N_IN_URBs are dropped you will no longer be able to receive data. This patch resubmits unsuccessful URBs unless the status indicates that it should be terminated. The statuses that indicate the URB should be terminated was gathered from other similar drivers. Signed-off-by: James Maki <jamescmaki@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: gadget: add HID gadget driverFabien Chouteau6-0/+1451
g_hid is a USB gadget driver implementing the Human Interface Device class specification. The driver handles basic HID protocol handling in the kernel, and allows userspace to read/write HID reports trough /dev/hidgX character devices. Signed-off-by: Fabien Chouteau <fabien.chouteau@barco.com> Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ftdi_sio: fix some coding style issuesJohan Hovold1-31/+14
Remove unnecessary comments stating function names at (some) opening/closing braces. Fix some whitespace issues. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: generalise write buffer preparationJohan Hovold3-13/+40
Generalise write buffer preparation. This allows for drivers to manipulate (e.g. add headers) to bulk out data before it is sent. This adds a new function pointer to usb_serial_driver: int (*prepare_write_buffer)(struct usb_serial_port *port, void **dest, size_t size, const void *src, size_t count); The function is generic and can be used with either kfifo-based or multi-urb writes: If *dest is NULL the implementation should allocate dest. If src is NULL the implementation should use the port write fifo. If not set, a generic implementation is used which simply uses memcpy or kfifo_out. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: re-implement multi-urb writes in generic driverJohan Hovold2-79/+62
Use dynamic transfer buffer sizes since it is more efficient to let the host controller do the partitioning to fit endpoint size. This way we also do not use more than one urb per write request. Replace max_in_flight_urbs with multi_urb_write flag in struct usb_serial_driver to enable multi-urb writes. Use MAX_TX_URBS=40 and a max buffer size of PAGE_SIZE to prevent DoS attacks. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: allow custom multi-urb write bulk callbacksJohan Hovold1-1/+1
Allow drivers to implement their own multi-urb write bulk callbacks as we do for single urb writes. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: usb_debug: use the generic kfifo-based write implementationJohan Hovold1-2/+0
Use the generic kfifo-based write implementation rather than allowing up to 4000 8 byte urbs in the host stack queues. Cc: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: pl2303: use generic closeJohan Hovold1-12/+1
Use usb_serial_generic_close to kill the read and write urbs and to reset the write fifo. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: pl2303: switch to generic write implementationJohan Hovold1-326/+4
Replace custom fifo-based write implementation with the generic kfifo-based one. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: clean up generic write start busy testJohan Hovold1-11/+4
Submit write urb if it is not already in use and we have buffered data. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: clean up some error and debug messages in generic driverJohan Hovold1-9/+4
Clean up error messages on usb_submit_urb failure. Remove debug message on zero-length writes. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ftdi_sio: switch to generic read implementationJohan Hovold1-92/+7
Switch to generic read implementation and use process_read_urb to do device specific processing (handle line status). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: export generic throttle and unthrottleJohan Hovold1-0/+2
Allow drivers to use the generic throttle and unthrottle implementation. This makes sense for drivers using the generic read functionality. Note that drivers need to set these explicitly in order to enable them (i.e., we do not set them at port probe if not defined). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: pl2303: switch to generic read implementationJohan Hovold1-59/+25
Use generic read implementation and use process_read_urb to do device specific processing (handle line status). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: generalise generic read implementationJohan Hovold3-2/+7
Add process_read_urb to usb_serial_driver so that a driver can rely on the generic read (and throttle) mechanism but still do device specific processing of incoming data (such as adding tty_flags before pushing to line discipline). The default generic implementation handles sysrq for consoles but otherwise simply pushes to tty. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: clean up read processing in generic driverJohan Hovold1-16/+11
Always process and flush read urb, but only resubmit when not throttled. The new tty-layer supply plenty of slack so there is really no need to cache and delay processing of a single urb while throttled. Note that unthrottle now submits using GFP_KERNEL as we are not in atomic context (so there is no need to save irq state either). Note also that the process_read_urb function could be added to usb_serial_driver should any driver need to do any device specific processing. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: cp210x: use generic submit_read_urb at openJohan Hovold1-14/+2
There is no need to initialise the read urb as this is done at port probe. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: remove unnecessary re-initialisation of generic urbsJohan Hovold1-23/+2
The generic read and write bulk urbs are initialised when allocated in usb_serial_probe. The only field that needs to be updated after that is the transfer_buffer_length of the write urb. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: refactor read urb submission in generic driverJohan Hovold3-26/+10
Use the already exported function for submitting the read urb associated with a usb_serial_port. Make sure it returns the result of usb_submit_urb and rename to the more descriptive usb_serial_generic_submit_read_urb. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: refactor generic closeJohan Hovold6-21/+8
Export usb_serial_generic_close so that drivers can easily kill the read and write urb and make sure that the write fifo is reset. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: clear fifo on closeJohan Hovold1-1/+7
Make sure fifo is emptied on close. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: fix missing locking on fifo in write callbackJohan Hovold1-2/+5
On errors the fifo was reset without any locking. This could race with write which do kfifo_put and perhaps also chars_in_buffer and write_room. Every other access to the fifo is protected using the port lock so better add it to the error path as well. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: fix generic chars_in_bufferJohan Hovold1-4/+11
Make sure chars_in_buffer accounts also for data in host stack queues. This fixes the problem with tty_wait_until_sent returning too soon at close which could cause the final write urb to be cancelled. Reported-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: pl2303: increase bulk-in buffer size to 256 byteJohan Hovold1-0/+1
The pl2303 requires a bulk-in buffer larger than endpoint size to keep up at high baudrates without loosing data. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: pl2303: increase the bulk-out buffer size to 256 byteJohan Hovold1-0/+1
Increase the bulk-out buffer size from 64 to 256 byte. This gives a significant increase in throughput already at 1Mbaud as well as lowered CPU usage. The buffer is big enough to keep up also at 3Mbaud (128b would not suffice). 64b 256b 921k: 640 KB/s 870 KB/s 3M: 640 KB/s 2520 KB/s Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: cp210x: increase bulk-in buffer size to 256 byteJohan Hovold1-0/+1
The cp210x requires a bulk-in buffer larger than endpoint size to keep up at high baudrates without loosing data. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: cp210x: increase the bulk-out buffer size to 256 byteJohan Hovold1-0/+1
Increase the bulk-out buffer size from 64 to 256 byte. This gives a significant increase in throughput already at 1Mbaud (e.g. 710 instead of 640 KB/s) as well as lowered CPU usage. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: serial: allow drivers to define bulk buffer sizesJohan Hovold5-71/+16
Allow drivers to define custom bulk in/out buffer sizes in struct usb_serial_driver. If not set, fall back to the default buffer size which matches the endpoint size. Three drivers are currently freeing the pre-allocated buffers and allocating larger ones to achieve this at port probe (ftdi_sio) or even at port open (ipaq and iuu_phoenix), which needless to say is suboptimal. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: Add a new quirk: USB_QUIRK_HONOR_BNUMINTERFACESHans de Goede3-2/+22
Add a new quirk USB_QUIRK_HONOR_BNUMINTERFACES, when this quirk is set and a device has more interface descriptors in a configuration then it claims to have in config->bNumInterfaces, ignore all additional interfaces. This is needed for devices which try to hide unused interfaces by only lowering config->bNumInterfaces, and which can't handle if you try to talk to the "hidden" interfaces. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: fix serial build when SYSRQ is disabledRandy Dunlap1-0/+9
Fix build error when CONFIG_MAGIC_SYSRQ is not enabled: drivers/usb/serial/generic.c:566: error: implicit declaration of function 'handle_sysrq' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB Serial Driver: ZIO MotherboardVijay Kumar3-0/+73
Add ZIO Motherboard USB serial interface driver. Signed-off-by: Vijay Kumar B. <vijaykumar@zilogic.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb-console: pass baud from console to the initial tty openJason Wessel1-12/+10
The usb console code has had a long standing problem of not being able to pass the baud rate from the kernel argument console=ttyUSB0,BAUD down to the initial tty open, unless you were willing to settle for 9600 baud. The solution is to directly use tty_init_termios() in usb_console_setup() as this will preserve any changes to the initial termios setting on future opens. CC: Alan Cox <alan@linux.intel.com> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: f_mass_storage: dynamic buffers for better alignmentMichal Nazarewicz1-5/+18
"Static" buffers in fsg_buffhd structure (ie. fields which are arrays rather then pointers to dynamically allocated memory) are not aligned to any "big" power of two which may lead to poor DMA performance (copying "by hand" of head or tail) or no DMA at all even if otherwise hardware supports it. Therefore, this patch makes mass storage function use kmalloc()ed buffers which are (because of their size) page aligned (which should be enough for any hardware). Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: hsdma: use musb_read/writelFelipe Balbi1-13/+3
... and simplify the was we read/write from/to DMA COUNT register. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: gadget: support musb-specific test modesFelipe Balbi1-0/+25
we can support the musb-specific test modes on the vendor specific range of test selector as stated on USB Specification Table 9-7 Test Mode Selectors. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: add debugfs supportFelipe Balbi4-0/+317
for now only a simple register dump entry (which can be rather useful on debugging) and a way to start test modes. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: musb: allow the Blackfin vrsel gpio to be active lowCliff Cai2-4/+5
Rather than hardcoding the gpio levels for vrsel, allow the platform resources to handle this so boards can be active high or low. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: MUSB: Add OMAP4 support in MUSB driverMaulik Mankad2-4/+8
This patch adds CONFIG_ARCH_OMAP4 macro within MUSB driver. Signed-off-by: Maulik Mankad <x0082077@ti.com> Cc: David Brownell <david-b@pacbell.net> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: Olof Johansson <olof@lixom.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: MUSB: Build MUSB driver for OMAP4Maulik Mankad2-1/+9
This patch updates the Makefile to build the MUSB driver for OMAP4. It also sets the Kconfig options for OMAP4. Signed-off-by: Maulik Mankad <x0082077@ti.com> Cc: David Brownell <david-b@pacbell.net> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: Olof Johansson <olof@lixom.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: Set transceiver interface typeMaulik Mankad6-7/+16
Program the OTG_INTERFSEL register based on transcevier type passed from board file. Adapt signature of musb_platform_init() function for davinci, blackfin and tusb6010. Signed-off-by: Maulik Mankad <x0082077@ti.com> Cc: David Brownell <david-b@pacbell.net> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: Olof Johansson <olof@lixom.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: allow board to pass down fifo modeFelipe Balbi2-20/+51
boards might want to optimize their fifo configuration to the particular needs of that specific board. Allow that by moving all related data structures to <linux/usb/musb.h> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb-serial: Use tty_port version console instead of usb_serial_portJason Wessel6-11/+8
Replace all instances of using the console variable in struct usb_serial_port with the struct tty_port version. CC: Alan Cox <alan@linux.intel.com> CC: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> CC: Andrew Morton <akpm@linux-foundation.org> CC: linux-usb@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ehci-au1xxx does not need EHCI IO watchdogManuel Lauss1-1/+10
I've been running variations of this patch for well over a year now; my usual zoo of test devices didn't trigger any ill effects even under heavy load. As a nice sideeffect idle-wakeups are reduced from 20/s to about 2/s (EHCI hub with mouse and kbd). Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: remove uses of URB_NO_SETUP_DMA_MAPAlan Stern13-75/+27
This patch (as1350) removes all usages of coherent buffers for USB control-request setup-packet buffers. There's no good reason to reserve coherent memory for these things; control requests are hardly ever used in large quantity (the major exception is firmware transfers, and they aren't time-critical). Furthermore, only seven drivers used it. We might as well always use streaming DMA mappings for setup-packet buffers, and remove some extra complexity from usbcore. The DMA-mapping portion of hcd.c is currently in flux. A separate patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP after everything else settles down. The removal should go smoothly, as by then nobody will be using it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: straighten out port feature vs. port status usageAlan Stern10-90/+89
This patch (as1349b) clears up the confusion in many USB host controller drivers between port features and port statuses. In mosty cases it's true that the status bit is in the position given by the corresponding feature value, but that's not always true and it's not guaranteed in the USB spec. There's no functional change, just replacing expressions of the form (1 << USB_PORT_FEAT_x) with USB_PORT_STAT_x, which has the same value. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: remove bogus USB_PORT_FEAT_*_SPEED symbolsAlan Stern8-27/+23
This patch (as1348) removes the bogus USB_PORT_FEAT_{HIGHSPEED,SUPERSPEED} symbols from ch11.h. No such features are defined by the USB spec. (There is a PORT_LOWSPEED feature, but the spec doesn't mention it except to say that host software should never use it.) The speed indicators are port statuses, not port features. As a temporary workaround for the xhci-hcd driver, a fictional USB_PORT_STAT_SUPER_SPEED symbol is added. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: remove duplicated #includeHuang Weiyi1-1/+0
Remove duplicated #include('s) in drivers/usb/core/hcd.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: Remove large struct from the stack in USB storage isd200 driverIan Munsie1-2/+2
The compiler throws the following warning when compiling for a PowerPC 64 bit machine: drivers/usb/storage/isd200.c:580: warning: the frame size of 2208 bytes is larger than 2048 bytes There is a struct scsi_device which is placed on the stack and is largely responsible for such wastage. The struct is just a dummy struct filled with NULLs and set as the scsi_cmnd->device to make the usb_stor_Bulk_transport function happy. This patch makes the struct static, so that it is never placed onto the stack and silences the compiler warning. Signed-off-by: Ian Munsie <imunsie@au.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>