08 Jan, 2009

40 commits

  • Expose knobs to control the stack's debug output.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Implements the three basic operations provided by the stack's control
    interface to WiMAX devices:

    - Messaging channel between user space and driver/device

    This implements a direct communication channel between user space
    and the driver/device, by which free form messages can be sent back
    and forth.

    This is intended for device-specific features, vendor quirks, etc.

    - RF-kill framework integration

    Provide most of the RF-Kill integration for WiMAX drivers so that
    all device drivers have to do is after wimax_dev_add() is call
    wimax_report_rfkill_{hw,sw}() to update initial state and then every
    time it changes.

    Provides wimax_rfkill() for the kernel to call to set software
    RF-Kill status and/or query current hardware and software switch
    status.

    Exports wimax_rfkill() over generic netlink to user space.

    - Reset a WiMAX device

    Provides wimax_reset() for the kernel to reset a wimax device as
    needed and exports it over generic netlink to user space.

    This API is clearly limited, as it still provides no way to do the
    basic scan, connect and disconnect in a hardware independent way. The
    WiMAX case is more complex than WiFi due to the way networks are
    discovered and provisioned.

    The next developments are to add the basic operations so they can be
    offerent by different drivers. However, we'd like to get more vendors
    to jump in and provide feedback of how the user/kernel API/abstraction
    layer should be.

    The user space code for the i2400m, as of now, uses the messaging
    channel, but that will change as the API evolves.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Add an EXPORT_SYMBOL() to genl_unregister_mc_group(), to allow
    unregistering groups on the run. EXPORT_SYMBOL_GPL() is not used as
    the rest of the functions exported by this module (eg:
    genl_register_mc_group) are also not _GPL().

    Cleanup is currently done when unregistering a family, but there is
    no way to unregister a single multicast group due to that function not
    being exported. Seems to be a mistake as it is documented as for
    external consumption.

    This is needed by the WiMAX stack to be able to cleanup unused mc
    groups.

    Signed-off-by: Inaky Perez-Gonzalez
    Acked-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Implements the basic life cycles of a 'struct wimax_dev', some common
    generic netlink functionality for marshalling calls to user space,
    and the device state machine.

    For looking up net devices based on their generic netlink family IDs,
    use a low overhead method that optimizes for the case where most
    systems have a single WiMAX device, or at most, a very low number of
    WiMAX adaptors.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This file contains a simple debug framework that is used in the stack;
    it allows the debug level to be controlled at compile-time (so the
    debug code is optimized out) and at run-time (for what wasn't compiled
    out).

    This is eventually going to be moved to use dynamic_printk(). Just
    need to find time to do it.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • This file contains declarations and definitions used by the different
    submodules of the stack.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • Definitions for the user/kernel API protocol through generic
    netlink. User space can copy it verbatim and use it.

    Kernel API definition declares the main data types and calls for the
    drivers to integrate into the WiMAX stack. Provides usage
    documentation.

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • wimax documentation

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • In the same spirit as debugfs_create_*(), introduce helpers for
    exporting size_t values over debugfs.

    The only trick done is that the format verifier is kept at %llu
    instead of %zu; otherwise type warnings would pop up:

    format ‘%zu’ expects type ‘size_t’, but argument 2 has type ‘long long unsigned int’

    There is no real way to fix this one--however, we can consider %llu
    and %zu to be compatible if we consider that we are using the same for
    validating in debugfs_create_{x,u}{8,16,32}().

    Signed-off-by: Inaky Perez-Gonzalez
    Signed-off-by: Greg Kroah-Hartman

    Inaky Perez-Gonzalez
     
  • USB should not be having it's own printk macros, so remove info() and
    use the system-wide standard of dev_info() wherever possible.

    No one in the tree is using the macro, so it can now be removed.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • USB should not be having it's own printk macros, so remove warn() and
    use the system-wide standard of dev_warn() wherever possible. In the
    few places that will not work out, use a basic printk().

    Now that all in-tree users are gone, remove the macro.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This driver got rescued from a few years ago and was requested to be
    added. So I cleaned it up, ported it to the latest kernel version and
    here it is.

    Cc: Thomas Hergenhahn
    Cc: Emmanuele
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This is for the serial mode of the Opticon barcode scanner.

    Cc: Kees Stoop
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Fix oops introduced by commit ae93a55bf948753de0bb8e43fa9c027f786abb05
    (emi26: use request_firmware()):

    usb 1-1: new full speed USB device using uhci_hcd and address 2
    usb 1-1: configuration #1 chosen from 1 choice
    emi26 - firmware loader 1-1:1.0: emi26_probe start
    usb 1-1: firmware: requesting emi26/loader.fw
    usb 1-1: firmware: requesting emi26/bitstream.fw
    usb 1-1: firmware: requesting emi26/firmware.fw
    usb 1-1: emi26_set_reset - 1
    usb 1-1: emi26_set_reset - 0
    BUG: unable to handle kernel NULL pointer dereference at 00000000
    IP: [] emi26_probe+0x2f7/0x620 [emi26]
    *pde = 00000000
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/firmware/1-1/loading
    Modules linked in: emi26(+) ipv6 cpufreq_ondemand coretemp arc4 ecb iwl3945 irtty_sir sir_dev nsc_ircc ehci_hcd uhci_hcd mac80211 irda usbcore snd_hda_intel thinkpad_acpi rfkill hwmon led_class e1000e snd_pcm cfg80211 snd_timer crc_ccitt snd snd_page_alloc aes_generic

    Pid: 5082, comm: modprobe Not tainted (2.6.28 #2) 17023QG
    EIP: 0060:[] EFLAGS: 00010206 CPU: 0
    EIP is at emi26_probe+0x2f7/0x620 [emi26]
    EAX: 0000015c EBX: 00000000 ECX: c1ffd9c0 EDX: 00000000
    ESI: 0000015c EDI: f6bb215c EBP: f6bb0400 ESP: f00ebcfc
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Process modprobe (pid: 5082, ti=f00ea000 task=f5c7c700 task.ti=f00ea000)
    Stack:
    0000015c 000000a5 f6a67cb8 f80dc7e0 c01c6262 fbef2986 f6bb2000 00008fe0
    0000015c f715f748 f715f740 f715f738 f715f748 f6a67c00 f80dd040 f80dcfc0
    f6bb0400 fbacb290 f6a67c94 fbae0160 c01c70bf 00000000 f6a67c1c 00000000
    Call Trace:
    [] sysfs_add_one+0x12/0x50
    [] usb_probe_interface+0xa0/0x140 [usbcore]
    [] sysfs_create_link+0xf/0x20
    [] driver_probe_device+0x82/0x180
    [] usb_match_id+0x3b/0x50 [usbcore]
    [] __driver_attach+0x7e/0x80
    [] bus_for_each_dev+0x3a/0x60
    [] driver_attach+0x16/0x20
    [] __driver_attach+0x0/0x80
    [] bus_add_driver+0x1a1/0x220
    [] driver_register+0x4d/0x120
    [] idr_get_empty_slot+0xf2/0x290
    [] usb_register_driver+0x81/0x100 [usbcore]
    [] emi26_init+0x0/0x14 [emi26]
    [] do_one_initcall+0x36/0x1b0
    [] sysfs_ilookup_test+0x0/0x10
    [] ifind+0x31/0x90
    [] __sysfs_add_one+0x59/0x80
    [] sysfs_addrm_finish+0x14/0x1c0
    [] __vunmap+0xa3/0xd0
    [] load_module+0x1544/0x1640
    [] sys_init_module+0x87/0x1b0
    [] sys_read+0x41/0x70
    [] sysenter_do_call+0x12/0x21
    [] wait_for_common+0x40/0x110
    Code: 66 c1 e8 08 66 09 d0 75 a5 31 d2 89 e8 e8 72 fc ff ff 85 c0 0f 88 9a 02 00 00 b8 fa 00 00 00 e8 30 46 05 c8 8b 74 24 28 8b 5e 04 03 89 44 24 1c 0f c8 89 44 24 1c 0f b7 4b 04 c7 44 24 20 00
    EIP: [] emi26_probe+0x2f7/0x620 [emi26] SS:ESP 0068:f00ebcfc
    ---[ end trace 2eefa13825431230 ]---

    After the last "package" of firmware data is sent to the device, we dereference
    NULL pointer (on access to rec->addr). Fix it.

    Reported--by: David Flatz
    Tested-by: David Flatz
    Signed-off-by: Marcin Slusarz
    Cc: David Woodhouse
    Cc: stable [2.6.27, 2.6.28]
    Signed-off-by: Greg Kroah-Hartman

    Marcin Slusarz
     
  • The usb gadget framework revealed weakness in the godu_udc
    gadget driver register function. Instead of checking if
    speed asked for was USB_LOW_SPEED upon usb_gadget_register()
    to deny service, it checked only for USB_FULL_SPEED, thus
    denying service to usb high speed capable gadgets.

    Signed-off-by: SangSu Park
    Acked-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    SangSu Park
     
  • One minor nit did show up, though. The patch below
    seems to make more sense than the code does without it.

    Signed-off-by: Mark Lord
    Signed-off-by: Greg Kroah-Hartman

    Mark Lord
     
  • This patch (as1197) fixes an error introduced recently. Since a
    significant number of devices can't handle Set-Interface requests, we
    no longer call usb_set_interface() when a driver unbinds from an
    interface, provided the interface is already in altsetting 0. However
    the interface still does get disabled, and the call to
    usb_set_interface() was the only thing re-enabling it. Since the
    interface doesn't get re-enabled, further attempts to use it fail.

    So the patch adds a call to usb_enable_interface() when a driver
    unbinds and the interface is in altsetting 0. For this to work
    right, the interface's endpoints have to be re-enabled but their
    toggles have to be left alone. Therefore an additional argument is
    added to usb_enable_endpoint() and usb_enable_interface(), a flag
    indicating whether or not the endpoint toggles should be reset.

    This is a forward-ported version of a patch which fixes Bugzilla
    #12301.

    Signed-off-by: Alan Stern
    Reported-by: David Roka
    Reported-by: Erik Ekman
    Tested-by: Erik Ekman
    Tested-by: Alon Bar-Lev
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1195) eliminates a potential problem identified by
    Oliver Neukum. When a driver queues an asynchronous Set-Config
    request using usb_driver_set_configuration(), the request should be
    cancelled if userspace changes the configuration first. The patch
    introduces a linked list of pending async Set-Config requests, and
    uses it to invalidate the requests for a particular device whenever
    that device's configuration is set.

    Signed-off-by: Alan Stern
    Cc: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1193b) enables wakeup during initialization for all PCI
    host controllers, and it removes some code (and comments!) that are no
    longer needed now that the PCI core automatically initializes wakeup
    settings for all new devices.

    The idea is that the bus should initialize wakeup, and the bus glue
    or controller driver should enable it.

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

    Alan Stern
     
  • This patch (as1192) rearranges the USB PCI host controller suspend and
    resume and resume routines:

    Use pci_wake_from_d3() for enabling and disabling wakeup,
    instead of pci_enable_wake().

    Carry out the actual state change while interrupts are
    disabled.

    Change the order of the preparations to agree with the
    general recommendation for PCI devices, instead of
    messing around with the wakeup settings while the device
    is in D3.

    In .suspend:
    Call the underlying driver to disable IRQ
    generation;
    pci_wake_from_d3(device_may_wakeup());
    pci_disable_device();

    In .suspend_late:
    pci_save_state();
    pci_set_power_state(D3hot);
    (for PPC_PMAC) Disable ASIC clocks

    In .resume_early:
    (for PPC_PMAC) Enable ASIC clocks
    pci_set_power_state(D0);
    pci_restore_state();

    In .resume:
    pci_enable_device();
    pci_set_master();
    pci_wake_from_d3(0);
    Call the underlying driver to reenable IRQ
    generation

    Add the necessary .suspend_late and .resume_early method
    pointers to the PCI host controller drivers.

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

    Alan Stern
     
  • This patch (as1194) makes usb-storage set the CAPACITY_HEURISTICS flag
    for all devices made by Nokia, Nikon, or Motorola. These companies
    seem to include the READ CAPACITY bug in all of their devices.

    Since cell phones and digital cameras rely on flash storage, which
    always has an even number of sectors, setting CAPACITY_HEURISTICS
    shouldn't cause any problems. Not even if the companies wise up and
    start making devices without the bug.

    A large number of unusual_devs entries are now unnecessary, so the
    patch removes them.

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

    Alan Stern
     
  • This patch (as1190) makes usb-storage's "quirks=" module parameter
    writable, so that users can add entries for their devices at runtime
    with no need to reboot or reload usb-storage.

    New codes are added for the SANE_SENSE, CAPACITY_HEURISTICS, and
    CAPACITY_OK flags.

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

    Alan Stern
     
  • This patch (as1189b) adds some hacks to usb-storage for dealing with
    the growing problems involving bad capacity values and last-sector
    accesses:

    A new flag, US_FL_CAPACITY_OK, is created to indicate that
    the device is known to report its capacity correctly. An
    unusual_devs entry for Linux's own File-backed Storage Gadget
    is added with this flag set, since g_file_storage always
    reports the correct capacity and since the capacity need
    not be even (it is determined by the size of the backing
    file).

    An entry in unusual_devs.h which has only the CAPACITY_OK
    flag set shouldn't prejudice libusual, since the device will
    work perfectly well with either usb-storage or ub. So a
    new macro, COMPLIANT_DEV, is added to let libusual know
    about these entries.

    When a last-sector access succeeds and the total number of
    sectors is odd (the unexpected case, in which guessing that
    the number is even might cause trouble), a WARN is triggered.
    The kerneloops.org project will collect these warnings,
    allowing us to add CAPACITY_OK flags for the devices in
    question before implementing the default-to-even heuristic.
    If users want to prevent the stack dump produced by the WARN,
    they can disable the hack by adding an unusual_devs entry
    for their device with the CAPACITY_OK flag.

    When a last-sector access fails three times in a row and
    neither the FIX_CAPACITY nor the CAPACITY_OK flag is set,
    we assume the last-sector bug is present. We replace the
    existing status and sense data with values that will cause
    the SCSI core to fail the access immediately rather than
    retry indefinitely. This should fix the difficulties
    people have been having with Nokia phones.

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

    Alan Stern
     
  • Add driver for the high speed USB-OTG transceiver in TI's TWL4030
    family of chips.

    Given this and various other pending patches, OMAP3 hardware like
    that from beagleboard.org, gumstix.com (Overo), and openpandora.org
    should now have basic USB host and peripheral connectivity with
    mainline kernels. Ditto for less widely-available boards.

    Signed-off-by: David Brownell
    Signed-off-by: Tony Lindgren
    Cc: Kevin Hilman
    Cc: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • Implementation of USB device driver integrated in Freescale's i.MXL
    processor.

    Adds USB device driver for i.MXL.

    Signed-off-by: Darius Augulis
    Signed-off-by: Greg Kroah-Hartman

    Darius Augulis
     
  • This extension allows unpoisoning an anchor allowing drivers that
    resubmit URBs to reuse an anchor for methods like resume()

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

    Oliver Neukum
     
  • There is no need to disable port 1 on ISP1761. That port could
    be used as an OTG port which would require a different init
    sequence. However we don't have OTG support (yet) so we can use
    it as a normal USB port.
    This patch allows port 1 to be used a normal Port on the ISP1761.

    Signed-off-by: Thomas Hommel
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Greg Kroah-Hartman

    Thomas Hommel
     
  • Many newer Option mobile broadband devices initially provide a
    usb-storage "driver CD" device that's pretty useless on Linux since
    any software on it most likely wouldn't be compatible with your
    kernel or distro anyway. Thus, by default just kill the driver
    CD device by sending the SCSI 'rezero' command, but allow override
    of the default behavior via usb-storage module parameter so users
    can keep the ZeroCD device if they really want to. Inspired by
    the Sierra TruInstall patch.

    Signed-off-by: Dan Williams
    Acked-by: Marcel Holtmann
    Cc: Peter Henn
    Cc: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Dan Williams
     
  • It is enough to protect accesses to reject field of urb
    by marking it as atomic_t,also it is the only reason of
    existence of usb_reject_lock,so remove the lock to make
    code more clean.

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

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

    Alan Stern
     
  • USB: make printk messages more searchable

    Make USB printk messages long and straightforward. One of these
    decorated USB error messages cost me non-trivial efforts to locate.

    Signed-off-by: Wu Fengguang
    Signed-off-by: Greg Kroah-Hartman

    Wu Fengguang
     
  • Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • Don't redefine the functions in musb driver

    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • Some config registers are not avaiable in Blackfin, we have to comment them out.

    v1-v2:
    - remove Blackfin specific header file
    - add Blackfin register version to musb_regs.h header file

    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • - DMA registers in Blackfin have different layout
    - DMA interrupt flags need to be cleared by software

    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • add Blackfin version low level register accessing helper functions

    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • Make sure we program the correct values in only when necessary.

    Signed-off-by: Robin Getz
    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Robin Getz
     
  • - replace MUSB_FIFOSIZE register to MUSB_TXCOUNT, cause no MUSB_FIFOSIZE
    register on Blackfin
    - use #ifdef to replace #if defined()

    Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • Signed-off-by: Bryan Wu
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu