1. 02 May, 2008 1 commit
    • Yoshihiro Shimoda's avatar
      USB: fix cannot work usb storage when using ohci-sm501 · e2722528
      Yoshihiro Shimoda authored
      When I used ohci-sm501, hcd_alloc_coherent() in map_urb_for_dma() is not
      called, because usb_sg_init() always sets URB_NO_TRANSFER_DMA_MAP.
      dmesg (CONFIG_USB_STORAGE_DEBUG enabled):
      usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6
      usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
      usb-storage: Status code 0; transferred 31/31
      usb-storage: -- transfer complete
      usb-storage: Bulk command transfer result=0
      usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries
      usb-storage: Status code -75; transferred 0/36
      usb-storage: -- babble
      usb-storage: Bulk data transfer result 0x3
      usb-storage: Attempting to get CSW...
      usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
      usb-storage: Status code 0; transferred 13/13
      usb-storage: -- transfer complete
      usb-storage: Bulk status result = 0
      usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
      usb-storage: scsi cmd done, result=0x2
      Signed-off-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  2. 24 Apr, 2008 3 commits
  3. 24 Mar, 2008 1 commit
  4. 01 Feb, 2008 2 commits
  5. 28 Nov, 2007 2 commits
    • Alan Stern's avatar
      USB: uevent environment key fix · 4a9bee82
      Alan Stern authored
      This patch (as1010) was written by both Kay Sievers and me.  It solves
      the problem of duplicated keys in USB uevent structures by refactoring
      the uevent subroutines, taking advantage of the way the hotplug core
      calls uevent handlers for the device's bus and for the device's type.
      Keys needed for both USB-device and USB-interface events are added in
      usb_uevent(), which is the bus handler.  Keys appropriate only for
      USB-device or USB-interface events are added in usb_dev_uevent() or
      usb_if_uevent() respectively, the type handlers.
      In addition, unnecessary tests for NULL pointers are removed as are
      duplicated debugging log statements.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: keep track of whether interface sysfs files exist · 7e61559f
      Alan Stern authored
      This patch (as1009) solves the problem of multiple registrations for
      USB sysfs files in a more satisfying way than the existing code.  It
      simply adds a flag to keep track of whether or not the files have been
      created; that way the files can be created or removed as needed.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
  6. 29 Oct, 2007 1 commit
  7. 25 Oct, 2007 1 commit
    • Alan Stern's avatar
      USB: fix interface sysfs file-creation bug · 439a903a
      Alan Stern authored
      This patch (as1005) fixes a rather subtle problem.  When
      usb_set_configuration() registers the interfaces and their files in
      sysfs, it doesn't expect those files to exist already.  But when an
      interface is registered, its driver may call usb_set_interface() and
      thereby cause the sysfs files to be created.  The result is an error
      when usb_set_configuration() goes on to create those same files again.
      The (not-so-great) solution is to have usb_set_configuration() remove
      any existing files before creating them.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  8. 23 Oct, 2007 1 commit
  9. 22 Oct, 2007 1 commit
  10. 18 Oct, 2007 1 commit
    • Joe Perches's avatar
      Add missing newlines to some uses of dev_<level> messages · 898eb71c
      Joe Perches authored
      Found these while looking at printk uses.
      Add missing newlines to dev_<level> uses
      Add missing KERN_<level> prefixes to multiline dev_<level>s
      Fixed a wierd->weird spelling typo
      Added a newline to a printk
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Mark M. Hoffman <mhoffman@lightlink.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Tilman Schmidt <tilman@imap.cc>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: James Smart <James.Smart@Emulex.Com>
      Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Jaroslav Kysela <perex@suse.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  11. 12 Oct, 2007 7 commits
    • Alan Stern's avatar
      USB: break apart flush_endpoint and disable_endpoint · 95cf82f9
      Alan Stern authored
      This patch (as988) breaks usb_hcd_endpoint_disable() apart into two
      routines.  The first, usb_hcd_flush_endpoint() does the -ESHUTDOWN
      unlinking of all URBs in the endpoint's queue and waits for them to
      complete.  The second, usb_hcd_disable_endpoint() -- renamed for
      better grammatical style -- merely calls the HCD's endpoint_disable
      method.  The changeover is easy because the routine currently has only
      one caller.
      This separation of function will be exploited in the following patch:
      When a device is suspended, the core will be able to cancel all
      outstanding URBs for that device while leaving the HCD's
      endpoint-related data structures intact for later.
      As an added benefit, HCDs no longer need to check for existing URBs in
      their endpoint_disable methods.  It is now guaranteed that there will
      be none.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: don't touch sysfs stuff when altsetting is unchanged · d74d4a69
      Alan Stern authored
      This patch (as955) prevents the interface-related sysfs files and
      endpoint pseudo-devices from being deleted and recreated when a call
      to usb_set_interface() specifies the current altsetting.  Since the
      altsetting doesn't get changed, there's no need to do anything.
      Furthermore, avoiding changes to the endpoint devices will be
      necessary in the future.  This code is called from usb_reset_device(),
      which gets invoked for reset-resume processing, but upcoming changes
      to the PM and driver cores will make it impossible to register devices
      while a suspend/resume transition is in progress.  Since we don't need
      to re-register those endpoint devices anyhow, it's best to skip the
      whole thing.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Greg Kroah-Hartman's avatar
      USB: make usb_release_interface static · b0e396e3
      Greg Kroah-Hartman authored
      No one else calls it, this makes sparse happy.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Inaky Perez-Gonzalez's avatar
      usb: usb_set_configuration() obeys authorization · 16bbab29
      Inaky Perez-Gonzalez authored
      Will refuse to configure a non-authorized device.
      Update: simplified if statement--thanks to Ragner Magalhaes for the
      heads up.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: avoid using urb->pipe in usbcore · 5e60a161
      Alan Stern authored
      This patch (as946) eliminates many of the uses of urb->pipe in
      usbcore.  Unfortunately there will have to be a significant API
      change, affecting all USB drivers, before we can remove it entirely.
      This patch contents itself with changing only the interface to
      usb_buffer_map_sg() and friends: The pipe argument is replaced with a
      direction flag.  That can be done easily because those routines get
      used in only one place.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: add ep->enable · bdd016ba
      Alan Stern authored
      This patch (as944) adds an explicit "enabled" field to the
      usb_host_endpoint structure and uses it in place of the current
      mechanism.  This is merely a time-space tradeoff; it makes checking
      whether URBs may be submitted to an endpoint simpler.  The existing
      mechanism is efficient when converting urb->pipe to an endpoint
      pointer, but it's not so efficient when urb->ep is used instead.
      As a side effect, the procedure for enabling an endpoint is now a
      little more complicated.  The ad-hoc inline code in usb.c and hub.c
      for enabling ep0 is now replaced with calls to usb_enable_endpoint,
      which is no longer static.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Kay Sievers's avatar
      Driver core: change add_uevent_var to use a struct · 7eff2e7a
      Kay Sievers authored
      This changes the uevent buffer functions to use a struct instead of a
      long list of parameters. It does no longer require the caller to do the
      proper buffer termination and size accounting, which is currently wrong
      in some places. It fixes a known bug where parts of the uevent
      environment are overwritten because of wrong index calculations.
      Many thanks to Mathieu Desnoyers for finding bugs and improving the
      error handling.
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  12. 22 Aug, 2007 2 commits
  13. 30 Jul, 2007 2 commits
  14. 19 Jul, 2007 1 commit
  15. 12 Jul, 2007 2 commits
    • Craig W. Nadler's avatar
      USB: add IAD support to usbfs and sysfs · 165fe97e
      Craig W. Nadler authored
      USB_IAD: Adds support for USB Interface Association Descriptors.
      This patch adds support to the USB host stack for parsing, storing, and
      displaying Interface Association Descriptors. In /proc/bus/usb/devices
      lines starting with A: show the fields in an IAD. In sysfs if an
      interface on a USB device is referenced by an IAD the following files
      will be added to the sysfs directory for that interface:
      iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and
      iad_bFunctionSubClass, iad_bFunctionProtocol
      Signed-off-by: default avatarCraig W. Nadler <craig@nadler.us>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: Fix off-by-1 error in the scatter-gather library · 8ccef0df
      Alan Stern authored
      The loop in usb_sg_wait() is structured in a way that makes it hard to
      tell, when the loop exits, whether or not the last URB submission
      succeeded.  This patch (as928) changes it from a "for" loop to a
      "while" loop and keeps "i" always equal to the number of successful
      submissions.  This fixes an off-by-one error which can show up when
      the first URB submission fails.
      The patch also removes a couple of lines that initialize fields which
      don't need to be initialized.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  16. 23 May, 2007 1 commit
  17. 27 Apr, 2007 3 commits
    • Tony Lindgren's avatar
      USB: Allow transfer_buffer with transfer_dma · 35d07fd5
      Tony Lindgren authored
      Some host controller drivers may need a PIO fallback when a DMA channel
      is temporarily unavailable.  This patch provides an address that such
      drivers can use for PIO in those cases, and nulls that field out when
      no such address is available (highmem) which should help usbmon.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Kay Sievers's avatar
      USB: make usbdevices export their device nodes instead of using a separate class · 9f8b17e6
      Kay Sievers authored
      o The "real" usb-devices export now a device node which can
        populate /dev/bus/usb.
      o The usb_device class is optional now and can be disabled in the
        kernel config. Major/minor of the "real" devices and class devices
        are the same.
      o The environment of the usb-device event contains DEVNUM and BUSNUM to
        help udev and get rid of the ugly udev rule we need for the class
      o The usb-devices and usb-interfaces share the same bus, so I used
        the new "struct device_type" to let these devices identify
        themselves. This also removes the current logic of using a magic
        The name of the device_type is also added to the environment
        which makes it easier to distinguish the different kinds of devices
        on the same subsystem.
        It looks like this:
      This udev rule works as a replacement for usb_device class devices:
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
          NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
      Updated patch, which needs the device_type patches in Greg's tree.
      I also got a bugzilla assigned for this. :)
      Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Greg Kroah-Hartman's avatar
      USB: remove use of the bus rwsem, as it doesn't really protect anything. · 341487a8
      Greg Kroah-Hartman authored
      The driver core stopped using the rwsem a long time ago, yet the USB
      core still grabbed the lock, thinking it protected something.  This
      patch removes that useless use.
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: linux-usb-devel <linux-usb-devel@lists.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  18. 09 Mar, 2007 1 commit
  19. 23 Feb, 2007 1 commit
  20. 16 Feb, 2007 1 commit
    • Alan Stern's avatar
      USB: unconfigure devices which have config 0 · 3f141e2a
      Alan Stern authored
      Some USB devices do have a configuration 0, in contravention of the
      USB spec.  Normally 0 is supposed to indicate that a device is
      While we can't change what the device is doing, we can change usbcore.
      This patch (as852) allows usb_set_configuration() to accept a config
      value of -1 as indicating that the device should be unconfigured.  The
      request actually sent to the device will still contain 0 as the value.
      But even if the device does have a configuration 0, dev->actconfig
      will be set to NULL and dev->state will be set to USB_STATE_ADDRESS.
      Without some sort of special-case handling like this, there is no way
      to unconfigure these non-compliant devices.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  21. 07 Feb, 2007 1 commit
  22. 07 Dec, 2006 1 commit
  23. 01 Dec, 2006 2 commits
  24. 22 Nov, 2006 1 commit