18 Dec, 2007

1 commit

  • Fix kernel-doc warning in usb.h:
    Warning(linux-2.6.24-rc3-git7//include/linux/usb.h:166): No description found for parameter 'sysfs_files_created'

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

    Randy Dunlap
     

29 Nov, 2007

1 commit

  • This patch (as1009) solves the problem of multiple registrations for
    USB sysfs files in a more satisfying way than the existing code. It
    simply adds a flag to keep track of whether or not the files have been
    created; that way the files can be created or removed as needed.

    Signed-off-by: Alan Stern

    Alan Stern
     

13 Oct, 2007

11 commits

  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • 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
    transparent.

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

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

31 Jul, 2007

1 commit

  • Add kernel-doc entries in for:

    Warning(linux-2.6.22-git12//include/linux/usb.h:162): No description found for parameter 'intf_assoc'
    Warning(linux-2.6.22-git12//include/linux/usb.h:268): No description found for parameter 'intf_assoc[USB_MAXIADS]'

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

    Randy Dunlap
     

13 Jul, 2007

7 commits

  • 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: Craig W. Nadler
    Signed-off-by: Greg Kroah-Hartman

    Craig W. Nadler
     
  • 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: Marcel Holtmann
    Signed-off-by: Greg Kroah-Hartman

    Marcel Holtmann
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Jiri Kosina
    CC: Matthew Dharm
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • - introduction of usb_anchor and its methods

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     
  • 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: Daniel Drake
    Signed-off-by: Greg Kroah-Hartman

    Daniel Drake
     
  • This patch (as886) adds the controversial USB-persist facility,
    allowing USB devices to persist across a power loss during system
    suspend.

    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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

10 Jul, 2007

1 commit


09 May, 2007

1 commit


28 Apr, 2007

4 commits

  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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
    devices.

    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
    platform-pointer.
    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:
    add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1
    ACTION=add
    DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1
    SUBSYSTEM=usb
    SEQNUM=1533
    MAJOR=189
    MINOR=131
    DEVTYPE=usb_device
    PRODUCT=46d/c03e/2000
    TYPE=0/0/0
    BUSNUM=002
    DEVNUM=004

    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. :)
    https://bugzilla.novell.com/show_bug.cgi?id=250659

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • 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: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

24 Feb, 2007

2 commits

  • 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
    autosuspend.

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

    Alan Stern
     
  • This adds a blacklist to the USB core to handle some autosuspend and
    string issues that devices have.

    Originally written by Oliver, but hacked up a lot by Greg.

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     

17 Feb, 2007

1 commit


08 Feb, 2007

8 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits)
    USB: remove duplicate device id from zc0301
    USB: remove duplicate device id from usb_storage
    USB: remove duplicate device id from keyspan
    USB: remove duplicate device id from ftdi_sio
    USB: remove duplicate device id from visor
    USB: a bit more coding style cleanup
    usbcore: trivial whitespace fixes
    usb-storage: use first bulk endpoints, not last
    EHCI: fix interrupt-driven remote wakeup
    USB: switch ehci-hcd to new polling scheme
    USB: autosuspend for usb printer driver
    USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products
    USB: Sierra Wireless auto set D0
    USB: usb ethernet gadget recognizes HUSB2DEV
    USB: list atmel husb2_udc gadget controller
    USB: gadgetfs AIO tweaks
    USB: gadgetfs behaves better on userspace init bug
    USB: gadgetfs race fix
    USB: gadgetfs simplifications
    USB: gadgetfs cleanups
    ...

    Linus Torvalds
     
  • This patch (as841) removes from usbcore a couple of support routines
    meant to help with bandwidth allocation. With the changes to uhci-hcd
    in the previous patch, these routines are no longer used anywhere.
    Also removed is the CONFIG_USB_BANDWIDTH option; it no longer does
    anything and is no longer needed since the HCDs now handle bandwidth
    issues correctly.

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

    Alan Stern
     
  • Added a function to check if an endpoint is a control endpoint.
    There were similar functions for bulk, interrupt, and isoc,
    but not for control endpoints.

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

    Sarah Bailey
     
  • Thanks to Johannes Hölzl for fixing a few
    things and getting it all working properly.

    This adds support for dynamic usb ids to the usb serial core. The file
    "new_id" will show up under the usb serial driver, not the usb driver
    associated with the usb-serial driver (yeah, it can be a bit confusing
    at first glance...)

    This patch also modifies the USB core to allow the usb-serial core to
    reuse much of the dynamic id logic.

    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Johannes Hölzl

    Greg Kroah-Hartman
     
  • This moves to to reduce some of the
    clutter of usb header files.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This moves the usb class devices that control the usbfs nodes to show up
    in the proper place in the larger device tree.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This adds the module name to all USB drivers, if they are built into the
    kernel or not. It will show up in /sys/modules/MODULE_NAME/drivers/

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

05 Dec, 2006

1 commit


02 Dec, 2006

1 commit

  • This patch (as818b) simplifies autosuspend processing by keeping track
    of the number of unsuspended children of each USB hub. This will
    permit us to avoid a good deal of unnecessary work all the time; we
    will no longer have to create a bunch of workqueue entries to carry
    out autosuspend requests, only to have them fail because one of the
    hub's children isn't suspended.

    The basic idea is simple. There already is a usage counter in the
    usb_device structure for preventing autosuspends. The patch just
    increments that counter for every unsuspended child. There's only one
    tricky part: When a device disconnects we need to remember whether it
    was suspended at the time (leave the counter alone) or not (decrement
    the counter).

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

    Alan Stern