Commit Graph

3981 Commits

Author SHA1 Message Date
Oliver Neukum a2bfb4a346 USB: support for cdc-acm of single interface devices
This implement support in cdc-acm for acm devices another popular OS can handle

- adds support for autodetection of devices that use one interface
- autodetection of endpoints
- add a quirk for surpressing a setting that OS doesn't use
- autoassume that quirk for single interface devices

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Andrew Morton 0b10395ab8 + drivers-usb-serial-sierrac-fix-printk-warning.patch added to -mm tree
drivers/usb/serial/sierra.c: In function 'sierra_write':
drivers/usb/serial/sierra.c:375: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Elina Pasheva <epasheva@sierrawireless.com>
Cc: Rory Filer <rfiler@SierraWireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Daniel Mack 1e0abb7e18 USB: imx_udc: fix leak in imx_ep_alloc_request()
cppcheck found another leak in drivers/usb/gadget/imx_udc.c

Cc: Mike Lee <eemike@gmail.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Kay Sievers 5512966643 usb: convert endpoint devices to bus-less childs of the usb interface
The endpoint devices look like simple attribute groups now, and no longer
like devices with a specific subsystem. They will also no longer emit uevents.

It also removes the device node requests for endpoint devices, which are not
implemented for now.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Elina Pasheva 9636b68376 USB: serial: sierra driver sierra_calc_num_ports() fix
- Removed potential kernel oops from sierra_calc_num_ports() function.
  Calling this function twice would likely have caused an oops because
  the function releases allocated memory after the first call.
- Modified sierra_probe() function to reflect the changes in
  sierra_calc_num_ports().

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Elina Pasheva c76a23da8e USB: serial: sierra driver interrupt urb resubmit fix
- Fixed a problem when re-submitting urb from interrupt callback in
  function sierra_instat_callback(). This suppresses also issuing of
  error messages in /var/log/kern.log
- Removed redundant debug message at the beginning of
  sierra_instat_callback() function
- Changed a debug message to be an error message

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Elina Pasheva 238ebd138c USB: serial: sierra driver zero length packet fix
- Fixed a problem with transferring packets with size a multiple of Bulk
  Xfer size in function sierra_write(). Added transfer flag
  URB_ZERO_PACKET before submitting the urb to trigger Zero-length data
  transfer when packet size is a multiple of Bulk Xfer.

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Jason Wessel 72fda3ca6f USB: serial: ftd_sio: implement sysrq handling on break
Change driver to make use of the new functions in
include/linux/usb/serial.h so as to allow the driver to handle the
sysrq

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Jason Wessel 98fcb5f781 USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial break
The usb_debug driver was modified to implement serial break handling
by using a "magic" data packet comprised of the sequence:

       0x00 0xff 0x01 0xfe   0x00 0xfe 0x01 0xff

When the tty layer requests a serial break the usb_debug driver sends
the magic packet.  On the receiving side the magic packet is thrown
away or a sysrq is activated depending on what kernel .config options
have been set.

The generic serial driver was modified as well as the usb serial
headers to generically implement sysrq processing in the same way the
non usb uart based drivers implement the sysrq handling.  This will
allow other usb serial devices to implement sysrq handling as desired.

The new usb serial functions are named similarly and implemented
similarly to the uart functions as follows:

usb_serial_handle_break <-> uart_handle_break
usb_serial_handle_sysrq_char <-> uart_handle_sysrq_char

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Jason Wessel 87c1edd217 USB: serial: ftd_sio usb: move status check
Alan Stern commented that the private driver counts must be updated
regard less of the status return on the urb when the write call back
is executed.

This patch alters the behavior to update the private driver counts by
simply moving the status check to after the driver count update.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Jason Wessel 715b1dc01f USB: usb_debug, usb_generic_serial: implement multi urb write
The usb_debug driver, when used as the console, will always fail to
insert the carriage return and new line sequence as well as randomly
drop console output.  This is a result of only having the single
write_urb and that the tty layer will have a lock that prevents the
processing of the back to back urb requests.

The solution is to allow more than one urb to be outstanding and have
a slightly deeper transmit queue.  The idea and some code is borrowed
from the ftdi_sio usb driver.

The generic usb serial driver was modified so as to allow the classic
method of 1 write urb, or a multi write urb scheme with N allowed
outstanding urbs where N is controlled by max_in_flight_urbs.  When
max_in_flight_urbs in a "struct usb_serial_driver" is non zero the
multi write urb scheme will be used.

The size of 4000 was selected for the usb_debug driver so that the
driver lowers possibility of losing the queued console messages during
the kernel startup.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Elina Pasheva b0cda8c5f7 USB: serial: sierra driver read path bug fix
This patch fixes a problem in function sierra_indat_callback() which
would stop receiving traffic from a modem if a number of URB failures
occur.  Failed URBs are not resubmitted for the next read and there is
only a limited number of URBs allocated for the IN path. After this
number of failures, the receive path stops working on a particular
interface.

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
2009-06-15 21:44:45 -07:00
Elina Pasheva 40d2ff32f1 USB: serial: sierra driver write path improvements
- Updated Copyright notice with new authors names
 - Version number set to 1.3.6
 - Added a MAX_TRANSFER constant following Greg Kroah-Hartman's
   recommended setting of PAGE_SIZE-512 for USB transfer buffers and
   modified accordingly sierra_write() function.

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:45 -07:00
Pete Zaitcev e05b8e6e10 USB: janitor storage initializers
We all know that pointless janitoring is bad, but this code is just
offensive. So:

- The error code goes directly to probe return, so don't return -1.
- Don't return return internal usb-storage codes either.
- usb_stor_control_msg takes timeout in milliseconds.
- Sanitize messages.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Paul Mundt 5700f4c551 wusb: hwa-hc: Drop unused pci_suspend/resume hooks.
CC      drivers/usb/host/hwa-hc.o
drivers/usb/host/hwa-hc.c:601: warning: initialization from incompatible pointer type
drivers/usb/host/hwa-hc.c:602: warning: initialization from incompatible pointer type

The prototype for these changed, so the message itself was dropped. As the only
thing these hooks were doing was printing out the message for debugging, there
is not much point in keeping them around. So, just kill them off.

Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Hermann Kneissel b4072f46e5 USB: garmin_gps: removes usb_reset_device from garmin_close
The following patch removes the call to usb_reset_device which may occur
when closing the driver by implementing a new session initialization
code based on the method used by gpsbabel.

The patch is against  linux-2.6.30-rc3-git1.

Signed-off-by: Hermann Kneissel herkne@users.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Richard Laager 9685a59a2b USB: Identify Novatel MC760 in option driver
Identify the Novatel MC760/U760/USB760 in the option USB serial driver.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Alan Stern 6ec4beb5c7 USB: new flag for resume-from-hibernation
This patch (as1237) changes the way the PCI host controller drivers
avoid retaining bogus hardware states during resume-from-hibernation.
Previously we had reset the hardware as part of preparing to reinstate
the memory image.  But we can do better now with the new PM framework,
since we know exactly which resume operations are from hibernation.

The pci_resume method is changed to accept a flag indicating whether
the system is resuming from hibernation.  When this flag is set, the
drivers will reset the hardware to get rid of any existing state.

Similarly, the pci_suspend method is changed to remove the
pm_message_t argument.  It's no longer needed, since no special action
has to be taken when preparing to reinstate the memory image.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Alan Stern abb306416a USB: move PCI host controllers to new PM framework
This patch (as1236) converts the USB PCI power management routines
over to the new PM framework.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Alan Stern 604eb89ffe USB: g_file_storage: use the "unaligned" accessors
This patch (as1233) makes g_file_storage use the "unaligned" accessors.
This is based on work originally done by Harvey Harrison.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Elina Pasheva 5d44b36120 USB: serial: sierra driver debug info visibility improvement
- Version number set to 1.3.5
 - Added "\n" at the end of each string in dev_dbg() code to improve the debug
   information visibility. Without this change the debug logs are very
   difficult to read.

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Elina Pasheva b748bb71b5 USB: serial: sierra driver performance improvements
- Version number set to 1.3.4
 - Increased the number of input/output URBs for improved performance
   (numbers based on an measurement study triggered by a user request).
   We performed the testing using a network simulator that provided full
   speeds in the uplink and downlink directions and this combination of
   URBs provided the best throughput.

Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:44 -07:00
Greg Kroah-Hartman 820d7a253c USB: remove unused usb_host class
The usb_host class isn't used for anything anymore (it was used for
debug files, but they have moved to debugfs a few kernel releases ago),
so let's delete it before someone accidentally puts a file in it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman ed14f0340a USB: EHCI: create sysfs companion files directly in the controller device
The controller device is where we want this sysfs file, especially as
the dev pointer is about to go away...

Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman 109833417c USB: OHCI: use the ohci structure directly in debugfs files.
Right now we jump through some hoops to get to the struct ohci_hcd
struct in the ohci debugfs files.  Remove all of the fun casting around
and just use the pointer directly.

This is needed as the dev pointer in the hcd structure is going away,
and it makes the code simpler and smaller

Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Alan Stern 74675a5850 NLS: update handling of Unicode
This patch (as1239) updates the kernel's treatment of Unicode.  The
character-set conversion routines are well behind the current state of
the Unicode specification: They don't recognize the existence of code
points beyond plane 0 or of surrogate pairs in the UTF-16 encoding.

The old wchar_t 16-bit type is retained because it's still used in
lots of places.  This shouldn't cause any new problems; if a
conversion now results in an invalid 16-bit code then before it must
have yielded an undefined code.

Difficult-to-read names like "utf_mbstowcs" are replaced with more
transparent names like "utf8s_to_utf16s" and the ordering of the
parameters is rationalized (buffer lengths come immediate after the
pointers they refer to, and the inputs precede the outputs).
Fortunately the low-level conversion routines are used in only a few
places; the interfaces to the higher-level uni2char and char2uni
methods have been left unchanged.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Clemens Ladisch a853a3d4eb usb: return device strings in UTF-8
Change the encoding of strings returned by usb_string() from ISO 8859-1
to UTF-8.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman 97d7b7a41b USB: add the usbfs devices file to debugfs
People are very used to the devices file in usbfs.  Now that we have
moved usbfs to be an "embedded" option only, the developers miss the
file, they had grown quite attached to it over all of these years.  This
patch brings it back and puts it in the usb debugfs directory, so that
the developers don't feel sad anymore.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman f49ce96f11 USB: usbmon: use the new usb debugfs directory
All usb debugfs files should be behind the usb directory, not at the
root of debugfs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman ec20df2e89 USB: UHCI: use the new usb debugfs directory
All usb debugfs files should be behind the usb directory, not at the
root of debugfs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman 485f4f3975 USB: OHCI: use the new usb debugfs directory
All usb debugfs files should be behind the usb directory, not at the
root of debugfs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman 66536ab368 USB: FHCI: use the new usb debugfs directory
All usb debugfs files should be behind the usb directory, not at the
root of debugfs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:43 -07:00
Greg Kroah-Hartman 08f4e586b9 USB: EHCI: use the new usb debugfs directory
All usb debugfs files should be behind the usb directory, not at the
root of debugfs.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Greg Kroah-Hartman 00048b8bde USB: add usb debugfs directory
Add a common usb directory in debugfs that the usb subsystem can use.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Tony Cook 84fe6e799d USB: mos7840: fix debug log messages
This patch removes all the unnecessary "\n"s that the debug print
statements have, which result in everything appearing double spaced
and unreadable in the logs.

Signed-off-by: Tony Cook <tony-cook@bigpond.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
H Hartley Sweeten d0f830d30c USB: hub.c: fix sparse warnings
Fix sparse warning in drivers/usb/core/hub.c.

The following sparse warning is seen when building on ARM due
do the macro raw_local_irq_save():

	warning: symbol 'temp' shadows an earlier one

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
H Hartley Sweeten 96f90a8b0d USB: host/ohci-hcd.c: fix sparse warnings
Fix sparse warnings in drivers/usb/host/ohci-hcd.c.

Four of the following sparse warning are seen when building on
ARM due do the macro raw_local_irq_save():

	warning: symbol 'temp' shadows an earlier one

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Robert Jarzmik 367815eea4 USB: pxa27x_udc: single-thread setup requests
Since the PXA 27x UDC automatically ACK's some control
packets such as SET_INTERFACE, the gadgets may not get a
chance to process the request before another control packet
is received. The Linux gadgets do not expect to receive
setup callbacks out of order. The file storage gadget only
saves the "highest" priority request.

The PXA27x UDC driver must make sure it only sends one up at
a time, allowing the gadget to make changes before
continuing. In theory, the host would be NACK'd while the
gadget processes the change but the UDC has already ACK'd
the request. If another request is sent by the host that is
not automatically ACK'd by the UDC, then the throttling
happens properly to regain sync.

The observed case was the file_storage gadget timing out on
a BulkReset request because the SET_INTERFACE was being
processed by the gadget. Since SET_INTERFACE is higher
priority than BulkReset, the BulkReset was dropped.  This
was exacerbated by turning on the debug which delayed the
fsg signal processing thread.

This also fixes the "should never get in
WAIT_ACK_SET_CONF_INTERF state here!!!" warning.

Reported-by: Vernon Sauder <vernoninhand@gmail.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

index 51790b0..1937d8c 100644
2009-06-15 21:44:42 -07:00
Robert Jarzmik 9f5351b743 USB: pxa27x_udc: compatibility with pxa320 SoC
Got pxa27x_udc working on the pxa320 Nomad platform.  The
problem was that the pxa3xx UDC is not quite compatible with
the pxa27x UDC in how it handles back-to-back control
packets.  The pxa27x probably drops them by default, but the
pxa320 does not, and you have to detect it and set the OPC
bit to clear the zero-length packet.

Signed-off-by: Aric Blumer <aric@sdgsystems.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
David Brownell f6d529f936 USB: pxa27x_udc: introduce pxa27x_clear_otgph()
Follow pxa27x change in OTGPH handling, and use the newly
defined pxa27x_clear_otgph().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Eric Miao <eric.miao@marvell.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2009-06-15 21:44:42 -07:00
Matthias Kaehlcke 1eba67a60d USB: UHCI queue: use usb_endpoint_type()
use usb_endpoint_type() instead of fiddling manually with bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Matthias Kaehlcke fa4c86a0dd USB: gadgetfs: use helper functions to determine endpoint type and direction
Use helper functions to determine the type and direction of an endpoint
instead of fiddling with bEndpointAddress and bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Matthias Kaehlcke 9ab1565151 USB: Goku-S: use helper functions to determine endpoint type and direction
Use helper functions to determine the type and direction of an endpoint
instead of fiddling with bEndpointAddress and bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Matthias Kaehlcke 81c8d8d28d USB: at91_udc: use helper functions to determine endpoint type and direction
Use helper functions to determine the type and direction of an endpoint
instead of fiddling with bEndpointAddress and bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:42 -07:00
Matthias Kaehlcke 71de6b63f1 USB: atmel_usba_udc: use helper functions to determine endpoint type and direction
Use helper functions to determine the type and direction of an endpoint
instead of fiddling with bEndpointAddress and bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00
Matthias Kaehlcke 15739bb502 USB: ci13xxx_udc: use helper functions to determine endpoint type and direction
Use helper functions to determine the type and direction of an endpoint
instead of fiddling with bEndpointAddress and bmAttributes

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00
H Hartley Sweeten a864e3aa5d USB: core/sysfs: fix sparse warnings
Fix 3 sparse warning in drivers/usb/core/sysfs.c.

	warning: symbol '__mptr' shadows an earlier one

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00
Pascal Terjan c5be1b52d9 USB: Ignore storage device in modem mode on DWN-652
D-Link DWN-652 in Modem mode exposes 3 interfaces
- First one is the USB storage one
- Second one is for both control and connection
- Third one is unknown

This patch avoids usb-storage trying to switch again when already in
modem mode, and exposes only 2 ttyUSB instead of 3 by not attaching
to the storage interface

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00
Scott James Remnant cc71329b3b USB: usbfs: deprecate and hide option for !embedded
Modern systems do not use usbfs; the entries within it are files,
not device nodes, and do not support ACLs which are the default way to
provide access to USB devices to untrusted users.

It is replaced by device-nodes maintained by udev in /dev/bus/usb,
libusb uses this device nodes.

Mark the option as deprecated, and hide entirely for non-embedded builds
(which may not be using udev but require raw USB device access).

Signed-off-by: Scott James Remnant <scott@canonical.com>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00
Alan Stern 91f8d063d3 USB: consolidate usb_unbind_interface and usb_driver_release_interface
This patch (as1230) consolidates code in usb_unbind_interface() and
usb_driver_release_interface().  In fact, it makes release_interface
call unbind_interface, thereby removing the need for duplicated code.

It works like this: If the interface has already been registered with
the driver core when a driver releases it, then the usual driver-core
mechanism will call unbind_interface.  If it hasn't been unregistered
then we will make the call ourselves.

As a nice bonus, drivers now don't have to worry about whether their
disconnect method will get called when they release an interface -- it
always will.  Previously it would be called only if the interface was
registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-15 21:44:41 -07:00