1. 25 3月, 2009 1 次提交
  2. 08 1月, 2009 3 次提交
    • A
      USB: utilize the bus notifiers · 3b23dd6f
      Alan Stern 提交于
      This patch (as1185) makes usbcore take advantage of the bus
      notifications sent out by the driver core.  Now we can create all our
      device and interface attribute files before the device or interface
      uevent is broadcast.
      
      A side effect is that we no longer create the endpoint "pseudo"
      devices at the same time as a device or interface is registered -- it
      seems like a bad idea to try registering an endpoint before the
      registration of its parent is complete.  So the routines for creating
      and removing endpoint devices have been split out and renamed, and
      they are called explicitly when needed.  A new bitflag is used for
      keeping track of whether or not the interface's endpoint devices have
      been created, since (just as with the interface attributes) they vary
      with the altsetting and hence can be changed at random times.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3b23dd6f
    • A
      USB: Enhance usage of pm_message_t · 65bfd296
      Alan Stern 提交于
      This patch (as1177) modifies the USB core suspend and resume
      routines.  The resume functions now will take a pm_message_t argument,
      so they will know what sort of resume is occurring.  The new argument
      is also passed to the port suspend/resume and bus suspend/resume
      routines (although they don't use it for anything but debugging).
      
      In addition, special pm_message_t values are used for user-initiated,
      device-initiated (i.e., remote wakeup), and automatic suspend/resume.
      By testing these values, drivers can tell whether or not a particular
      suspend was an autosuspend.  Unfortunately, they can't do the same for
      resumes -- not until the pm_message_t argument is also passed to the
      drivers' resume methods.  That will require a bigger change.
      
      IMO, the whole Power Management framework should have been set up this
      way in the first place.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      65bfd296
    • A
      USB: straighten out inline code in sysfs.c · 92b0da15
      Alan Stern 提交于
      This patch (as1156) straightens out some code in usbcore.  The
      usb_create_intf_ep_files() and usb_remove_intf_ep_files() routines
      don't need to be separate inlines; they should be moved bodily into
      the places where they get used.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      92b0da15
  3. 14 11月, 2008 1 次提交
    • A
      USB: don't register endpoints for interfaces that are going away · 352d0263
      Alan Stern 提交于
      This patch (as1155) fixes a bug in usbcore.  When interfaces are
      deleted, either because the device was disconnected or because of a
      configuration change, the extra attribute files and child endpoint
      devices may get left behind.  This is because the core removes them
      before calling device_del().  But during device_del(), after the
      driver is unbound the core will reinstall altsetting 0 and recreate
      those extra attributes and children.
      
      The patch prevents this by adding a flag to record when the interface
      is in the midst of being unregistered.  When the flag is set, the
      attribute files and child devices will not be created.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org> [2.6.27, 2.6.26, 2.6.25]
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      352d0263
  4. 18 10月, 2008 1 次提交
  5. 30 5月, 2008 1 次提交
    • A
      USB: add all configs to the "descriptors" attribute · 217a9081
      Alan Stern 提交于
      This patch (as1094) changes the output of the "descriptors" binary
      attribute.  Now it will contain the device descriptor followed by all
      the configuration descriptors, not just the descriptor for the current
      config.
      
      Userspace libraries want to have access to the kernel's cached
      descriptor information, so they can learn about device characteristics
      without having to wake up suspended devices.  So far the only user of
      this attribute is the new libusb-1.0 library; thus changing its
      contents shouldn't cause any problems.
      
      This should be considered for 2.6.26, if for no other reason than to
      minimize the range of releases in which the attribute contains only the
      current config descriptor.
      
      Also, it doesn't hurt that the patch removes the device locking --
      which was formerly needed in order to know for certain which config was
      indeed current.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      217a9081
  6. 15 5月, 2008 1 次提交
    • A
      USB: create attributes before sending uevent · 2e5f10e4
      Alan Stern 提交于
      This patch (as1087d) fixes a long-standing problem in usbcore: Device,
      interface, and endpoint attributes aren't added until _after_ the
      creation uevent has already been broadcast.
      
      Unfortunately there are a few attributes which cannot be created that
      early.  The "descriptors" attribute is binary and so must be created
      separately.  The power-management attributes can't be created until
      the dev/power/ group exists.  And the interface string can vary from
      one altsetting to another, so it has to be created dynamically.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2e5f10e4
  7. 25 4月, 2008 1 次提交
  8. 02 2月, 2008 2 次提交
    • G
      USB: fix codingstyle issues in drivers/usb/core/*.c · 2c044a48
      Greg Kroah-Hartman 提交于
      Fixes a number of coding style issues in the remaining .c files in
      drivers/usb/core/
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2c044a48
    • S
      USB: Export suspend statistics · 15123006
      Sarah Sharp 提交于
      This patch exports two statistics to userspace:
      /sys/bus/usb/device/.../power/connected_duration
      /sys/bus/usb/device/.../power/active_duration
      
      connected_duration is the total time (in msec) that the device has
      been connected.  active_duration is the total time the device has not
      been suspended.  With these two statistics, tools like PowerTOP can
      calculate the percentage time that a device is active, i.e. not
      suspended or auto-suspended.
      
      Users can also use the active_duration to check if a device is actually
      autosuspended.  Currently, they can set power/level to auto and
      power/autosuspend to a positive timeout, but there's no way to know from
      userspace if a device was actually autosuspended without looking at the
      dmesg output.  These statistics will be useful in creating an automated
      userspace script to test autosuspend for USB devices.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      15123006
  9. 29 11月, 2007 1 次提交
  10. 13 10月, 2007 2 次提交
  11. 20 7月, 2007 1 次提交
    • A
      USB: add "descriptors" binary sysfs attribute · 69d42a78
      Alan Stern 提交于
      This patch (as934) adds a new readonly binary sysfs attribute file
      called "descriptors" for each USB device.  The attribute contains the
      device descriptor followed by the raw descriptor entry (config plug
      subsidiary descriptors) for the current configuration.
      
      Having this information available in fixed-format binary makes life a
      lot easier for user programs by avoiding the need to open, read, and
      parse multiple sysfs text files.
      
      The information in this attribute file is much like that in usbfs's
      device file, but there are some significant differences:
      
      	The 2-byte fields in the device descriptor are left in
      	little-endian byte order, as they appear on the bus and
      	in the kernel.
      
      	Only one raw descriptor set is presented, that of the
      	current configuration.
      
      	Opening this file will not cause a suspended device to be
      	autoresumed.
      
      The last item in particular should be a big selling point for libusb,
      which currently forces all USB devices to be resumed as it scans the
      device tree.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Dave Mielke <dave@mielke.cc>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      69d42a78
  12. 13 7月, 2007 2 次提交
    • C
      USB: add IAD support to usbfs and sysfs · 165fe97e
      Craig W. Nadler 提交于
      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: NCraig W. Nadler <craig@nadler.us>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      165fe97e
    • A
      USB: add power/persist device attribute · b41a60ec
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b41a60ec
  13. 23 5月, 2007 1 次提交
  14. 28 4月, 2007 3 次提交
  15. 24 2月, 2007 3 次提交
  16. 17 2月, 2007 1 次提交
    • A
      USB: unconfigure devices which have config 0 · 3f141e2a
      Alan Stern 提交于
      Some USB devices do have a configuration 0, in contravention of the
      USB spec.  Normally 0 is supposed to indicate that a device is
      unconfigured.
      
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f141e2a
  17. 08 2月, 2007 1 次提交
  18. 28 9月, 2006 2 次提交
  19. 01 7月, 2006 1 次提交
  20. 22 6月, 2006 2 次提交
  21. 18 11月, 2005 1 次提交
  22. 29 10月, 2005 5 次提交
  23. 13 7月, 2005 1 次提交
  24. 21 6月, 2005 2 次提交