1. 24 Apr, 2008 7 commits
  2. 04 Mar, 2008 1 commit
  3. 03 Mar, 2008 1 commit
  4. 01 Feb, 2008 3 commits
  5. 17 Dec, 2007 1 commit
  6. 28 Nov, 2007 1 commit
  7. 12 Oct, 2007 11 commits
    • Alan Stern's avatar
      USB: skip autosuspended devices during system resume · 271f9e68
      Alan Stern authored
      System suspends and hibernation are supposed to be as transparent as
      possible.  By this reasoning, if a USB device is already autosuspended
      before the system sleep begins then it should remain autosuspended
      after the system wakes up.
      This patch (as1001) adds a skip_sys_resume flag to the usb_device
      structure and uses it to avoid waking up devices which were suspended
      when a system sleep began.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Sarah Sharp's avatar
      USB: Export URB statistics for powertop · 4d59d8a1
      Sarah Sharp authored
      powertop currently tracks interrupts generated by uhci, ehci, and ohci,
      but it has no way of telling which USB device to blame USB bus activity on.
      This patch exports the number of URBs that are submitted for a given device.
      Cat the file 'urbnum' in /sys/bus/usb/devices/.../
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: flush outstanding URBs when suspending · 6840d255
      Alan Stern authored
      This patch (as989) makes usbcore flush all outstanding URBs for each
      device as the device is suspended.  This will be true even when
      CONFIG_USB_SUSPEND is not enabled.
      In addition, an extra can_submit flag is added to the usb_device
      structure.  That flag will be turned off whenever a suspend request
      has been received for the device, even if the device isn't actually
      suspended because CONFIG_USB_SUSPEND isn't set.
      It's no longer necessary to check for the device state being equal to
      USB_STATE_SUSPENDED during URB submission; that check can be replaced
      by a check of the can_submit flag.  This also permits us to remove
      some questionable references to the deprecated power.power_state field.
      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: get rid of urb->lock · 1431d2a4
      Alan Stern authored
      Now that urb->status isn't used, urb->lock doesn't protect anything.
      This patch (as980) removes it and replaces it with a private mutex in
      the one remaining place it was still used: usb_kill_urb.
      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 urb->unlinked field · eb231054
      Alan Stern authored
      This patch (as970) adds a new urb->unlinked field, which is used to
      store the status of unlinked URBs since we can't use urb->status for
      that purpose any more.  To help simplify the HCDs, usbcore will check
      urb->unlinked before calling the completion handler; if the value is
      set it will automatically override the status reported by the HCD.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      CC: Tony Olech <tony.olech@elandigitalsystems.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Inaky Perez-Gonzalez's avatar
      usb: introduce usb_device authorization bits · da04b7a4
      Inaky Perez-Gonzalez authored
      This just modifies 'struct usb_device' to contain the 'authorized'
      bit. It also adds a 'wusb' bit. This is needed because nonauthorized
      (and thus non-authenticated) wusb devices will fail certain kind of
      simple requests (such as string descriptors). By knowing the device is
      WUSB, we just avoid them.
      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: cleanup for previous patches · d617bc83
      Alan Stern authored
      This patch (as951) cleans up a few loose ends from earlier patches.
      Redundant checks for non-NULL urb->dev are removed, as are checks of
      urb->dev->bus (which can never be NULL).  Conversely, a check for
      non-NULL urb->ep is added to the unlink paths.
      A homegrown round-down-to-power-of-2 loop is simplified by using the
      ilog2 routine.  The comparison in usb_urb_dir_in() is made more
      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: 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 direction bit to urb->transfer_flags · fea34091
      Alan Stern authored
      This patch (as945) adds a bit to urb->transfer_flags for recording the
      direction of the URB.  The bit is set/cleared automatically in
      usb_submit_urb() so drivers don't have to worry about it (although as
      a result, it isn't valid until the URB has been submitted).  Inline
      routines are added for easily checking an URB's direction.  They
      replace calls to usb_pipein in the DMA-mapping parts of hcd.c.
      For non-control endpoints, the direction is determined directly from
      the endpoint descriptor.  However control endpoints are
      bi-directional; for them the direction is determined from the
      bRequestType byte and the wLength value in the setup packet.
      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>
    • Alan Stern's avatar
      USB: add urb->ep · 5b653c79
      Alan Stern authored
      This patch (as943) prepares the way for eliminating urb->pipe by
      introducing an endpoint pointer into struct urb.  For now urb->ep
      is set by usb_submit_urb() from the pipe value; eventually drivers
      will set it themselves and we will remove urb->pipe completely.
      The patch also adds new inline routines to retrieve an endpoint
      descriptor's number and transfer type, essentially as replacements for
      usb_pipeendpoint and usb_pipetype.
      usb_submit_urb(), usb_hcd_submit_urb(), and usb_hcd_unlink_urb() are
      converted to use the new field and new routines.  Other parts of
      usbcore will be converted in later patches.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  8. 30 Jul, 2007 1 commit
  9. 12 Jul, 2007 7 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>
    • Marcel Holtmann's avatar
      USB: Add URB_FREE_BUFFER flag and the logic behind it · 8b3b01c8
      Marcel Holtmann authored
      USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer
      In some cases it is not needed that the driver keeps track of the
      transfer buffer of an URB. It can be simply freed along with the
      URB itself when the reference count goes down to zero. The new
      flag URB_FREE_BUFFER enables this behavior.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: add power/persist device attribute · b41a60ec
      Alan Stern authored
      This patch (as920) adds an extra level of protection to the
      USB-Persist facility.  Now it will apply by default only to hubs; for
      all other devices the user must enable it explicitly by setting the
      power/persist device attribute.
      The disconnect_all_children() routine in hub.c has been removed and
      its code placed inline.  This is the way it was originally as part of
      hub_pre_reset(); the revised usage in hub_reset_resume() is
      sufficiently different that the code can no longer be shared.
      Likewise, mark_children_for_reset() is now inline as part of
      hub_reset_resume().  The end result looks much cleaner than before.
      The sysfs interface is updated to add the new attribute file, and
      there are corresponding documentation updates.
      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 reset_resume method · f07600cf
      Alan Stern authored
      This patch (as918) introduces a new USB driver method: reset_resume.
      It is called when a device needs to be reset as part of a resume
      procedure (whether because of a device quirk or because of the
      USB-Persist facility), thereby taking over a role formerly assigned to
      the post_reset method.  As a consequence, post_reset no longer needs
      an argument indicating whether it is being called as part of a
      reset-resume.  This separation of functions makes the code clearer.
      In addition, the pre_reset and post_reset method return types are
      changed; they now must return an error code.  The return value is
      unused at present, but at some later time we may unbind drivers and
      re-probe if they encounter an error during reset handling.
      The existing pre_reset and post_reset methods in the usbhid,
      usb-storage, and hub drivers are updated to match the new
      requirements.  For usbhid the post_reset routine is also used for
      reset_resume (duplicate method pointers); for the other drivers a new
      reset_resume routine is added.  The change to hub.c looks bigger than
      it really is, because mark_children_for_reset_resume() gets moved down
      next to the new hub_reset_resume() routine.
      A minor change to usb-storage makes the usb_stor_report_bus_reset()
      routine acquire the host lock instead of requiring the caller to hold
      it already.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Oliver Neukum's avatar
      USB: introduce usb_anchor · 51a2f077
      Oliver Neukum authored
      - introduction of usb_anchor and its methods
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Daniel Drake's avatar
      USB: add USB_DEVICE_AND_INTERFACE_INFO for device matching · 8538f96a
      Daniel Drake authored
      Recently, the USB device matching code stopped matching generic interface
      matches against devices with vendor-specific device class values.
      Some drivers now need to explicitly match USB device ID's (in addition to
      generic interface info) to retain the same behaviour as before. This new macro,
      suggested by Alan Stern, makes the explicit device/interface matching a little
      simpler for those users.
      Signed-off-by: default avatarDaniel Drake <dsd@gentoo.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Alan Stern's avatar
      USB: add USB-Persist facility · 0458d5b4
      Alan Stern authored
      This patch (as886) adds the controversial USB-persist facility,
      allowing USB devices to persist across a power loss during system
      The facility is controlled by a new Kconfig option (with appropriate
      warnings about the potential dangers); when the option is off the
      behavior will remain the same as it is now.  But when the option is
      on, people will be able to use suspend-to-disk and keep their USB
      filesystems intact -- something particularly valuable for small
      machines where the root filesystem is on a USB device!
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  10. 09 Jul, 2007 1 commit
  11. 09 May, 2007 1 commit
  12. 27 Apr, 2007 4 commits
    • Alan Stern's avatar
      USB: add "last_busy" field for use in autosuspend · 1941044a
      Alan Stern authored
      This patch (as877) adds a "last_busy" field to struct usb_device, for
      use by the autosuspend framework.  Now if an autosuspend call comes at
      a time when the device isn't busy but hasn't yet been idle for long
      enough, the timer can be set to exactly the desired value.  And we
      will be ready to handle things like HID drivers, which can't maintain
      a useful usage count and must rely on the time-of-last-use to decide
      when to autosuspend.
      The patch also makes some related minor improvements:
      	Move the calls to the autosuspend condition-checking routine
      	into usb_suspend_both(), which is the only place where it
      	really matters.
      	If the autosuspend timer is already running, don't stop
      	and restart it.
      	Replace immediate returns with gotos so that the optional
      	debugging ouput won't be bypassed.
      	If autoresume is disabled but the device is already awake,
      	don't return an error for an autoresume call.
      	Don't try to autoresume a device if it isn't suspended.
      	(Yes, this undercuts the previous change -- so sue me.)
      	Don't duplicate existing code in the autosuspend work routine.
      	Fix the kerneldoc in usb_autopm_put_interface(): If an
      	autoresume call fails, the usage counter is left unchanged.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      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>
    • Alan Stern's avatar
      USB: add power/level sysfs attribute · 2add5229
      Alan Stern authored
      This patch (as874) adds another piece to the user-visible part of the
      USB autosuspend interface.  The new power/level sysfs attribute allows
      users to force the device on (with autosuspend off), force the device
      to sleep (with autoresume off), or return to normal automatic operation.
      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: Allow autosuspend delay to equal 0 · eaafbc3a
      Alan Stern authored
      This patch (as867) adds an entry for the new power/autosuspend
      attribute in Documentation/ABI/testing, and it changes the behavior of
      the delay value.  Now a delay of 0 means to autosuspend as soon as
      possible, and negative values will prevent autosuspend.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  13. 23 Feb, 2007 1 commit
    • Alan Stern's avatar
      USB: make autosuspend delay a module parameter · b5e795f8
      Alan Stern authored
      This patch (as859) makes the default USB autosuspend delay a module
      parameter of usbcore.  By setting the delay value at boot time, users
      will be able to prevent the system from autosuspending devices which
      for some reason can't handle it.
      The patch also stores the autosuspend delay as a per-device value.  A
      later patch will allow the user to change the value, tailoring the
      delay for each individual device.  A delay value of 0 will prevent
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>