1. 28 9月, 2006 3 次提交
    • J
      USB: making the kernel -Wshadow clean - USB & completion · 3d5b2510
      Jesper Juhl 提交于
      include/linux/usb.h causes a lot of -Wshadow warnings - fix them.
      
        include/linux/usb.h:901: warning: declaration of 'complete' shadows a global declaration
        include/linux/completion.h:52: warning: shadowed declaration is here
        include/linux/usb.h:932: warning: declaration of 'complete' shadows a global declaration
        include/linux/completion.h:52: warning: shadowed declaration is here
        include/linux/usb.h:967: warning: declaration of 'complete' shadows a global declaration
        include/linux/completion.h:52: warning: shadowed declaration is here
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3d5b2510
    • A
      usbcore: track whether interfaces are suspended · 4d064c08
      Alan Stern 提交于
      Currently we rely on intf->dev.power.power_state.event for tracking
      whether intf is suspended.  This is not a reliable technique because
      that value is owned by the PM core, not by usbcore.  This patch (as718b)
      adds a new flag so that we can accurately tell which interfaces are
      suspended and which aren't.
      
      At first one might think these flags aren't needed, since interfaces
      will be suspended along with their devices.  It turns out there are a
      couple of intermediate situations where that's not quite true, such as
      while processing a remote-wakeup request.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4d064c08
    • A
      usbcore: add usb_device_driver definition · 8bb54ab5
      Alan Stern 提交于
      This patch (as732) adds a usb_device_driver structure, for representing
      drivers that manage an entire USB device as opposed to just an
      interface.  Support routines like usb_register_device_driver,
      usb_deregister_device_driver, usb_probe_device, and usb_unbind_device
      are also added.
      
      Unlike an earlier version of this patch, the new code is type-safe.  To
      accomplish this, the existing struct driver embedded in struct
      usb_driver had to be wrapped in an intermediate wrapper.  This enables
      the core to tell at runtime whether a particular struct driver belongs
      to a device driver or to an interface driver.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8bb54ab5
  2. 03 8月, 2006 2 次提交
  3. 13 7月, 2006 1 次提交
  4. 22 6月, 2006 5 次提交
  5. 26 4月, 2006 1 次提交
  6. 29 3月, 2006 1 次提交
  7. 21 3月, 2006 1 次提交
  8. 05 1月, 2006 8 次提交
    • K
      [PATCH] driver core: replace "hotplug" by "uevent" · 312c004d
      Kay Sievers 提交于
      Leave the overloaded "hotplug" word to susbsystems which are handling
      real devices. The driver core does not "plug" anything, it just exports
      the state to userspace and generates events.
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      312c004d
    • A
      [PATCH] USB: Store port number in usb_device · 12c3da34
      Alan Stern 提交于
      This patch (as610) adds a field to struct usb_device to store the device's
      port number.  This allows us to remove several loops in the hub driver
      (searching for a particular device among all the entries in the parent's
      array of children).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      12c3da34
    • A
      [PATCH] USB: Consider power budget when choosing configuration · 55c52718
      Alan Stern 提交于
      This patch (as609) changes the way we keep track of power budgeting for
      USB hubs and devices, and it updates the choose_configuration routine to
      take this information into account.  (This is something we should have
      been doing all along.)  A new field in struct usb_device holds the amount
      of bus current available from the upstream port, and the usb_hub structure
      keeps track of the current available for each downstream port.
      
      Two new rules for configuration selection are added:
      
      	Don't select a self-powered configuration when only bus power
      	is available.
      
      	Don't select a configuration requiring more bus power than is
      	available.
      
      However the first rule is #if-ed out, because I found that the internal
      hub in my HP USB keyboard claims that its only configuration is
      self-powered.  The rule would prevent the configuration from being chosen,
      leaving the hub & keyboard unconfigured.  Since similar descriptor errors
      may turn out to be fairly common, it seemed wise not to include a rule
      that would break automatic configuration unnecessarily for such devices.
      
      The second rule may also trigger unnecessarily, although this should be
      less common.  More likely it will annoy people by sometimes failing to
      accept configurations that should never have been chosen in the first
      place.
      
      The patch also changes usbcore's reaction when no configuration is
      suitable.  Instead of raising an error and rejecting the device, now
      the core will simply leave the device unconfigured.  People can always
      work around such problems by installing configurations manually through
      sysfs.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      55c52718
    • A
      [PATCH] USB: Remove USB private semaphore · 9ad3d6cc
      Alan Stern 提交于
      This patch (as605) removes the private udev->serialize semaphore,
      relying instead on the locking provided by the embedded struct device's
      semaphore.  The changes are confined to the core, except that the
      usb_trylock_device routine now uses the return convention of
      down_trylock rather than down_read_trylock (they return opposite values
      for no good reason).
      
      A couple of other associated changes are included as well:
      
      	Now that we aren't concerned about HCDs that avoid using the
      	hcd glue layer, usb_disconnect no longer needs to acquire the
      	usb_bus_lock -- that can be done by usb_remove_hcd where it
      	belongs.
      
      	Devices aren't locked over the same scope of code in
      	usb_new_device and hub_port_connect_change as they used to be.
      	This shouldn't cause any trouble.
      
      Along with the preceding driver core patch, this needs a lot of testing.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9ad3d6cc
    • G
      [PATCH] USB: remove .owner field from struct usb_driver · 75318d2d
      Greg Kroah-Hartman 提交于
      It is no longer needed, so let's remove it, saving a bit of memory.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      75318d2d
    • G
      [PATCH] USB: make registering a usb driver automatically set the module owner · 2143acc6
      Greg Kroah-Hartman 提交于
      This fixes the driver that forgot to set the module owner up.  Now we
      can remove the unneeded pointer from the usb driver structure.  The idea
      for how to do this was from Al Viro, who did this for the PCI drivers.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2143acc6
    • G
      [PATCH] USB: allow usb drivers to disable dynamic ids · ba9dc657
      Greg Kroah-Hartman 提交于
      This lets drivers, like the usb-serial ones, disable the ability to add
      ids from sysfs.
      
      The usb-serial drivers are "odd" in that they are really usb-serial bus
      drivers, not usb bus drivers, so the dynamic id logic will have to go
      into the usb-serial bus core for those drivers to get that ability.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ba9dc657
    • G
      [PATCH] USB: add dynamic id functionality to USB core · 733260ff
      Greg Kroah-Hartman 提交于
      Echo the usb vendor and product id to the "new_id" file in the driver's
      sysfs directory, and then that driver will be able to bind to a device
      with those ids if it is present.
      
      Example:
      	echo 0557 2008 > /sys/bus/usb/drivers/foo_driver/new_id
      adds the hex values 0557 and 2008 to the device id table for the foo_driver.
      
      Note, usb-serial drivers do not currently work with this capability yet.
      usb-storage also might have some oddities.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      733260ff
  9. 24 11月, 2005 1 次提交
  10. 14 11月, 2005 1 次提交
  11. 29 10月, 2005 8 次提交
    • A
      [PATCH] usbcore: Fix handling of sysfs strings and other attributes · 4f62efe6
      Alan Stern 提交于
      This patch (as592) makes a few small improvements to the way device
      strings are handled, and it fixes some bugs in a couple of other sysfs
      attribute routines.  (Look at show_configuration_string() to see what I
      mean.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f62efe6
    • A
      [PATCH] usbcore: Wrap lines before column 80 · b724ae77
      Alan Stern 提交于
      I can't stand text lines that wrap-around in my 80-column windows.  This
      patch (as589) makes cosmetic changes to a couple of source files.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b724ae77
    • A
      [PATCH] usbcore: Improve endpoint sysfs file handling · be69e5b1
      Alan Stern 提交于
      This revised patch (as587b) improves the implementation of USB endpoint
      sysfs files.  Instead of storing a whole bunch of attributes for every
      single endpoint, each endpoint now gets its own kobject and they can
      share a static list of attributes.  The number of extra fields added to
      struct usb_host_endpoint has been reduced from 4 to 1.
      
      The bEndpointAddress field is retained even though it is redundant (it
      repeats the same information as the attributes' directory name).  The
      code avoids calling kobject_register, to prevent generating unwanted
      hotplug events.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      be69e5b1
    • G
      [PATCH] USB: add notifier functions to the USB core for devices and busses · 3099e75a
      Greg Kroah-Hartman 提交于
      This should let us get rid of all of the different hooks in the USB core for
      when something has changed.
      
      Also, some other parts of the kernel have wanted to know this kind of
      information at times.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3099e75a
    • D
      [PATCH] stop exporting two functions · 5edbfb7c
      David Brownell 提交于
      The way we're looking at USB suspend lately doesn't expect drivers to
      call usb_suspend_device() or usb_resume_device() directly; that'll
      be implicit when no interfaces are in use.
      
      This patch removes those APIs from visibility outside usbcore.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      
       drivers/usb/core/hub.c |   12 ++++--------
       drivers/usb/core/usb.h |    4 ++++
       include/linux/usb.h    |    5 -----
       3 files changed, 8 insertions(+), 13 deletions(-)
      5edbfb7c
    • D
      [PATCH] remove usb_suspend_device() parameter · 390a8c34
      David Brownell 提交于
      This patch removes the extra usb_suspend_device() parameter.  The original
      reason to pass that parameter was so that this routine could suspend any
      active children.  A previous patch removed that functionality ... leaving
      no reason to pass the parameter.  A close analogy is pci_set_power_state,
      which doesn't need a pm_message_t either.
      
      On the internal code path that comes through the driver model, the parameter
      is now used to distinguish cases where USB devices need to "freeze" but not
      suspend.   It also checks for an error case that's accessible through sysfs:
      attempting to suspend a device before its interfaces (or for hubs, ports).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/core/hub.c         |   34 +++++++++++++++++++++-------------
       drivers/usb/core/usb.c         |   23 +++++++++++++++++++++--
       drivers/usb/host/ehci-hcd.c    |    2 +-
       drivers/usb/host/isp116x-hcd.c |    2 +-
       drivers/usb/host/ohci-pci.c    |    2 +-
       include/linux/usb.h            |    2 +-
       6 files changed, 46 insertions(+), 19 deletions(-)
      390a8c34
    • G
      [PATCH] devfs: Remove the mode field from usb_class_driver as it's no longer needed · d6e5bcf4
      Greg Kroah-Hartman 提交于
      Also fixes all drivers that set this field, and removes some other devfs
      specfic USB logic.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/class/usblp.c           |    3 +--
       drivers/usb/core/file.c             |   19 ++++---------------
       drivers/usb/image/mdc800.c          |    3 +--
       drivers/usb/input/aiptek.c          |    2 +-
       drivers/usb/input/hiddev.c          |    3 +--
       drivers/usb/media/dabusb.c          |    3 +--
       drivers/usb/misc/auerswald.c        |    3 +--
       drivers/usb/misc/idmouse.c          |    5 ++---
       drivers/usb/misc/legousbtower.c     |    5 ++---
       drivers/usb/misc/rio500.c           |    3 +--
       drivers/usb/misc/sisusbvga/sisusb.c |    5 -----
       drivers/usb/misc/usblcd.c           |    9 ++++-----
       drivers/usb/usb-skeleton.c          |    3 +--
       include/linux/usb.h                 |    7 ++-----
       14 files changed, 22 insertions(+), 51 deletions(-)
      d6e5bcf4
    • G
      [PATCH] USB: add endpoint information to sysfs · 094f1649
      Greg Kroah-Hartman 提交于
      This patch adds endpoint information for both devices and interfaces to
      sysfs.  Previously it was only possible to get the endpoint information
      from usbfs, and never possible to get any information on endpoint 0.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/core/sysfs.c |  195 ++++++++++++++++++++++++++++++++++++++++++++++-
       include/linux/usb.h      |    4
       2 files changed, 197 insertions(+), 2 deletions(-)
      094f1649
  12. 28 10月, 2005 1 次提交
  13. 09 9月, 2005 2 次提交
    • A
      [PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel · b375a049
      Alan Stern 提交于
      29 July 2005, Cambridge, MA:
      
      This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
      flag from the Linux kernel.  Mr. Stern explained, "This flag is a relic
      from an earlier, less-well-designed system.  For over a year it hasn't
      been used for anything other than printing warning messages."
      
      An anonymous spokesman for the Linux kernel development community
      commented, "This is exactly the sort of thing we see happening all the
      time.  As the kernel evolves, support for old techniques and old code can
      be jettisoned and replaced by newer, better approaches.  Proprietary
      operating systems do not have the freedom or flexibility to change so
      quickly."
      
      Mr. Stern, a staff member at Harvard University's Rowland Institute who
      works on Linux only as a hobby, noted that the patch (labelled as548) did
      not update two files, keyspan.c and option.c, in the USB drivers' "serial"
      subdirectory.  "Those files need more extensive changes," he remarked.
      "They examine the status field of several URBs at times when they're not
      supposed to.  That will need to be fixed before the URB_ASYNC_UNLINK flag
      is removed."
      
      Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
      of Linux's USB drivers, did not respond to our inquiries or return our
      calls.  His only comment was "Applied, thanks."
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b375a049
    • K
      [PATCH] USB: real nodes instead of usbfs · fbf82fd2
      Kay Sievers 提交于
      This patch introduces a /sys/class/usb_device/ class
      where every connected usb-device will show up:
      
        tree /sys/class/usb_device/
        /sys/class/usb_device/
        |-- usb1.1
        |   |-- dev
        |   `-- device -> ../../../devices/pci0000:00/0000:00:1d.0/usb1
        |-- usb2.1
        |   |-- dev
        |   `-- device -> ../../../devices/pci0000:00/0000:00:1d.1/usb2
        ...
      
      The presence of the "dev" file lets udev create real device nodes.
        kay@pim:~/src/linux-2.6> tree /dev/bus/usb/
        /dev/bus/usb/
        |-- 1
        |   `-- 1
        |-- 2
        |   `-- 1
        ...
      
      udev rule:
        SUBSYSTEM="usb_device", PROGRAM="/sbin/usb_device %k", NAME="%c"
        (echo $1 | /bin/sed 's/usb\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/')
      
      This makes libusb pick up the real nodes instead of the mounted usbfs:
        export USB_DEVFS_PATH=/dev/bus/usb
      
      Background:
        All this makes it possible to manage usb devices with udev instead of
        the devfs solution. We are currently working on a pam_console/resmgr
        replacement driven by udev and a pam-helper. It applies ACL's to device
        nodes, which is required for modern desktop functionalty like
        "Fast User Switching" or multiple local login support.
      
      New patch with its own major. I've succesfully disabled usbfs and use real
      nodes only on my box. With: "export USB_DEVFS_PATH=/dev/bus/usb" libusb picks
      up the udev managed nodes instead of reading usbfs files.
      
      This makes udev to provide symlinks for libusb to pick up:
        SUBSYSTEM="usb_device", PROGRAM="/sbin/usbdevice %k", SYMLINK="%c"
      
      /sbin/usbdevice:
        #!/bin/sh
        echo $1 | /bin/sed 's/usbdev\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/'
      Signed-off-by: NKay Sievers <kay.sievers@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fbf82fd2
  14. 13 7月, 2005 1 次提交
  15. 24 6月, 2005 1 次提交
  16. 21 6月, 2005 1 次提交
  17. 03 6月, 2005 1 次提交
    • R
      [PATCH] USB: update urb documentation · 719df469
      Roman Kagan 提交于
      On Wed, May 04, 2005 at 01:37:30PM -0700, David Brownell wrote:
      > On Wednesday 04 May 2005 12:19 pm, Roman Kagan wrote:
      > > struct urb {
      > > 	/* private, usb core and host controller only fields in the urb */
      > > 	...
      > > 	struct list_head urb_list;	/* list pointer to all active urbs */
      > > 	...
      > > };
      > >
      > > Is it safe to use it for driver's purposes when the driver owns the urb,
      > > that is, starting from the completion routine until the urb is submitted
      > > with usb_submit_urb()?
      >
      > Right now, it should be.
      
      Great!  FWIW I've briefly tested a modified version of usbatm using
      the list head in struct urb instead of creating a wrapper struct, and I
      haven't seen any failures yet.  So I tend to believe that your "should
      be" actually means "is" :)
      
      > > If it is, can it be guaranteed in future, e.g.
      > > by moving the list head into the public section of struct urb?
      >
      > In fact I'm not sure why it ever got called "private" to usbcore/hcds.
      > I thought the idea was that it should be like urb->status, reserved for
      > whoever controls the URB.
      
      OK then how about the following (essentially documentation) patch?
      Signed-off-by: NRoman Kagan <rkagan@mail.ru>
      Acked-by: NDavid Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      719df469
  18. 19 4月, 2005 1 次提交
    • D
      [PATCH] usb suspend updates (interface suspend) · 27d72e85
      David Brownell 提交于
      This is the first of a few installments of PM API updates to match the
      recent switch to "pm_message_t".  This installment primarily affects
      USB device drivers (for USB interfaces), and it changes the handful of
      drivers which currently implement suspend methods:
      
          - <linux/usb.h> and usbcore, signature change
      
          - Some drivers only changed the signature, net effect this just
            shuts up "sparse -Wbitwise":
      	* hid-core
      	* stir4200
      
          - Two network drivers did that, and also grew slightly more
            featureful suspend code ... they now properly shut down
            their activities.  (As should stir4200...)
      	* pegasus
      	* usbnet
      
      Note that the Wake-On-Lan (WOL) support in pegasus doesn't yet work; looks
      to me like it's missing a request to turn it on, vs just configuring it.
      The ASIX code in usbnet also has WOL hooks that are ready to use; untested.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      Index: gregkh-2.6/drivers/net/irda/stir4200.c
      ===================================================================
      27d72e85