]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
14 years agoUSB: serial: reimplement generic fifo-based writes
Johan Hovold [Wed, 5 May 2010 21:57:37 +0000 (23:57 +0200)]
USB: serial: reimplement generic fifo-based writes

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: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: aircable: rewrite using generic read and write implementations
Johan Hovold [Wed, 5 May 2010 21:45:24 +0000 (23:45 +0200)]
USB: aircable: rewrite using generic read and write implementations

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: Naranjo, Manuel Francisco <naranjo.manuel@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: clean up SIO write support
Johan Hovold [Wed, 5 May 2010 21:45:01 +0000 (23:45 +0200)]
USB: ftdi_sio: clean up SIO write support

The original SIO devices require a control byte for every packet
written. Clean up the unnecessarily messy implementation of this.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: switch to generic write implementation
Johan Hovold [Wed, 5 May 2010 21:44:17 +0000 (23:44 +0200)]
USB: ftdi_sio: switch to generic write implementation

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: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: isp1760: Use resource_size
Tobias Klauser [Wed, 5 May 2010 09:18:41 +0000 (11:18 +0200)]
USB: isp1760: Use resource_size

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: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: simplify usb_sg_init()
Alan Stern [Wed, 5 May 2010 19:26:17 +0000 (15:26 -0400)]
USB: simplify usb_sg_init()

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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB gadget: Webcam device
Laurent Pinchart [Sun, 2 May 2010 18:57:42 +0000 (20:57 +0200)]
USB gadget: Webcam device

This webcam gadget instantiates a UVC camera (360p and 720p resolutions
in YUYV and MJPEG).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB gadget: video class function driver
Laurent Pinchart [Sun, 2 May 2010 18:57:41 +0000 (20:57 +0200)]
USB gadget: video class function driver

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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Change the scatterlist type in struct urb
Matthew Wilcox [Sat, 1 May 2010 18:20:01 +0000 (12:20 -0600)]
USB: Change the scatterlist type in struct urb

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: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Turn interface_to_usbdev into an inline function
Matthew Wilcox [Fri, 30 Apr 2010 19:11:30 +0000 (13:11 -0600)]
USB: Turn interface_to_usbdev into an inline function

The stronger type-checking would have prevented a bug I had.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Add a usb_pipe_endpoint() convenience function
Matthew Wilcox [Fri, 30 Apr 2010 19:11:29 +0000 (13:11 -0600)]
USB: Add a usb_pipe_endpoint() convenience function

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: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Add definition for the Pipe Usage descriptor
Matthew Wilcox [Fri, 30 Apr 2010 19:11:28 +0000 (13:11 -0600)]
USB: Add definition for the Pipe Usage descriptor

The Pipe Usage descriptor is needed for USB Attached SCSI

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: u132-hcd.c: fix shadows sparse warning
Bill Pemberton [Thu, 29 Apr 2010 14:04:56 +0000 (10:04 -0400)]
usb: u132-hcd.c: fix shadows sparse warning

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: sisusb_con.c: fix shadows sparse warning
Bill Pemberton [Wed, 28 Apr 2010 20:59:36 +0000 (16:59 -0400)]
usb: sisusb_con.c: fix shadows sparse warning

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: oti6858: declare send_data() as static
Bill Pemberton [Wed, 28 Apr 2010 20:59:35 +0000 (16:59 -0400)]
USB: oti6858: declare send_data() as static

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: whci: declare functions as static
Bill Pemberton [Wed, 28 Apr 2010 20:59:33 +0000 (16:59 -0400)]
USB: whci: declare functions as static

qset_print() was not declared static although it is not used
outside of debug.c

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: unusual-dev: Add bad sense flag for Appotech ax203 based picture frames
Hans de Goede [Thu, 29 Apr 2010 10:59:04 +0000 (12:59 +0200)]
USB: unusual-dev: Add bad sense flag for Appotech ax203 based picture frames

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: Hans de Goede <hdegoede@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: mxc: gadget: Fix bitfield for calculating maximum packet size
Dinh Nguyen [Tue, 4 May 2010 15:03:01 +0000 (10:03 -0500)]
USB: mxc: gadget: Fix bitfield for calculating maximum packet size

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: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-omap: fix Si version related programming
Ajay Kumar Gupta [Tue, 4 May 2010 07:45:23 +0000 (13:15 +0530)]
USB: ehci-omap: fix Si version related programming

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: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: ehci-omap: fix compilation warning
Ajay Kumar Gupta [Tue, 4 May 2010 14:23:09 +0000 (19:53 +0530)]
usb: ehci-omap: fix compilation warning

Fixes below compilation warning:
drivers/usb/host/ehci-hcd.c:425:
warning: 'ehci_port_power' defined but not used

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: qcaux: add Samsung U520 device ID
Dan Williams [Mon, 3 May 2010 20:41:01 +0000 (13:41 -0700)]
USB: qcaux: add Samsung U520 device ID

Another CDC-ACM + vendor specific interface layout.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: option: add PID for ZTE product
zhao1980ming [Sun, 2 May 2010 16:06:37 +0000 (00:06 +0800)]
USB: option: add PID for ZTE product

this patch adds ZTE modem devices

Signed-off-by: Joey <zhao.ming9@zte.com.cn>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Avoid double free after streams are disabled.
Sarah Sharp [Fri, 30 Apr 2010 22:37:56 +0000 (15:37 -0700)]
USB: xhci: Avoid double free after streams are disabled.

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: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Ramya Desai <ramya.desai@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: remove URB_NO_SETUP_DMA_MAP
Alan Stern [Fri, 30 Apr 2010 20:35:37 +0000 (16:35 -0400)]
USB: remove URB_NO_SETUP_DMA_MAP

Now that URB_NO_SETUP_DMA_MAP is no longer in use, this patch (as1376)
removes all references to it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: remove the usb_host_ss_ep_comp structure
Alan Stern [Fri, 30 Apr 2010 16:44:46 +0000 (12:44 -0400)]
USB: remove the usb_host_ss_ep_comp structure

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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: export the new ch11.h file to userspce
Alan Stern [Fri, 30 Apr 2010 16:42:23 +0000 (12:42 -0400)]
USB: export the new ch11.h file to userspce

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: Alan Stern <stern@rowland.harvard.edu>
Cc: Eric Lescouet <Eric.Lescouet@virtuallogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: remove leftover references to udev->autosuspend_disabled
Alan Stern [Fri, 30 Apr 2010 16:14:04 +0000 (12:14 -0400)]
USB: remove leftover references to udev->autosuspend_disabled

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: Alan Stern <stern@rowland.harvard.edu>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: g_hid: unregister platform driver on probe/usb_composite_register errors
Peter Korsgaard [Mon, 26 Apr 2010 08:05:06 +0000 (10:05 +0200)]
USB: g_hid: unregister platform driver on probe/usb_composite_register errors

Otherwise reloads will fail.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: mos7840: Cleanup useless header
Alessio Igor Bogani [Sun, 25 Apr 2010 10:52:02 +0000 (12:52 +0200)]
USB: mos7840: Cleanup useless header

BKL isn't anymore present into this file thus it is no necessary still include smp_lock.h.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: sisusbvga: Remove the BKL from open
Alessio Igor Bogani [Sun, 25 Apr 2010 10:37:10 +0000 (12:37 +0200)]
USB: sisusbvga: Remove the BKL from open

BKL is not needed here because necessary locking is already provided
by mutex sisusb->lock.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Mass storage gadget: Handle eject request
Fabien Chouteau [Mon, 26 Apr 2010 10:34:54 +0000 (12:34 +0200)]
USB: Mass storage gadget: Handle eject request

This patch adds handling of the "Start/Stop Unit" SCSI request
to simulate media ejection.

Signed-off-by: Fabien Chouteau <fabien.chouteau@barco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Composite framework: Add suspended sysfs entry
Fabien Chouteau [Fri, 23 Apr 2010 12:21:26 +0000 (14:21 +0200)]
USB: Composite framework: Add suspended sysfs entry

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: Fabien Chouteau <fabien.chouteau@barco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: clean up some host controller sparse warnings
Randy Dunlap [Mon, 19 Apr 2010 15:53:50 +0000 (08:53 -0700)]
USB: clean up some host controller sparse warnings

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: Randy 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: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: core: config.c: usb_get_configuration() simplified
Michal Nazarewicz [Sat, 17 Apr 2010 15:12:58 +0000 (17:12 +0200)]
USB: core: config.c: usb_get_configuration() simplified

usb_gat_configuratio() used two pointers to point to the same
memory.  Code simplified, by removing one of them.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ncm: added ncm.h with auxiliary definitions
Yauheni Kaliuta [Fri, 16 Apr 2010 13:13:35 +0000 (16:13 +0300)]
USB: ncm: added ncm.h with auxiliary definitions

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: cdc: ncm constants and structures added
Yauheni Kaliuta [Fri, 16 Apr 2010 13:13:34 +0000 (16:13 +0300)]
usb: cdc: ncm constants and structures added

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: usbserial: fix mos7720 dependencies
Randy Dunlap [Mon, 3 May 2010 17:07:25 +0000 (10:07 -0700)]
USB: usbserial: fix mos7720 dependencies

Fix mos7720 Kconfig dependencies.
When an enabled bool selects a tristate, the tristate becomes =y,
even if it should be limited to modular, so limit the bool kconfig
option to configs that will build cleanly.
Also change the if-block to a simple depends on.

drivers/built-in.o: In function `mos7720_release':
mos7720.c:(.text+0xad432): undefined reference to `parport_remove_port'
drivers/built-in.o: In function `mos7715_parport_init':
mos7720.c:(.text+0xae197): undefined reference to `parport_register_port'
mos7720.c:(.text+0xae210): undefined reference to `parport_announce_port'
drivers/built-in.o:(.data+0x201c8): undefined reference to `parport_ieee1284_read_nibble'
drivers/built-in.o:(.data+0x201d0): undefined reference to `parport_ieee1284_read_byte'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: usbserial: mos7720: cleanup, consolidation, replace send_mos_cmd with {read...
Mike Dunn [Thu, 15 Apr 2010 21:02:09 +0000 (17:02 -0400)]
USB: usbserial: mos7720: cleanup, consolidation, replace send_mos_cmd with {read,write}_mos_reg

No functionality added or bugs fixed, just improved code consistency and
(hopefully) readability by replacing send_mos_cmd with the register read & write
functions that were used for parallel port registers.  Also shortens overall
file length.

Thoroughly tested, with emphasis on regression testing the serial port.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: usbserial: mos7720: add support for parallel port on moschip 7715
Mike Dunn [Thu, 15 Apr 2010 21:01:33 +0000 (17:01 -0400)]
USB: usbserial: mos7720: add support for parallel port on moschip 7715

Add support for the parallel port on the moschip MCS7715 device.  The port
registers itself with the parport subsystem as a low-level driver.  A separate
entry to the kernel configuration is added beneath that for the mos7720, to
avoid the need to link with the parport subsystem code for users who don't have
or don't want the parallel port.  Only compatibility mode is currently supported
(no ECP/EPP).  Tested with both moschip devices (7720 and 7715) on UP and SMP
hosts, including regression testing of serial port, concurrent operation of
serial and parallel ports, and various connect / disconnect scenarios.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: staging: fix up usb_buffer_alloc calls in the staging tree
Greg Kroah-Hartman [Thu, 29 Apr 2010 22:36:29 +0000 (15:36 -0700)]
USB: staging: fix up usb_buffer_alloc calls in the staging tree

This renames the functions usb_buffer_alloc and usb_buffer_free to the correct
ones for the drivers in the staging tree.

Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: rename usb_buffer_alloc() and usb_buffer_free() users
Daniel Mack [Mon, 12 Apr 2010 11:17:25 +0000 (13:17 +0200)]
USB: rename usb_buffer_alloc() and usb_buffer_free() users

For more clearance what the functions actually do,

  usb_buffer_alloc() is renamed to usb_alloc_coherent()
  usb_buffer_free()  is renamed to usb_free_coherent()

They should only be used in code which really needs DMA coherency.

All call sites have been changed accordingly, except for staging
drivers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pedro Ribeiro <pedrib@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Short new 'graph for usb-serial.txt
Eric Raymond [Thu, 15 Apr 2010 05:35:50 +0000 (01:35 -0400)]
USB: Short new 'graph for usb-serial.txt

Documentation update

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: devices: fix Coding Styles
Carlos Sánchez Acosta [Wed, 14 Apr 2010 11:58:53 +0000 (06:58 -0500)]
USB: devices: fix Coding Styles

Fixed coding styles in the config usb driver.

Signed-off-by: Carlos Sánchez Acosta <csanchez@neurowork.net>
Signed-off-by: Alejandro Sánchez Acosta <asanchez@neurowork.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ueagle: fix Coding Styles
Javier Blanco de Torres (Neurowork) [Mon, 12 Apr 2010 07:21:13 +0000 (09:21 +0200)]
USB: ueagle: fix Coding Styles

Fixed coding styles in the ueagle usb driver.

Signed-off-by: Javier Blanco de Torres <jblanco@neurowork.net>
Signed-off-by: Alejandro Sánchez Acosta <asanchez@neurowork.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: omap: switch to subsys_initcall for isp1301 transceiver
Viral Mehta [Tue, 6 Apr 2010 06:21:00 +0000 (11:51 +0530)]
USB: omap: switch to subsys_initcall for isp1301 transceiver

isp1301 transceiver driver init should be done before we do ohci omap init

Signed-off-by: Viral Mehta <viral.mehta@lntinfotech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci: Elide I/O watchdog on NEC parts
David Miller [Wed, 7 Apr 2010 01:26:03 +0000 (18:26 -0700)]
USB: ehci: Elide I/O watchdog on NEC parts

I've been running with this patch on my Niagara2 boxes for some time
and have not seen any ill effects yet.  Maybe we can stash this into
the USB tree to get exposure for some time in -next and if anything
crops up we can simply revert?

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: storage: Remove unneeded SL11R unusual_devs entry
Phil Dibowitz [Sun, 4 Apr 2010 12:21:01 +0000 (14:21 +0200)]
USB: storage: Remove unneeded SL11R unusual_devs entry

It seems unlikely that this entry is needed anymore since the kernel
has logic to handle devices that poorly respond to INQUIRY. Since we
now have another entry with the same VID/PID but different flags, it's
a good time to attempt to clean this up.

The original submitter's email no longer works, so we'll keep an eye
out for any regression reports.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Support for allocating USB 3.0 streams.
Sarah Sharp [Mon, 5 Apr 2010 17:55:58 +0000 (10:55 -0700)]
USB: Support for allocating USB 3.0 streams.

Bulk endpoint streams were added in the USB 3.0 specification.  Streams
allow a device driver to overload a bulk endpoint so that multiple
transfers can be queued at once.

The device then decides which transfer it wants to work on first, and can
queue part of a transfer before it switches to a new stream.  All this
switching is invisible to the device driver, which just gets a completion
for the URB.  Drivers that use streams must be able to handle URBs
completing in a different order than they were submitted to the endpoint.

This requires adding new API to set up xHCI data structures to support
multiple queues ("stream rings") per endpoint.  Drivers will allocate a
number of stream IDs before enqueueing URBs to the bulk endpoints of the
device, and free the stream IDs in their disconnect function.  See
Documentation/usb/bulk-streams.txt for details.

The new mass storage device class, USB Attached SCSI Protocol (UASP), uses
these streams API.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Correct assumptions about number of rings per endpoint.
Sarah Sharp [Fri, 2 Apr 2010 22:34:43 +0000 (15:34 -0700)]
USB: xhci: Correct assumptions about number of rings per endpoint.

Much of the xHCI driver code assumes that endpoints only have one ring.
Now an endpoint can have one ring per enabled stream ID, so correct that
assumption.  Use functions that translate the stream_id field in the URB
or the DMA address of a TRB into the correct stream ring.

Correct the polling loop to print out all enabled stream rings.  Make the
URB cancellation routine find the correct stream ring if the URB has
stream_id set.  Make sure the URB enqueueing routine does the same.  Also
correct the code that handles stalled/halted endpoints.

Check that commands and registers that can take stream IDs handle them
properly.  That includes ringing an endpoint doorbell, resetting a
stalled/halted endpoint, and setting a transfer ring dequeue pointer
(since that command can set the dequeue pointer in a stream context or an
endpoint context).

Correct the transfer event handler to translate a TRB DMA address into the
stream ring it was enqueued to.  Make the code to allocate and prepare TD
structures adds the TD to the right td_list for the stream ring.  Make
sure the code to give the first TRB in a TD to the hardware manipulates
the correct stream ring.

When an endpoint stalls, store the stream ID of the stream ring that
stalled in the xhci_virt_ep structure.  Use that instead of the stream ID
in the URB, since an URB may be re-used after it is given back after a
non-control endpoint stall.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Add memory allocation for USB3 bulk streams.
Sarah Sharp [Fri, 2 Apr 2010 22:34:16 +0000 (15:34 -0700)]
USB: xhci: Add memory allocation for USB3 bulk streams.

Add support for allocating streams for USB 3.0 bulk endpoints.  See
Documentation/usb/bulk-streams.txt for more information about how and why
you would use streams.

When an endpoint has streams enabled, instead of having one ring where all
transfers are enqueued to the hardware, it has several rings.  The ring
dequeue pointer in the endpoint context is changed to point to a "Stream
Context Array".  This is basically an array of pointers to transfer rings,
one for each stream ID that the driver wants to use.

The Stream Context Array size must be a power of two, and host controllers
can place a limit on the size of the array (4 to 2^16 entries).  These
two facts make calculating the size of the Stream Context Array and the
number of entries actually used by the driver a bit tricky.

Besides the Stream Context Array and rings for all the stream IDs, we need
one more data structure.  The xHCI hardware will not tell us which stream
ID a transfer event was for, but it will give us the slot ID, endpoint
index, and physical address for the TRB that caused the event.  For every
endpoint on a device, add a radix tree to map physical TRB addresses to
virtual segments within a stream ring.

Keep track of whether an endpoint is transitioning to using streams, and
don't enqueue any URBs while that's taking place.  Refuse to transition an
endpoint to streams if there are already URBs enqueued for that endpoint.

We need to make sure that freeing streams does not fail, since a driver's
disconnect() function may attempt to do this, and it cannot fail.
Pre-allocate the command structure used to issue the Configure Endpoint
command, and reserve space on the command ring for each stream endpoint.
This may be a bit overkill, but it is permissible for the driver to
allocate all streams in one call and free them in multiple calls.  (It is
not advised, however, since it is a waste of resources and time.)

Even with the memory and ring room pre-allocated, freeing streams can
still fail because the xHC rejects the configure endpoint command.  It is
valid (by the xHCI 0.96 spec) to return a "Bandwidth Error" or a "Resource
Error" for a configure endpoint command.  We should never see a Bandwidth
Error, since bulk endpoints do not effect the reserved bandwidth.  The
host controller can still return a Resource Error, but it's improbable
since the xHC would be going from a more resource-intensive configuration
(streams) to a less resource-intensive configuration (no streams).

If the xHC returns a Resource Error, the endpoint will be stuck with
streams and will be unusable for drivers.  It's an unavoidable consequence
of broken host controller hardware.

Includes bug fixes from the original patch, contributed by
John Youn <John.Youn@synopsys.com> and Andy Green <AGreen@PLXTech.com>

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Add stream ID field to struct urb.
Sarah Sharp [Fri, 2 Apr 2010 22:34:10 +0000 (15:34 -0700)]
USB: Add stream ID field to struct urb.

Bulk endpoint streams were added in the USB 3.0 specification.  Streams
allow a device driver to overload a bulk endpoint so that multiple
transfers can be queued at once.

Add a new field, stream_id, to struct urb so that USB 3.0 drivers can
specify which stream they want the URB to be queued to.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Add parsing of SuperSpeed endpoint companion descriptor.
Sarah Sharp [Fri, 2 Apr 2010 22:33:56 +0000 (15:33 -0700)]
USB: Add parsing of SuperSpeed endpoint companion descriptor.

Allow the xHCI drivers (and any new USB 3.0 drivers) to parse the
SuperSpeed endpoint companion descriptor to find the maximum number of
bulk endpoint streams the endpoint supports.  This is used to calculate
the maximum total number of streams the driver can allocate.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: qcserial: Add support for Qualcomm Gobi 2000 devices
Anssi Hannula [Thu, 1 Apr 2010 16:31:10 +0000 (12:31 -0400)]
USB: qcserial: Add support for Qualcomm Gobi 2000 devices

Add ids for Qualcomm Gobi 2000 QDL and Modem modes. Gobi 2000 has a
single altsetting in QDL mode, so adapt code to handle that.

Firmware upload protocol is also slightly different, with an
additional firmware file. However, qcserial doesn't handle firmware
uploading.

Tested on Lenovo Thinkpad T510.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: qcserial: Use generic USB wwan code
Matthew Garrett [Thu, 1 Apr 2010 16:31:09 +0000 (12:31 -0400)]
USB: qcserial: Use generic USB wwan code

Make qcserial use the generic USB wwan code. This should result in a
performance improvement.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: option: Use generic USB wwan code
Matthew Garrett [Thu, 1 Apr 2010 16:31:08 +0000 (12:31 -0400)]
USB: option: Use generic USB wwan code

As this code was simply factored out of option, this is a simple
conversion.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb serial: Add generic USB wwan support
Matthew Garrett [Thu, 1 Apr 2010 16:31:07 +0000 (12:31 -0400)]
usb serial: Add generic USB wwan support

The generic USB serial code is ill-suited for high-speed USB wwan devices,
resulting in the option driver. However, other non-option devices may also
gain similar benefits from not using the generic code. Factorise out the
non-option specific code from the option driver and make it available to
other users.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: deprecate the power/level sysfs attribute
Alan Stern [Fri, 2 Apr 2010 17:22:16 +0000 (13:22 -0400)]
USB: deprecate the power/level sysfs attribute

This patch (as1367) deprecates USB's power/level sysfs attribute in
favor of the power/control attribute provided by the runtime PM core.
The two attributes do the same thing.

It would be nice to replace power/level with a symlink to
power/control, but at the moment sysfs doesn't offer any way to do so.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: use PM core routines to enable/disable autosuspend
Alan Stern [Fri, 2 Apr 2010 17:22:09 +0000 (13:22 -0400)]
USB: use PM core routines to enable/disable autosuspend

This patch (as1366) replaces the private routines
usb_enable_autosuspend() and usb_disable_autosuspend() with calls to
the standard pm_runtime_allow() and pm_runtime_forbid() functions in
the runtime PM framework.  They do the same thing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: don't enable remote wakeup by default
Alan Stern [Fri, 2 Apr 2010 17:21:33 +0000 (13:21 -0400)]
USB: don't enable remote wakeup by default

This patch (as1364) avoids enabling remote wakeup by default on all
non-root-hub USB devices.  Individual drivers or userspace will have
to enable it wherever it is needed, such as for keyboards or network
interfaces.  Note: This affects only system sleep, not autosuspend.

External hubs will continue to relay wakeup requests received from
downstream through their upstream port, even when remote wakeup is not
enabled for the hub itself.  Disabling remote wakeup on a hub merely
prevents it from generating wakeup requests in response to connect,
disconnect, and overcurrent events.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: improve runtime remote wakeup settings
Alan Stern [Fri, 2 Apr 2010 17:18:50 +0000 (13:18 -0400)]
USB: improve runtime remote wakeup settings

This patch (as1362) adjusts the way the USB autosuspend routines
handle remote-wakeup settings.  They aren't supposed to use
device_may_wakeup(); that test is intended only for system sleep, not
runtime power management.  Instead the code checks to see if any
interface drivers need remote wakeup; if they do then it is enabled,
provided the device is capable of it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: fix usbmon and DMA mapping for scatter-gather URBs
Alan Stern [Fri, 2 Apr 2010 17:27:28 +0000 (13:27 -0400)]
USB: fix usbmon and DMA mapping for scatter-gather URBs

This patch (as1368) fixes a rather obscure bug in usbmon: When tracing
URBs sent by the scatter-gather library, it accesses the data buffers
while they are still mapped for DMA.

The solution is to move the mapping and unmapping out of the s-g
library and into the usual place in hcd.c.  This requires the addition
of new URB flag bits to describe the kind of mapping needed, since we
have to call dma_map_sg() if the HCD supports native scatter-gather
operation and dma_map_page() if it doesn't.  The nice thing about
having the new flags is that they simplify the testing for unmapping.

The patch removes the only caller of usb_buffer_[un]map_sg(), so those
functions are #if'ed out.  A later patch will remove them entirely.

As a result of this change, urb->sg will be set in situations where
it wasn't set previously.  Hence the xhci and whci drivers are
adjusted to test urb->num_sgs instead, which retains its original
meaning and is nonzero only when the HCD has to handle a scatterlist.

Finally, even when a submission error occurs we don't want to hand
URBs to usbmon before they are unmapped.  The submission path is
rearranged so that map_urb_for_dma() is called only for non-root-hub
URBs and unmap_urb_for_dma() is called immediately after a submission
error.  This simplifies the error handling.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: pxa27x_udc: use four bits to store endpoint addresses
Matt Reimer [Thu, 1 Apr 2010 20:44:04 +0000 (13:44 -0700)]
USB: pxa27x_udc: use four bits to store endpoint addresses

Endpoint addresses on pxa27x can be programmed as 1-15, but since
only three bits were being used to store the endpoint number it
was possible to overflow.

Signed-off-by: Matt Reimer <mreimer@sdgsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: otg: twl4030: use the global ULPI register definitions
Heikki Krogerus [Wed, 31 Mar 2010 07:18:05 +0000 (10:18 +0300)]
usb: otg: twl4030: use the global ULPI register definitions

Rely on the global ULPI register definitions

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: otg: ulpi: use the global ULPI register definitions
Heikki Krogerus [Mon, 3 May 2010 06:13:02 +0000 (09:13 +0300)]
USB: otg: ulpi: use the global ULPI register definitions

Rely on the global ULPI register definitions

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: otg: add global ULPI register definitions
Heikki Krogerus [Mon, 3 May 2010 06:13:01 +0000 (09:13 +0300)]
usb: otg: add global ULPI register definitions

Definitions for registers defined by ULPI specification v1.1.

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: gadget: f_mass_storage: per function
Michal Nazarewicz [Mon, 29 Mar 2010 12:01:32 +0000 (14:01 +0200)]
USB: gadget: f_mass_storage: per function

Mass Storage Function (MSF) used the same descriptors for each
usb_function instance (meaning usb_function::descriptors of different
functions pointed to the same static area (the same was true for
usb_function::hs_descriptors)).

This would leads to problems if MSF were used in several USB
configurations with different interface and/or endpoint numbers.
Descriptors for all configurations would have interface/endpoint
numbers overwritten by the values valid for the last configuration.

This patch adds code that copies the descriptors each time MSF is
added to USB configuration (that is for each usb_function).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
14 years agousb: gadget: Allow larger configuration descriptors
Robert Lukassen [Tue, 30 Mar 2010 12:14:01 +0000 (14:14 +0200)]
usb: gadget: Allow larger configuration descriptors

The composite framework allows gadgets with more than one function. This
can lead to situations where the configuration descriptor is larger than
the maximum of 512 bytes currently allowed by the composite framework.
This patch proposes to double that limit to 1024.

Signed-off-by: Robert Lukassen <robert.lukassen@tomtom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: add ulpi access operations
Heikki Krogerus [Thu, 25 Mar 2010 11:25:28 +0000 (13:25 +0200)]
usb: musb: add ulpi access operations

This adds helper functions for ULPI access, and implements
otg_io_access_ops for musb.

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: Add extvbus in musb_board_data
Ajay Kumar Gupta [Thu, 25 Mar 2010 11:25:27 +0000 (13:25 +0200)]
usb: musb: Add extvbus in musb_board_data

EXTVBUS programming is required by OMAP3EVM REV >=E to supply 500mA
power so adding a flag which can be used by musb driver to program
EXTVBUS.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: Makefile: remove unexistent config option
Felipe Balbi [Thu, 25 Mar 2010 11:25:26 +0000 (13:25 +0200)]
usb: musb: Makefile: remove unexistent config option

Remove the unexistent CONFIG_USB_INVENTRA_MUSB_HAS_AHB_ID
option from our Makefile.

Problem reported by Sergei Shtylyov <sshtylyov@mvista.com>

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: omap2430.c: remove unnecessary includes
Anand Gadiyar [Thu, 25 Mar 2010 11:25:25 +0000 (13:25 +0200)]
usb: musb: omap2430.c: remove unnecessary includes

We don't need mach-types and hardware.h

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: omap2430: remove unused define
Anand Gadiyar [Thu, 25 Mar 2010 11:25:24 +0000 (13:25 +0200)]
usb: musb: omap2430: remove unused define

get_cpu_rev() is unused in this driver. It is probably legacy
code. So remove it.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoMUSB: Blackfin: remove musb_platform_{suspend|resume}()
Sergei Shtylyov [Thu, 25 Mar 2010 11:25:23 +0000 (13:25 +0200)]
MUSB: Blackfin: remove musb_platform_{suspend|resume}()

These functions do nothing and also are both unnecessarily 'extern'; actually,
musb_platform_resume() in not even called...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoMUSB: OMAP: make musb_platform_suspend() 'static'
Sergei Shtylyov [Thu, 25 Mar 2010 11:25:22 +0000 (13:25 +0200)]
MUSB: OMAP: make musb_platform_suspend() 'static'

This function is only called inside omap2430.c...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoMUSB: Blackfin: remove bfin_vbus_power()
Sergei Shtylyov [Thu, 25 Mar 2010 11:25:21 +0000 (13:25 +0200)]
MUSB: Blackfin: remove bfin_vbus_power()

This function does nothing...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoMUSB: OMAP: remove omap_vbus_power()
Sergei Shtylyov [Thu, 25 Mar 2010 11:25:20 +0000 (13:25 +0200)]
MUSB: OMAP: remove omap_vbus_power()

This function does nothing...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: support host/gadget role switching on Blackfin parts
Cliff Cai [Thu, 25 Mar 2010 11:25:19 +0000 (13:25 +0200)]
USB: musb: support host/gadget role switching on Blackfin parts

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>
14 years agousb: musb: debugfs: musb_exit_debugfs() can be called on probe
Felipe Balbi [Thu, 25 Mar 2010 11:25:18 +0000 (13:25 +0200)]
usb: musb: debugfs: musb_exit_debugfs() can be called on probe

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>
14 years agoUSB: option.c: option_indat_callback: Resubmit some unsuccessful URBs
James Maki [Sun, 21 Mar 2010 17:53:59 +0000 (12:53 -0500)]
USB: option.c: option_indat_callback: Resubmit some unsuccessful URBs

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>
14 years agoUSB: gadget: add HID gadget driver
Fabien Chouteau [Thu, 8 Apr 2010 07:31:15 +0000 (09:31 +0200)]
USB: gadget: add HID gadget driver

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>
14 years agoUSB: ftdi_sio: fix some coding style issues
Johan Hovold [Wed, 17 Mar 2010 22:06:09 +0000 (23:06 +0100)]
USB: ftdi_sio: fix some coding style issues

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>
14 years agoUSB: serial: generalise write buffer preparation
Johan Hovold [Wed, 17 Mar 2010 22:06:08 +0000 (23:06 +0100)]
USB: serial: generalise write buffer preparation

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>
14 years agoUSB: serial: re-implement multi-urb writes in generic driver
Johan Hovold [Wed, 17 Mar 2010 22:06:07 +0000 (23:06 +0100)]
USB: serial: re-implement multi-urb writes in generic driver

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>
14 years agoUSB: serial: allow custom multi-urb write bulk callbacks
Johan Hovold [Wed, 17 Mar 2010 22:06:06 +0000 (23:06 +0100)]
USB: serial: allow custom multi-urb write bulk callbacks

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>
14 years agoUSB: usb_debug: use the generic kfifo-based write implementation
Johan Hovold [Wed, 17 Mar 2010 22:06:05 +0000 (23:06 +0100)]
USB: usb_debug: use the generic kfifo-based write implementation

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>
14 years agoUSB: pl2303: use generic close
Johan Hovold [Wed, 17 Mar 2010 22:06:04 +0000 (23:06 +0100)]
USB: pl2303: use generic close

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>
14 years agoUSB: pl2303: switch to generic write implementation
Johan Hovold [Wed, 17 Mar 2010 22:06:03 +0000 (23:06 +0100)]
USB: pl2303: switch to generic write implementation

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>
14 years agoUSB: serial: clean up generic write start busy test
Johan Hovold [Wed, 17 Mar 2010 22:06:02 +0000 (23:06 +0100)]
USB: serial: clean up generic write start busy test

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>
14 years agoUSB: serial: clean up some error and debug messages in generic driver
Johan Hovold [Wed, 17 Mar 2010 22:06:01 +0000 (23:06 +0100)]
USB: serial: clean up some error and debug messages in generic driver

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>
14 years agoUSB: ftdi_sio: switch to generic read implementation
Johan Hovold [Wed, 17 Mar 2010 22:06:00 +0000 (23:06 +0100)]
USB: ftdi_sio: switch to generic read implementation

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>
14 years agoUSB: serial: export generic throttle and unthrottle
Johan Hovold [Wed, 17 Mar 2010 22:05:59 +0000 (23:05 +0100)]
USB: serial: export generic throttle and unthrottle

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>
14 years agoUSB: pl2303: switch to generic read implementation
Johan Hovold [Wed, 17 Mar 2010 22:05:58 +0000 (23:05 +0100)]
USB: pl2303: switch to generic read implementation

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>
14 years agoUSB: serial: generalise generic read implementation
Johan Hovold [Wed, 17 Mar 2010 22:05:57 +0000 (23:05 +0100)]
USB: serial: generalise generic read implementation

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>
14 years agoUSB: serial: clean up read processing in generic driver
Johan Hovold [Wed, 17 Mar 2010 22:05:56 +0000 (23:05 +0100)]
USB: serial: clean up read processing in generic driver

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>
14 years agoUSB: cp210x: use generic submit_read_urb at open
Johan Hovold [Wed, 17 Mar 2010 22:05:55 +0000 (23:05 +0100)]
USB: cp210x: use generic submit_read_urb at open

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>
14 years agoUSB: serial: remove unnecessary re-initialisation of generic urbs
Johan Hovold [Wed, 17 Mar 2010 22:05:54 +0000 (23:05 +0100)]
USB: serial: remove unnecessary re-initialisation of generic urbs

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>
14 years agoUSB: serial: refactor read urb submission in generic driver
Johan Hovold [Wed, 17 Mar 2010 22:05:53 +0000 (23:05 +0100)]
USB: serial: refactor read urb submission in generic driver

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>
14 years agoUSB: serial: refactor generic close
Johan Hovold [Wed, 17 Mar 2010 22:00:45 +0000 (23:00 +0100)]
USB: serial: refactor generic close

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>
14 years agoUSB: serial: clear fifo on close
Johan Hovold [Wed, 17 Mar 2010 22:00:44 +0000 (23:00 +0100)]
USB: serial: clear fifo on close

Make sure fifo is emptied on close.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: serial: fix missing locking on fifo in write callback
Johan Hovold [Wed, 17 Mar 2010 22:00:43 +0000 (23:00 +0100)]
USB: serial: fix missing locking on fifo in write callback

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>