1. 28 9月, 2006 14 次提交
    • A
      usbcore: add autosuspend/autoresume infrastructure · 645daaab
      Alan Stern 提交于
      This patch (as739) adds the basic infrastructure for USB autosuspend
      and autoresume.  The main features are:
      
      	PM usage counters added to struct usb_device and struct
      	usb_interface, indicating whether it's okay to autosuspend
      	them or they are currently in use.
      
      	Flag added to usb_device indicating whether the current
      	suspend/resume operation originated from outside or as an
      	autosuspend/autoresume.
      
      	Flag added to usb_driver indicating whether the driver
      	supports autosuspend.  If not, no device bound to the driver
      	will be autosuspended.
      
      	Mutex added to usb_device for protecting PM operations.
      	Unlike the device semaphore, the locking rule for the pm_mutex
      	is that you must acquire the locks going _up_ the device tree.
      
      	New routines handling autosuspend/autoresume requests for
      	interfaces and devices.
      
      	Suspend and resume requests are propagated up the device tree
      	(but not outside the USB subsystem).
      
      	work_struct added to usb_device, for carrying out delayed
      	autosuspend requests.
      
      	Autoresume added (and autosuspend prevented) during probe and
      	disconnect.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      645daaab
    • A
      usbcore: store each usb_device's level in the tree · b6956ffa
      Alan Stern 提交于
      This patch (as778) adds a field to struct usb_device to store the
      device's level in the USB tree.  In itself this number isn't really
      important.  But the overhead is very low, and in a later patch it will
      be used for preventing bogus warnings from the lockdep checker.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b6956ffa
    • A
      usbcore: trim down usb_bus structure · 17200583
      Alan Stern 提交于
      As part of the ongoing program to flatten out the HCD bus-glue layer,
      this patch (as771b) eliminates the hcpriv, release, and kref fields
      from struct usb_bus.  hcpriv and release were not being used for
      anything worthwhile, and kref has been moved into the enclosing
      usb_hcd structure.
      
      Along with those changes, the patch gets rid of usb_bus_get and
      usb_bus_put, replacing them with usb_get_hcd and usb_put_hcd.
      
      The one interesting aspect is that the dev_set_drvdata call was
      removed from usb_put_hcd, where it clearly doesn't belong.  This means
      the driver private data won't get reset to NULL.  It shouldn't cause
      any problems, since the private data is undefined when no driver is
      bound.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      17200583
    • A
      usbcore: Add flag for whether a host controller uses DMA · dd990f16
      Alan Stern 提交于
      This patch (as770b) introduces a new field to usb_bus: a flag
      indicating whether or not the host controller uses DMA.  This serves
      to encapsulate the computation.  It also means we will have only one
      spot to update if the DMA API changes.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dd990f16
    • A
      USB: remove struct usb_operations · a6d2bb9f
      Alan Stern 提交于
      All of the currently-supported USB host controller drivers use the HCD
      bus-glue framework.  As part of the program for flattening out the glue
      layer, this patch (as769) removes the usb_operations structure.  All
      function calls now go directly to the HCD routines (slightly renamed
      to remain within the "usb_" namespace).
      
      The patch also removes usb_alloc_bus(), because it's not useful in the
      HCD framework and it wasn't referenced anywhere.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a6d2bb9f
    • A
      usbcore: help drivers to change device configs · 088dc270
      Alan Stern 提交于
      It's generally a bad idea for USB interface drivers to try to change a
      device's configuration, and usbcore doesn't provide any way for them
      to do it.  However in a few exceptional circumstances it can make
      sense.  This patch (as767) adds a roundabout mechanism to help drivers
      that may need it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      088dc270
    • L
      USB core: Use const where possible. · 095bc335
      Luiz Fernando N. Capitulino 提交于
      This patch marks some USB core's functions parameters as const. This
      improves the design (we're saying to the caller that its parameter is
      not going to be modified) and may help in compiler's optimisation work.
      Signed-off-by: NLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      095bc335
    • M
      USB Storage: add rio karma eject support · dfe0d3ba
      Matthew Dharm 提交于
      This changeset from Keith Bennett (via Bob Copeland) moves the Karma
      initializer to its own file and adds trapping of the START_STOP command to
      enable eject of the device.
      Signed-off-by: NKeith Bennett <keith@mcs.st-and.ac.uk>
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dfe0d3ba
    • L
      USB: New functions to check endpoints info. · b7cfaaaf
      Luiz Fernando N. Capitulino 提交于
      These functions makes USB driver's code simpler when dealing with endpoints
      by avoiding them from accessing the endpoint's descriptor structure directly
      when they only need to know the endpoint's transfer type and/or
      direction.
      
      Please, read each functions' documentation in order to know how to use
      them.
      Signed-off-by: NLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b7cfaaaf
    • 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
    • B
      USB: gmidi: New USB MIDI Gadget class driver. · f2ebf92c
      Ben Williamson 提交于
      This driver is glue between the USB gadget interface
      and the ALSA MIDI interface. It allows us to appear
      as a MIDI Streaming device to a host system on the
      other end of a USB cable.
      
      This includes linux/usb/audio.h and linux/usb/midi.h
      containing definitions from the relevant USB specifications
      for USB audio and USB MIDI devices.
      
      The following changes have been made since the first RFC
      posting:
      
      * Bug fixes to endpoint handling.
      * Workaround for USB_REQ_SET_CONFIGURATION handling,
        not understood yet.
      * Added SND and SND_RAWMIDI dependencies in Kconfig.
      * Moved usb_audio.h and usb_midi.h to usb/*.h
      * Added module parameters for ALSA card index and id.
      * Added module parameters for USB descriptor IDs and strings.
      * Removed some unneeded stuff inherited from zero.c, more to go.
      * Provide DECLARE_* macros for the variable-length structs.
      * Use kmalloc instead of usb_ep_alloc_buffer.
      * Limit source to 80 columns.
      * Return actual error code instead of -ENOMEM in a few places.
      Signed-off-by: NBen Williamson <ben.williamson@greyinnovation.com>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f2ebf92c
    • 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
    • D
      USB: move <linux/usb_otg.h> to <linux/usb/otg.h> · 3a16f7b4
      David Brownell 提交于
      Move <linux/usb_otg.h> to <linux/usb/otg.h>.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3a16f7b4
  2. 27 9月, 2006 26 次提交