01 Nov, 2011

1 commit

  • The original implementations reference THIS_MODULE in an inline.
    We could include , but it is better to avoid chaining.

    Fortunately someone else already thought of this, and made a similar
    inline into a #define in for device_schedule_callback(),
    [see commit 523ded71de0] so follow that precedent here.

    Also bubble up any __must_check that were used on the prev. wrapper inline
    functions up one to the real __register functions, to preserve any prev.
    sanity checks that were used in those instances.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

27 Sep, 2011

3 commits

  • If the device pass the USB2 software LPM and the host supports hardware
    LPM, enable hardware LPM for the device to let the host decide when to
    put the link into lower power state.

    If hardware LPM is enabled for a port and driver wants to put it into
    suspend, it must first disable hardware LPM, resume the port into U0,
    and then suspend the port.

    Signed-off-by: Andiry Xu
    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     
  • Check device's LPM capability by examining the bmAttibutes field of the
    USB2.0 Extension Descriptor.

    Signed-off-by: Andiry Xu
    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     
  • This commit gets BOS(Binary Device Object Store) descriptor set for Super
    Speed devices and High Speed devices which support BOS descriptor.

    BOS descriptor is used to report additional USB device-level capabilities
    that are not reported via the Device descriptor. By getting BOS descriptor
    set, driver can check device's device-level capability such as LPM
    capability.

    Signed-off-by: Andiry Xu
    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     

24 Aug, 2011

1 commit

  • Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
    instead of le16_to_cpu(desc->wMaxPacketSize).
    This patch fix it up

    Cc: Armin Fuerst
    Cc: Pavel Machek
    Cc: Johannes Erdfelt
    Cc: Vojtech Pavlik
    Cc: Oliver Neukum
    Cc: David Kubicek
    Cc: Johan Hovold
    Cc: Brad Hards
    Acked-by: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Thomas Dahlmann
    Cc: David Brownell
    Cc: David Lopo
    Cc: Alan Stern
    Cc: Michal Nazarewicz
    Cc: Xie Xiaobo
    Cc: Li Yang
    Cc: Jiang Bo
    Cc: Yuan-hsin Chen
    Cc: Darius Augulis
    Cc: Xiaochen Shen
    Cc: Yoshihiro Shimoda
    Cc: OKI SEMICONDUCTOR,
    Cc: Robert Jarzmik
    Cc: Ben Dooks
    Cc: Thomas Abraham
    Cc: Herbert Pötzl
    Cc: Arnaud Patard
    Cc: Roman Weissgaerber
    Acked-by: Sarah Sharp
    Cc: Tony Olech
    Cc: Florian Floe Echtler
    Cc: Christian Lucht
    Cc: Juergen Stuber
    Cc: Georges Toth
    Cc: Bill Ryder
    Cc: Kuba Ober
    Cc: Inaky Perez-Gonzalez
    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     

30 Apr, 2011

1 commit

  • This patch (as1459) updates the documentation for the pre_reset method
    in struct usb_driver. When a driver is notified of an impending
    reset, it must cancel all outstanding I/O and not start any new I/O
    until it has been notified that the reset is complete.

    As far as I know, most existing drivers that implement pre_reset do
    this now. The major exceptions appear to be the SpeedTouch and
    CDC-WDM drivers.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

31 Mar, 2011

1 commit


05 Feb, 2011

1 commit

  • Provide optional hooks for the host controller driver to override the
    default DMA mapping and unmapping routines. In general, these shouldn't
    be necessary unless the host controller has special DMA requirements,
    such as alignment contraints. If these are not specified, the
    general usb_hcd_(un)?map_urb_for_dma functions will be used instead.
    Also, pass the status to unmap_urb_for_dma so it can know whether the
    DMA buffer has been overwritten.

    Finally, add a flag to be used by these implementations if they
    allocated a temporary buffer so it can be freed properly when unmapping.

    Signed-off-by: Robert Morell
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Robert Morell
     

17 Dec, 2010

1 commit

  • * usb-next: (132 commits)
    USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
    USB: uas: Ensure we only bind to a UAS interface
    USB: uas: Rename sense pipe and sense urb to status pipe and status urb
    USB: uas: Use kzalloc instead of kmalloc
    USB: uas: Fix up the Sense IU
    usb: musb: core: kill unneeded #include's
    DA8xx: assign name to MUSB IRQ resource
    usb: gadget: g_ncm added
    usb: gadget: f_ncm.c added
    usb: gadget: u_ether: prepare for NCM
    usb: pch_udc: Fix setup transfers with data out
    usb: pch_udc: Fix compile error, warnings and checkpatch warnings
    usb: add ab8500 usb transceiver driver
    USB: gadget: Implement runtime PM for MSM bus glue driver
    USB: gadget: Implement runtime PM for ci13xxx gadget
    USB: gadget: Add USB controller driver for MSM SoC
    USB: gadget: Introduce ci13xxx_udc_driver struct
    USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask
    USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc
    USB: gadget: Separate out PCI bus code from ci13xxx_udc
    ...

    Greg Kroah-Hartman
     

22 Nov, 2010

1 commit

  • The Inventra DMA engine used with the MUSB controller in many
    SoCs cannot use DMA for control transfers on EP0, but can use
    DMA for all other transfers.

    The USB core maps urbs for DMA if hcd->self.uses_dma is true.
    (hcd->self.uses_dma is true for MUSB as well).

    Split the uses_dma flag into two - one that says if the
    controller needs to use PIO for control transfers, and
    another which says if the controller uses DMA (for all
    other transfers).

    Also, populate this flag for all MUSB by default.

    (Tested on OMAP3 and OMAP4 boards, with EHCI and MUSB HCDs
    simultaneously in use).

    Signed-off-by: Maulik Mankad
    Signed-off-by: Santosh Shilimkar
    Signed-off-by: Anand Gadiyar
    Cc: Oliver Neukum
    Cc: Alan Stern
    Cc: Praveena NADAHALLY
    Cc: Ajay Kumar Gupta
    Signed-off-by: Felipe Balbi

    Anand Gadiyar
     

17 Nov, 2010

2 commits

  • This patch (as1428) converts USB over to the new runtime-PM core
    autosuspend framework. One slightly awkward aspect of the conversion
    is that USB devices will now have two suspend-delay attributes: the
    old power/autosuspend file and the new power/autosuspend_delay_ms
    file. One expresses the delay time in seconds and the other in
    milliseconds, but otherwise they do the same thing. The old attribute
    can be deprecated and then removed eventually.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Since the runtime-PM core already defines a .last_busy field in
    device.power, this patch uses it to replace the .last_busy field
    defined in usb_device and uses pm_runtime_mark_last_busy to implement
    usb_mark_last_busy.

    Signed-off-by: Ming Lei
    Reviewed-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

09 Nov, 2010

1 commit

  • Fix struct field name, prevent kernel-doc warnings.

    Warning(include/linux/usb.h:865): No description found for parameter 'unlocked_ioctl'
    Warning(include/linux/usb.h:865): Excess struct/union/enum/typedef member 'ioctl' description in 'usb_driver'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

11 Aug, 2010

2 commits


21 May, 2010

13 commits

  • Now that all callers are converted over, remove the compatibility
    functions and all is good.

    Cc: Daniel Mack
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Minor formatting changes to clean up the file.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Now on one uses this function and it seems useless,
    so remove usb_find_device.

    [tom@tom linux-2.6-next]$ grep -r -n -I usb_find_device ./
    drivers/media/dvb/dvb-usb/dvb-usb-init.c:160:static struct
    dvb_usb_device_description * dvb_usb_find_device(struct usb_device
    *udev,struct dvb_usb_device_properties *props, int *cold)

    drivers/media/dvb/dvb-usb/dvb-usb-init.c:230: if ((desc =
    dvb_usb_find_device(udev,props,&cold)) == NULL) {

    drivers/usb/core/usb.c:630: * usb_find_device - find a specific usb device in the system
    drivers/usb/core/usb.c:642:struct usb_device *usb_find_device(u16 vendor_id, u16 product_id)

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • This patch (as1377) simplifies the code in usb_sg_init(), without
    changing its functionality. It also removes a couple of unused fields
    from the usb_sg_request structure.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Change the type of the URB's 'sg' pointer from a usb_sg_request to
    a scatterlist. This allows drivers to submit scatter-gather lists
    without using the usb_sg_wait() interface. It has the added benefit
    of removing the typecasts that were added as part of patch as1368 (and
    slightly decreasing the number of pointer dereferences).

    Signed-off-by: Matthew Wilcox
    Reviewed-by: Alan Stern
    Tested-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • The stronger type-checking would have prevented a bug I had.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • Converting a pipe number to a struct usb_host_endpoint pointer is a little
    messy. Introduce a new convenience function to hide the mess.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • Now that URB_NO_SETUP_DMA_MAP is no longer in use, this patch (as1376)
    removes all references to it.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1375) eliminates the usb_host_ss_ep_comp structure used
    for storing a dynamically-allocated copy of the SuperSpeed endpoint
    companion descriptor. The SuperSpeed descriptor is placed directly in
    the usb_host_endpoint structure, alongside the standard endpoint
    descriptor.

    Signed-off-by: Alan Stern
    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Bulk endpoint streams were added in the USB 3.0 specification. Streams
    allow a device driver to overload a bulk endpoint so that multiple
    transfers can be queued at once.

    The device then decides which transfer it wants to work on first, and can
    queue part of a transfer before it switches to a new stream. All this
    switching is invisible to the device driver, which just gets a completion
    for the URB. Drivers that use streams must be able to handle URBs
    completing in a different order than they were submitted to the endpoint.

    This requires adding new API to set up xHCI data structures to support
    multiple queues ("stream rings") per endpoint. Drivers will allocate a
    number of stream IDs before enqueueing URBs to the bulk endpoints of the
    device, and free the stream IDs in their disconnect function. See
    Documentation/usb/bulk-streams.txt for details.

    The new mass storage device class, USB Attached SCSI Protocol (UASP), uses
    these streams API.

    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • Bulk endpoint streams were added in the USB 3.0 specification. Streams
    allow a device driver to overload a bulk endpoint so that multiple
    transfers can be queued at once.

    Add a new field, stream_id, to struct urb so that USB 3.0 drivers can
    specify which stream they want the URB to be queued to.

    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • This patch (as1366) replaces the private routines
    usb_enable_autosuspend() and usb_disable_autosuspend() with calls to
    the standard pm_runtime_allow() and pm_runtime_forbid() functions in
    the runtime PM framework. They do the same thing.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1368) fixes a rather obscure bug in usbmon: When tracing
    URBs sent by the scatter-gather library, it accesses the data buffers
    while they are still mapped for DMA.

    The solution is to move the mapping and unmapping out of the s-g
    library and into the usual place in hcd.c. This requires the addition
    of new URB flag bits to describe the kind of mapping needed, since we
    have to call dma_map_sg() if the HCD supports native scatter-gather
    operation and dma_map_page() if it doesn't. The nice thing about
    having the new flags is that they simplify the testing for unmapping.

    The patch removes the only caller of usb_buffer_[un]map_sg(), so those
    functions are #if'ed out. A later patch will remove them entirely.

    As a result of this change, urb->sg will be set in situations where
    it wasn't set previously. Hence the xhci and whci drivers are
    adjusted to test urb->num_sgs instead, which retains its original
    meaning and is nonzero only when the HCD has to handle a scatterlist.

    Finally, even when a submission error occurs we don't want to hand
    URBs to usbmon before they are unmapped. The submission path is
    rearranged so that map_urb_for_dma() is called only for non-root-hub
    URBs and unmap_urb_for_dma() is called immediately after a submission
    error. This simplifies the error handling.

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

01 May, 2010

1 commit

  • For more clearance what the functions actually do,

    usb_buffer_alloc() is renamed to usb_alloc_coherent()
    usb_buffer_free() is renamed to usb_free_coherent()

    They should only be used in code which really needs DMA coherency.

    [added compatibility macros so we can convert things easier - gregkh]

    Signed-off-by: Daniel Mack
    Cc: Alan Stern
    Cc: Pedro Ribeiro
    Signed-off-by: Greg Kroah-Hartman

    Daniel Mack
     

19 Mar, 2010

1 commit

  • USB 3 and Wireless USB specify a logarithmic encoding of the endpoint
    interval that matches the USB 2 specification. usb_fill_int_urb() didn't
    know that and was filling in the interval as if it was USB 1.1. Fix
    usb_fill_int_urb() for SuperSpeed devices, but leave the wireless case
    alone, because David Vrabel wants to keep the old encoding.

    Update the struct urb kernel doc to note that SuperSpeed URBs must have
    urb->interval specified in microframes.

    Add a missing break statement in the usb_submit_urb() interrupt URB
    checking, since wireless USB and SuperSpeed USB encode urb->interval
    differently. This allows xHCI roothubs to actually register with khubd.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     

08 Mar, 2010

1 commit

  • In the future, we are going to be changing the lock type for struct
    device (once we get the lockdep infrastructure properly worked out) To
    make that changeover easier, and to possibly burry the lock in a
    different part of struct device, let's create some functions to lock and
    unlock a device so that no out-of-core code needs to be changed in the
    future.

    This patch creates the device_lock/unlock/trylock() functions, and
    converts all in-tree users to them.

    Cc: Thomas Gleixner
    Cc: Jean Delvare
    Cc: Dave Young
    Cc: Ming Lei
    Cc: Jiri Kosina
    Cc: Phil Carmody
    Cc: Arjan van de Ven
    Cc: Cornelia Huck
    Cc: Rafael J. Wysocki
    Cc: Pavel Machek
    Cc: Len Brown
    Cc: Magnus Damm
    Cc: Alan Stern
    Cc: Randy Dunlap
    Cc: Stefan Richter
    Cc: David Brownell
    Cc: Vegard Nossum
    Cc: Jesse Barnes
    Cc: Alex Chiang
    Cc: Kenji Kaneshige
    Cc: Andrew Morton
    Cc: Andrew Patterson
    Cc: Yu Zhao
    Cc: Dominik Brodowski
    Cc: Samuel Ortiz
    Cc: Wolfram Sang
    Cc: CHENG Renquan
    Cc: Oliver Neukum
    Cc: Frans Pop
    Cc: David Vrabel
    Cc: Kay Sievers
    Cc: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Mar, 2010

3 commits

  • Add format/argument validation for #ifndef DEBUG dbg macro
    Neaten dbg macro definitions

    Signed-off-by: Joe Perches
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     
  • This patch (as1329) converts the USB stack over to the PM core's
    runtime PM framework. This involves numerous changes throughout
    usbcore, especially to hub.c and driver.c. Perhaps the most notable
    change is that CONFIG_USB_SUSPEND now depends on CONFIG_PM_RUNTIME
    instead of CONFIG_PM.

    Several fields in the usb_device and usb_interface structures are no
    longer needed. Some code which used to depend on CONFIG_USB_PM now
    depends on CONFIG_USB_SUSPEND (requiring some rearrangement of header
    files).

    The only visible change in behavior should be that following a system
    sleep (resume from RAM or resume from hibernation), autosuspended USB
    devices will be resumed just like everything else. They won't remain
    suspended. But if they aren't in use then they will naturally
    autosuspend again in a few seconds.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1326) adds usb_enable_autosuspend() and
    usb_disable_autosuspend() routines for use by drivers. If a driver
    knows that its device can handle suspends and resumes correctly, it
    can enable autosuspend all by itself. This is equivalent to the user
    writing "auto" to the device's power/level attribute.

    The implementation differs slightly from what it used to be. Now
    autosuspend is disabled simply by doing usb_autoresume_device() (to
    increment the usage counter) and enabled by doing
    usb_autosuspend_device() (to decrement the usage counter).

    The set_level() attribute method is updated to use the new routines,
    and the USB Power-Management documentation is updated.

    The patch adds a usb_enable_autosuspend() call to the hub driver's
    probe routine, allowing the special-case code for hubs in quirks.c to
    be removed.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

27 Feb, 2010

1 commit

  • This patch (as1331) adds non-tree ordering constraints needed for
    proper resume of PCI USB host controllers from hibernation. The main
    issue is that non-high-speed devices must not be resumed before the
    high-speed root hub, because it is the ehci_bus_resume() routine which
    takes care of handing the device connection over to the companion
    controller. If the device resume is attempted before the handover
    then the device won't be found and it will be treated as though it had
    disconnected.

    The patch adds a new field to the usb_bus structure; for each
    full/low-speed bus this field will contain a pointer to the companion
    high-speed bus (if one exists). It is used during normal device
    resume; if the hs_companion pointer isn't NULL then we wait for the
    root-hub device on the hs_companion bus.

    A secondary issue is that an EHCI controlller shouldn't be resumed
    before any of its companions. On some machines I have observed
    handovers failing if the companion controller is reinitialized after
    the handover. Thus, the EHCI resume routine must wait for the
    companion controllers to be resumed.

    The patch also fixes a small bug in usb_hcd_pci_probe(); an error path
    jumps to the wrong label, causing a memory leak.

    [rjw: Fixed compilation for CONFIG_PM_SLEEP unset.]

    Signed-off-by: Alan Stern
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     

21 Jan, 2010

1 commit

  • Borislav Petkov reports issues with duplicate sysfs endpoint files after a
    resume from a hibernate. It turns out that the code to support alternate
    settings under xHCI has issues when a device with a non-default alternate
    setting is reset during the hibernate:

    [ 427.681810] Restarting tasks ...
    [ 427.681995] hub 1-0:1.0: state 7 ports 6 chg 0004 evt 0000
    [ 427.682019] usb usb3: usb resume
    [ 427.682030] ohci_hcd 0000:00:12.0: wakeup root hub
    [ 427.682191] hub 1-0:1.0: port 2, status 0501, change 0000, 480 Mb/s
    [ 427.682205] usb 1-2: usb wakeup-resume
    [ 427.682226] usb 1-2: finish reset-resume
    [ 427.682886] done.
    [ 427.734658] ehci_hcd 0000:00:12.2: port 2 high speed
    [ 427.734663] ehci_hcd 0000:00:12.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT
    [ 427.746682] hub 3-0:1.0: hub_reset_resume
    [ 427.746693] hub 3-0:1.0: trying to enable port power on non-switchable hub
    [ 427.786715] usb 1-2: reset high speed USB device using ehci_hcd and address 2
    [ 427.839653] ehci_hcd 0000:00:12.2: port 2 high speed
    [ 427.839666] ehci_hcd 0000:00:12.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT
    [ 427.847717] ohci_hcd 0000:00:12.0: GetStatus roothub.portstatus [1] = 0x00010100 CSC PPS
    [ 427.915497] hub 1-2:1.0: remove_intf_ep_devs: if: ffff88022f9e8800 ->ep_devs_created: 1
    [ 427.915774] hub 1-2:1.0: remove_intf_ep_devs: bNumEndpoints: 1
    [ 427.915934] hub 1-2:1.0: if: ffff88022f9e8800: endpoint devs removed.
    [ 427.916158] hub 1-2:1.0: create_intf_ep_devs: if: ffff88022f9e8800 ->ep_devs_created: 0, ->unregistering: 0
    [ 427.916434] hub 1-2:1.0: create_intf_ep_devs: bNumEndpoints: 1
    [ 427.916609] ep_81: create, parent hub
    [ 427.916632] ------------[ cut here ]------------
    [ 427.916644] WARNING: at fs/sysfs/dir.c:477 sysfs_add_one+0x82/0x96()
    [ 427.916649] Hardware name: System Product Name
    [ 427.916653] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:12.2/usb1/1-2/1-2:1.0/ep_81'
    [ 427.916658] Modules linked in: binfmt_misc kvm_amd kvm powernow_k8 cpufreq_ondemand cpufreq_powersave cpufreq_userspace freq_table cpufreq_conservative ipv6 vfat fat
    +8250_pnp 8250 pcspkr ohci_hcd serial_core k10temp edac_core
    [ 427.916694] Pid: 278, comm: khubd Not tainted 2.6.33-rc2-00187-g08d869a-dirty #13
    [ 427.916699] Call Trace:

    The problem is caused by a mismatch between the USB core's view of the
    device state and the USB device and xHCI host's view of the device state.

    After the device reset and re-configuration, the device and the xHCI host
    think they are using alternate setting 0 of all interfaces. However, the
    USB core keeps track of the old state, which may include non-zero
    alternate settings. It uses intf->cur_altsetting to keep the endpoint
    sysfs files for the old state across the reset.

    The bandwidth allocation functions need to know what the xHCI host thinks
    the current alternate settings are, so original patch set
    intf->cur_altsetting to the alternate setting 0. This caused duplicate
    endpoint files to be created.

    The solution is to not set intf->cur_altsetting before calling
    usb_set_interface() in usb_reset_and_verify_device(). Instead, we add a
    new flag to struct usb_interface to tell usb_hcd_alloc_bandwidth() to use
    alternate setting 0 as the currently installed alternate setting.

    Signed-off-by: Sarah Sharp
    Tested-by: Borislav Petkov
    Cc: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     

12 Dec, 2009

4 commits

  • Refactor out the code to find alternate interface settings into
    usb_find_alt_setting(). Print a debugging message and return null if the
    alt setting is not found.

    While we're at it, correct a bug in the refactored code. The interfaces
    in the configuration's interface cache are not necessarily in numerical
    order, so we can't just use the interface number as an array index. Loop
    through the interface caches, looking for the correct interface.

    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • This patch (as1303) revises the USB Power Management infrastructure to
    make it compatible with the new driver-model Runtime PM framework:

    Drivers are no longer allowed to access intf->pm_usage_cnt
    directly; the PM framework manages its own usage counters.

    usb_autopm_set_interface() is eliminated, because it directly
    sets intf->pm_usage_cnt.

    usb_autopm_enable() and usb_autopm_disable() are eliminated,
    because they call usb_autopm_set_interface().

    usb_autopm_get_interface_no_resume() and
    usb_autopm_put_interface_no_suspend() are added. They
    correspond to pm_runtime_get_noresume() and
    pm_runtime_put_noidle() in the PM framework.

    The power/level attribute no longer accepts "suspend", only
    "on" and "auto". The PM framework doesn't allow devices to be
    forced into a suspended mode.

    The hub driver contains the only code that violates the new
    guidelines. It is updated to use the new interface routines instead.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1302) removes the auto_pm flag from struct usb_device.
    The flag's only purpose was to distinguish between autosuspends and
    external suspends, but that information is now available in the
    pm_message_t argument passed to suspend methods.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • The WHCI HCD will also support urbs with scatter-gather lists. Add a
    usb_bus field to indicated how many sg list elements are supported by
    the HCD. Use this to decide whether to pass the scatter-list to the HCD
    or not.

    Make the usb-storage driver use this new field.

    Signed-off-by: David Vrabel
    Cc: Alan Stern
    Cc: Sarah Sharp
    Cc: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    David Vrabel