pandora-kernel.git
17 years agoPCI: switch pci_{enable,disable}_device() to be nestable
Inaky Perez-Gonzalez [Wed, 22 Nov 2006 20:40:31 +0000 (12:40 -0800)]
PCI: switch pci_{enable,disable}_device() to be nestable

Changes the pci_{enable,disable}_device() functions to work in a
nested basis, so that eg, three calls to enable_device() require three
calls to disable_device().

The reason for this is to simplify PCI drivers for
multi-interface/capability devices. These are devices that cram more
than one interface in a single function. A relevant example of that is
the Wireless [USB] Host Controller Interface (similar to EHCI) [see
http://www.intel.com/technology/comms/wusb/whci.htm].

In these kind of devices, multiple interfaces are accessed through a
single bar and IRQ line. For that, the drivers map only the smallest
area of the bar to access their register banks and use shared IRQ
handlers.

However, because the order at which those drivers load cannot be known
ahead of time, the sequence in which the calls to pci_enable_device()
and pci_disable_device() cannot be predicted. Thus:

1. driverA     starts     pci_enable_device()
2. driverB     starts     pci_enable_device()
3. driverA     shutdown   pci_disable_device()
4. driverB     shutdown   pci_disable_device()

between steps 3 and 4, driver B would loose access to it's device,
even if it didn't intend to.

By using this modification, the device won't be disabled until all the
callers to enable() have called disable().

This is implemented by replacing 'struct pci_dev->is_enabled' from a
bitfield to an atomic use count. Each caller to enable increments it,
each caller to disable decrements it. When the count increments from 0
to 1, __pci_enable_device() is called to actually enable the
device. When it drops to zero, pci_disable_device() actually does the
disabling.

We keep the backend __pci_enable_device() for pci_default_resume() to
use and also change the sysfs method implementation, so that userspace
enabling/disabling the device doesn't disable it one time too much.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: arch/i386/kernel/pci-dma.c: ioremap balanced with iounmap
Amol Lad [Tue, 17 Oct 2006 04:32:50 +0000 (10:02 +0530)]
PCI: arch/i386/kernel/pci-dma.c: ioremap balanced with iounmap

ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.

Tested (compilation only):
- using allmodconfig
- making sure the files are compiling without any warning/error due to
new changes

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci/i386: style cleanups
Randy Dunlap [Tue, 17 Oct 2006 17:17:58 +0000 (10:17 -0700)]
pci/i386: style cleanups

Mostly CodingStyle cleanups for arch/i386/pci/i386.c:
- fit in 80 columns;
- use a #defined value instead of an inline constant;
Also change one resource_size_t (DBG) printk from %08lx to %lx since
it can be more than 32 bits (more than 8 hexits).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Block on access to temporarily unavailable pci device
Matthew Wilcox [Thu, 19 Oct 2006 15:41:28 +0000 (09:41 -0600)]
PCI: Block on access to temporarily unavailable pci device

The existing implementation of pci_block_user_cfg_access() was recently
criticised for providing out of date information and for returning errors
on write, which applications won't be expecting.

This reimplementation uses a global wait queue and a bit per device.
I've open-coded prepare_to_wait() / finish_wait() as I could optimise
it significantly by knowing that the pci_lock protected us at all points.

It looked a bit funny to be doing a spin_unlock_irqsave(); schedule(),
so I used spin_lock_irq() for the _user versions of pci_read_config and
pci_write_config.  Not carrying a flags pointer around made the code
much less nasty.

Attempts to block an already blocked device hit a BUG() and attempts to
unblock an already unblocked device hit a WARN().  If we need to block
access to a device from userspace, it's because it's unsafe for even
another bit of the kernel to access the device.  An attempt to block
a device for a second time means we're about to access the device to
perform some other operation, which could provoke undefined behaviour
from the device.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Adam Belay <abelay@novell.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci: fix __pci_register_driver error handling
Akinobu Mita [Thu, 9 Nov 2006 03:53:59 +0000 (19:53 -0800)]
pci: fix __pci_register_driver error handling

__pci_register_driver() error path forgot to unwind.
driver_unregister() needs to be called when pci_create_newid_file() failed.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci: clear osc support flags if no _OSC method
Kristen Carlson Accardi [Mon, 30 Oct 2006 21:08:12 +0000 (13:08 -0800)]
pci: clear osc support flags if no _OSC method

So it looks like pci aer code will call pci_osc_support_set to tell the
firmware about  OSC_EXT_PCI_CONFIG_SUPPORT flag.  that causes
ctrlset_buf[OSC_SUPPORT_TYPE] to evaluate to true when pciehp calls
pci_osc_control_set() is called (to attempt to use OSC to gain native
pcie control from firmware), regardless of whether or not _OSC was
actually successfully executed.  That causes this section of code:
 if (ctrlset_buf[OSC_SUPPORT_TYPE] &&
                ((global_ctrlsets & ctrlset) != ctrlset)) {
                return AE_SUPPORT;
        }
to be hit.

This patch will reset the OSC_SUPPORT_TYPE field if _OSC fails, and then
would allow pciehp to go ahead and try to run _OSC again.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: fix missing acpiphp_glue_exit()
Akinobu Mita [Mon, 30 Oct 2006 21:08:04 +0000 (13:08 -0800)]
acpiphp: fix missing acpiphp_glue_exit()

acpiphp_glue_exit() needs to be called to unwind when no slots found.
(It fixes data corruption when reloading acpiphp driver with no such devices)

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: fix use of list_for_each macro
Akinobu Mita [Mon, 30 Oct 2006 21:07:58 +0000 (13:07 -0800)]
acpiphp: fix use of list_for_each macro

This patch fixes invalid usage of list_for_each()

list_for_each (node, &bridge_list) {
bridge = (struct acpiphp_bridge *)node;
...
}

This code works while the member of list node is located at the
head of struct acpiphp_bridge.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoAltix: Initial ACPI support - ROM shadowing.
John Keller [Wed, 4 Oct 2006 21:49:52 +0000 (16:49 -0500)]
Altix: Initial ACPI support - ROM shadowing.

Support a shadowed ROM when running with an ACPI capable PROM.

Define a new dev.resource flag IORESOURCE_ROM_BIOS_COPY to
describe the case of a BIOS shadowed ROM, which can then
be used to avoid pci_map_rom() making an unneeded call to
pci_enable_rom().

Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoAltix: SN ACPI hotplug support.
John Keller [Wed, 4 Oct 2006 21:49:35 +0000 (16:49 -0500)]
Altix: SN ACPI hotplug support.

A few minor changes to the way slot/device fixup is done.

No need to be calling sn_pci_controller_fixup(), as
a root bus cannot be hotplugged.

Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoAltix: Add initial ACPI IO support
John Keller [Wed, 4 Oct 2006 21:49:25 +0000 (16:49 -0500)]
Altix: Add initial ACPI IO support

First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.

However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.

A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().

The size of io_space[] has been increased to support systems with
large IO configurations.

Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Delete unused extern in powermac/pci.c
Matthew Wilcox [Tue, 10 Oct 2006 14:01:22 +0000 (08:01 -0600)]
PCI: Delete unused extern in powermac/pci.c

This file no longer uses pci_cache_line_size, so delete the declaration

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Replace HAVE_ARCH_PCI_MWI with PCI_DISABLE_MWI
Matthew Wilcox [Tue, 10 Oct 2006 14:01:21 +0000 (08:01 -0600)]
PCI: Replace HAVE_ARCH_PCI_MWI with PCI_DISABLE_MWI

pSeries is the only architecture left using HAVE_ARCH_PCI_MWI and it's
really inappropriate for its needs.  It really wants to disable MWI
altogether.  So here are a pair of stub implementations for pci_set_mwi
and pci_clear_mwi.

Also rename pci_generic_prep_mwi to pci_set_cacheline_size since that
better reflects what it does.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Use pci_generic_prep_mwi on sparc64
Matthew Wilcox [Tue, 10 Oct 2006 14:01:20 +0000 (08:01 -0600)]
PCI: Use pci_generic_prep_mwi on sparc64

The setting of the CACHE_LINE_SIZE register in sparc64's pci
initialisation code isn't quite adequate as the device may have
incompatible requirements.  The generic code tests for this, so switch
sparc64 over to using it.

Since sparc64 has different L1 cache line size and PCI cache line size,
it would need to override the generic code like i386 and ia64 do.  We
know what the cache line size is at compile time though, so introduce a
new optional constant PCI_CACHE_LINE_BYTES.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: David Miller <davem@davemloft.net>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Use pci_generic_prep_mwi on ia64
Matthew Wilcox [Tue, 10 Oct 2006 14:01:19 +0000 (08:01 -0600)]
PCI: Use pci_generic_prep_mwi on ia64

The pci_generic_prep_mwi() code does everything that pcibios_prep_mwi()
does on ia64.  All we need to do is be sure that pci_cache_line_size
is set appropriately, and we can delete pcibios_prep_mwi().

Using SMP_CACHE_BYTES as the default was wrong on uniprocessor machines
as it is only 8 bytes.  The default in the generic code of L1_CACHE_BYTES
is at least as good.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: quirks: fix the festering mess that claims to handle IDE quirks
Alan Cox [Tue, 3 Oct 2006 23:41:26 +0000 (00:41 +0100)]
PCI: quirks: fix the festering mess that claims to handle IDE quirks

The number of permutations of crap we do is amazing and almost all of it
has the wrong effect in 2.6.

At the heart of this is the PCI SFF magic which says that compatibility
mode PCI IDE controllers use ISA IRQ routing and hard coded addresses
not the BAR values. The old quirks variously clears them, sets them,
adjusts them and then IDE ignores the result.

In order to drive all this garbage out and to do it portably we need to
handle the SFF rules directly and properly. Because we know the device
BAR 0-3 are not used in compatibility mode we load them with the values
that are implied (and indeed which many controllers actually
thoughtfully put there in this mode anyway).

This removes special cases in the IDE layer and libata which now knows
that bar 0/1/2/3 always contain the correct address. It means our
resource allocation map is accurate from boot, not "mostly accurate"
after ide is loaded, and it shoots lots of code. There is also lots more
code and magic constant knowledge to shoot once this is in and settled.

Been in my test tree for a while both with drivers/ide and with libata.
Wants some -mm shakedown in case I've missed something dumb or there are
corner cases lurking.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: save/restore PCI-X state
Stephen Hemminger [Thu, 9 Nov 2006 00:17:15 +0000 (16:17 -0800)]
PCI: save/restore PCI-X state

Shouldn't PCI-X state be saved/restored?  No device really needs this
right now. qla24xx (fc HBA) and mthca (infiniband) don't do suspend,
and sky2 resets its tweaks when links are brought up.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Make some MSI-X #defines generic
Michael Ellerman [Tue, 7 Nov 2006 07:21:21 +0000 (18:21 +1100)]
PCI: Make some MSI-X #defines generic

Move some MSI-X #defines into pci_regs.h so they can be used
outside of drivers/pci.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Let PCI_MULTITHREAD_PROBE not be broken
Greg Kroah-Hartman [Fri, 27 Oct 2006 23:12:30 +0000 (16:12 -0700)]
PCI: Let PCI_MULTITHREAD_PROBE not be broken

It's not really broken, but people keep running into other problems
caused by it.  Re-enable it so that the drivers get stress tested.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: remove unused argument in autosuspend
Alan Stern [Mon, 20 Nov 2006 16:38:46 +0000 (11:38 -0500)]
usbcore: remove unused argument in autosuspend

Thanks to several earlier patches, usb_autosuspend_device() and
usb_autoresume_device() are never called with a second argument other
than 1.  This patch (as819) removes the now-redundant argument.

It also consolidates some common code between those two routines,
putting it into a new subroutine called usb_autopm_do_device().  And
it includes a sizable kerneldoc update for the affected functions.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: keep count of unsuspended children
Alan Stern [Wed, 22 Nov 2006 21:55:54 +0000 (16:55 -0500)]
USB: keep count of unsuspended children

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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB hub: simplify remote-wakeup handling
Alan Stern [Mon, 20 Nov 2006 16:14:30 +0000 (11:14 -0500)]
USB hub: simplify remote-wakeup handling

This patch (as817) simplifies the remote-wakeup processing in the hub
driver.  Now instead of using a specialized code path, it relies on
the standard USB resume routines.  The hub_port_resume() function does
an initial get_port_status() to see whether the port has already
resumed itself (as it does when a remote-wakeup request is sent).
This will slow down handling of other resume events slightly, but not
enough to matter.

The patch also changes the hub_port_status() routine, making it return
an error if a short reply is received.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: struct usb_device: change flag to bitflag
Alan Stern [Mon, 20 Nov 2006 16:12:22 +0000 (11:12 -0500)]
USB: struct usb_device: change flag to bitflag

This patch (as816) changes an existing flag in the usb_device
structure to a bitflag, preparing the way for more bitflags to come
in the future.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoOHCI: make autostop conditional on CONFIG_PM
Alan Stern [Mon, 20 Nov 2006 16:06:59 +0000 (11:06 -0500)]
OHCI: make autostop conditional on CONFIG_PM

Unlike UHCI, OHCI does not exert any DMA load on the system when no
devices are connected.  Consequently there is no advantage to doing
an autostop other than the power savings, so we shouldn't compile the
necessary code unless CONFIG_PM is enabled.

This patch (as820) makes the root-hub suspend and resume routines
conditional on CONFIG_PM.  It also prevents autostop from activating
if the device_may_wakeup flag isn't set; some people use this flag to
alert the driver about Resume-Detect bugs in the hardware.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Add autosuspend support to the hub driver
Alan Stern [Thu, 9 Nov 2006 19:44:33 +0000 (14:44 -0500)]
USB: Add autosuspend support to the hub driver

This patch (as742b) adds autosuspend/autoresume support to the USB hub
driver.  The largest aspect of the change is that we no longer need a
special flag for root hubs that want to be resumed.  Now every hub is
autoresumed whenever khubd needs to access it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoEHCI: Fix root-hub and port suspend/resume problems
Alan Stern [Thu, 9 Nov 2006 19:42:16 +0000 (14:42 -0500)]
EHCI: Fix root-hub and port suspend/resume problems

This patch (as738b) fixes numerous problems in the controller/root-hub
suspend/resume/remote-wakeup support in ehci-hcd:

The bus_resume() routine should wake up only the ports that
were suspended by bus_suspend().  Ports that were already
suspended should remain that way.

The interrupt mask is used to detect loss of power in the
bus_resume() routine (if the mask is 0 then power was lost).
However bus_suspend() always sets the mask to 0.  Instead the
mask should retain its normal value, with port-change-detect
interrupts disabled if remote wakeup is turned off.

The interrupt mask should be reset to its correct value at the
end of bus_resume() regardless of whether power was lost.

bus_resume() reinitializes the operational registers if power
was lost.  However those registers are not in the aux power
well, hence they can lose their values whenever the controller
is put into D3.  They should always be reinitialized.

When a port-change interrupt occurs and the root hub is
suspended, the interrupt handler should request a root-hub
resume instead of starting up the controller all by itself.

There's no need for the interrupt handler to request a
root-hub resume every time a suspended port sends a
remote-wakeup request.

The pci_resume() method doesn't need to check for connected
ports when deciding whether or not to reset the controller.
It can make that decision based on whether Vaux power was
maintained.

Even when the controller does not need to be reset,
pci_resume() must undo the effect of pci_suspend() by
re-enabling the interrupt mask.

If power was lost, pci_resume() must not call ehci_run().
At this point the root hub is still supposed to be suspended,
not running.  It's enough to rewrite the command register and
set the configured_flag.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: create a new thread for every USB device found during the probe sequence
Greg Kroah-Hartman [Fri, 11 Aug 2006 08:55:12 +0000 (01:55 -0700)]
USB: create a new thread for every USB device found during the probe sequence

Might speed up some systems.  If nothing else, a bad driver should not
take the whole USB subsystem down with it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add driver for the USB debug devices
Greg Kroah-Hartman [Tue, 9 Apr 2002 19:14:34 +0000 (12:14 -0700)]
USB: add driver for the USB debug devices

It's a simple usb-serial driver that just creates a tty device to read
and write from.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: added dynamic major number for USB endpoints
Sarah Bailey [Sun, 19 Nov 2006 06:30:16 +0000 (22:30 -0800)]
USB: added dynamic major number for USB endpoints

This patch is an update for Greg K-H's proposed usbfs2:
http://sourceforge.net/mailarchive/message.php?msg_id=19295229

It creates a dynamic major for USB endpoints and fixes
the endpoint minor calculation.

Signed-off-by: Sarah Bailey <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: pegasus error path not resetting task's state
Oliver Neukum [Thu, 23 Nov 2006 14:40:17 +0000 (15:40 +0100)]
USB: pegasus error path not resetting task's state

there is an error path in the pegasus driver which can leave
the task in TASK_UNINTERRUPTIBLE. Depending on when it
schedules next, this can be bad.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: endianness fix for asix.c
Oliver Neukum [Thu, 23 Nov 2006 11:45:31 +0000 (12:45 +0100)]
USB: endianness fix for asix.c

the latest update for asix.c reverted some endianness fixes. This
reinstates them.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: build the appledisplay driver
Adrian Bunk [Fri, 24 Nov 2006 02:24:03 +0000 (03:24 +0100)]
USB: build the appledisplay driver

We do already have both the code and a config option, so why not build
this driver?  ;-)

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB serial: replace kmalloc+memset with kzalloc
Burman Yan [Wed, 22 Nov 2006 18:54:38 +0000 (20:54 +0200)]
USB serial: replace kmalloc+memset with kzalloc

Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <yan_952@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: hid-core: canonical defines for Apple USB device IDs
Julien BLACHE [Wed, 15 Nov 2006 05:00:17 +0000 (00:00 -0500)]
USB: hid-core: canonical defines for Apple USB device IDs

Use canonical defines for the Apple USB device IDs.
Also add the Geyser IV devices missing in my previous patch.

Signed-off-by: Julien BLACHE <jb@jblache.org>
Acked-by: Dmitry Torokhov <dtor@insightbb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: idmouse cleanup
Mariusz Kozlowski [Mon, 6 Nov 2006 16:37:20 +0000 (17:37 +0100)]
USB: idmouse cleanup

Just digging through code and found these needless variable initializations. So here is the patch.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: make drivers/usb/core/driver.c:usb_device_match() static
Adrian Bunk [Tue, 21 Nov 2006 21:02:54 +0000 (22:02 +0100)]
USB: make drivers/usb/core/driver.c:usb_device_match() static

usb_device_match() can now become static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: lh7a40x_udc remove double declaration
David Brownell [Mon, 20 Nov 2006 19:41:39 +0000 (11:41 -0800)]
USB: lh7a40x_udc remove double declaration

Remove minor double-declaration goof.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: pxa2xx_udc recognizes ixp425 rev b0 chip
David Brownell [Mon, 20 Nov 2006 19:38:57 +0000 (11:38 -0800)]
USB: pxa2xx_udc recognizes ixp425 rev b0 chip

Make the pxa2xx_udc driver recognize a newer revision of the IXP425 chip.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbtouchscreen: add support for DMC TSC-10/25 devices
Holger Schurig [Fri, 17 Nov 2006 21:50:15 +0000 (22:50 +0100)]
usbtouchscreen: add support for DMC TSC-10/25 devices

Adds support for the DMC TSC-10 and TSC-25 usb touchscreen controllers.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ftdi-elan.c: fixes and cleanups
Adrian Bunk [Mon, 20 Nov 2006 02:24:44 +0000 (03:24 +0100)]
USB: ftdi-elan.c: fixes and cleanups

This patch contains the following possible cleanups:
- make the needlessly global ftdi_release_platform_dev() static
- remove the unused usb_ftdi_elan_read_reg()
- proper prototypes for the following functions:
  - usb_ftdi_elan_read_pcimem()
  - usb_ftdi_elan_write_pcimem()

Note that the misplaced prototypes for the latter ones in
drivers/usb/host/u132-hcd.c were buggy. Depending on the calling
convention of the architecture calling one of them could have turned
your stack into garbage.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: make drivers/usb/host/u132-hcd.c:u132_hcd_wait static
Adrian Bunk [Mon, 20 Nov 2006 02:23:54 +0000 (03:23 +0100)]
USB: make drivers/usb/host/u132-hcd.c:u132_hcd_wait static

This patch makes the needlessly global "u132_hcd_wait" static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: cypress_m8 init error path fix
Mariusz Kozlowski [Fri, 17 Nov 2006 16:49:22 +0000 (17:49 +0100)]
usb: cypress_m8 init error path fix

If at some point cypress_init() fails deregister
only the resources that were registered until that point.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add ehci_hcd.ignore_oc parameter
David Brownell [Fri, 17 Nov 2006 07:34:58 +0000 (23:34 -0800)]
USB: add ehci_hcd.ignore_oc parameter

Certain boards seem to like to issue false overcurrent notifications, for
example on ports that don't have anything connected to them.  This looks
like a hardware error, at the level of noise to those ports' overcurrent
input signals (or non-debounced VBUS comparators).  This surfaces to users
as truly massive amounts of syslog spam from khubd (which is appropriate
for real hardware problems, except for the volume from multiple ports).

Using this new "ignore_oc" flag helps such systems work more sanely, by
preventing such indications from getting to khubd (and spam syslog).  The
downside is of course that true overcurrent errors will be masked; they'll
appear as spontaneous disconnects, without the diagnostics that will let
users troubleshoot issues like short circuited cables.

Note that the bulk of these reports seem to be with VIA southbridges, but
I think some were with Intel ones.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: EHCI hooks for high speed electrical tests
David Brownell [Fri, 17 Nov 2006 07:56:15 +0000 (23:56 -0800)]
USB: EHCI hooks for high speed electrical tests

EHCI hooks for high speed electrical tests of the root hub ports.

The expectation is that a usermode program actually triggers the test,
making the same control request it would make for an external hub.
Tests for peripheral upstream ports would issue a different request.
In all cases, the hardware needs re-initialization before it could
be used "normally" again (e.g. unplug/replug, rmmod/modprobe).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: net2280: don't send unwanted zero-length packets
Alan Stern [Thu, 16 Nov 2006 15:16:00 +0000 (10:16 -0500)]
USB: net2280: don't send unwanted zero-length packets

The net2280 driver is too eager to send zero-length packets when
IN tokens are received on ep0.  No such packet should be sent (the
driver should NAK) before the gadget driver has queued the proper
response.  Otherwise deferred responses are impossible.

This patch (as823) makes net2280 avoid sending ZLPs for IN transfers
on ep0 until a response has been submitted, and avoids stalling when an
OUT packet is received before a request has been submitted for an OUT
transfer on ep0.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: microtek possible memleak fix
Mariusz Kozlowski [Fri, 17 Nov 2006 10:53:23 +0000 (11:53 +0100)]
usb: microtek possible memleak fix

Possible memleak fix on error path. The changes:

- out_kfree2 and out_free_urb replaced
- missing scsi_host_put() added

Here it goes:

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add Digitech USB-Storage to unusual_devs.h
Jaco Kroon [Wed, 15 Nov 2006 09:02:08 +0000 (01:02 -0800)]
USB: add Digitech USB-Storage to unusual_devs.h

The mass storage device from Digitech designed for Flash Cards, as found
on (for example) the GNX4 device has issues with residue, similar to the
bug report at http://kerneltrap.org/node/6297.  This patch adds the
faulty storage device to unusual_devs.h, this not only reduces the noise
in dmesg but also increases the transfer speeds by a factor of 7x for me
(89kB/s -> 637kB/s).

T:  Bus=02 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1210 ProdID=0003 Rev= 1.00
S:  Manufacturer=DigiTech HMG
S:  Product=DigiTech Mass Storage
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Signed-off-by: Jaco Kroon <jaco@kroon.co.za>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB core: fix compiler warning about usb_autosuspend_work
Alan Stern [Mon, 13 Nov 2006 20:02:04 +0000 (15:02 -0500)]
USB core: fix compiler warning about usb_autosuspend_work

This patch (as821) fixes a compiler warning when CONFIG_PM isn't on
("usb_autosuspend_work" defined but not used).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: fix aircable.c: inconsequent NULL checking
Naranjo Manuel Francisco [Wed, 15 Nov 2006 18:14:27 +0000 (15:14 -0300)]
USB: fix aircable.c: inconsequent NULL checking

> 2006/11/11, Adrian Bunk <bunk@stusta.de>:
> > The Coverity checker spotted the following in
> > drivers/usb/serial/aircable.c:
> >
> > <--  snip  -->
> >
> > ...
> > static void aircable_read(void *params)
> > {
> > ...

Hi everyone,
Sorry for the long time response but here is the patch, I think this way should
work, if anyone has any suggestion let me know. What I do now is, in case I
don't have the tty available I reschedule the work, I have tried it and it
works with no problem, I even tried removing the device, and didn't find
anything strange.

Signed-off-by: Naranjo Manuel <naranjo.manuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoOHCI: change priority level of resume log message
Alan Stern [Mon, 6 Nov 2006 17:05:00 +0000 (12:05 -0500)]
OHCI: change priority level of resume log message

All the other root-hub suspend or resume log messages, in ohci-hcd or
any of the other host controller drivers, use the debug priority
level.  This patch (as815) makes the one single exception behave like
all the rest.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: usbmixer free kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:37:04 +0000 (15:37 +0100)]
usb: usbmixer free kill urb cleanup

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: usbmidi kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:37:00 +0000 (15:37 +0100)]
usb: usbmidi kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: visor kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:55 +0000 (15:36 +0100)]
usb: visor kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: usb-serial free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:51 +0000 (15:36 +0100)]
usb: usb-serial free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: navman kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:46 +0000 (15:36 +0100)]
usb: navman kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: mct_u232 free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:42 +0000 (15:36 +0100)]
usb: mct_u232 free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: kobil_sct kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:38 +0000 (15:36 +0100)]
usb: kobil_sct kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: keyspan free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:34 +0000 (15:36 +0100)]
usb: keyspan free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: io_edgeport kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:29 +0000 (15:36 +0100)]
usb: io_edgeport kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: catc free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:22 +0000 (15:36 +0100)]
usb: catc free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: ftdi_sio kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:25 +0000 (15:36 +0100)]
usb: ftdi_sio kill urb cleanup

- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: phidgetmotorcontrol free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:18 +0000 (15:36 +0100)]
usb: phidgetmotorcontrol free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: phidgetkit free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:07 +0000 (15:36 +0100)]
usb: phidgetkit free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: legousbtower free kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:14 +0000 (15:36 +0100)]
usb: legousbtower free kill urb cleanup

Hello,

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: auerswald free kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:36:03 +0000 (15:36 +0100)]
usb: auerswald free kill urb cleanup

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: usbkbd free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:58 +0000 (15:35 +0100)]
usb: usbkbd free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: hid-core free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:54 +0000 (15:35 +0100)]
usb: hid-core free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: ati_remote2 free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:50 +0000 (15:35 +0100)]
usb: ati_remote2 free urb cleanup

Hello,

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: ati_remote free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:46 +0000 (15:35 +0100)]
usb: ati_remote free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: zd1201 free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:42 +0000 (15:35 +0100)]
usb: zd1201 free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: irda-usb free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:38 +0000 (15:35 +0100)]
usb: irda-usb free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: zc0301_core free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:12 +0000 (15:35 +0100)]
usb: zc0301_core free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: quickcam_messenger free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:35:02 +0000 (15:35 +0100)]
usb: quickcam_messenger free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: sn9c102_core free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:59 +0000 (15:34 +0100)]
usb: sn9c102_core free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: pwc-if free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:55 +0000 (15:34 +0100)]
usb: pwc-if free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: pvrusb2-io free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:50 +0000 (15:34 +0100)]
usb: pvrusb2-io free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: pvrusb2-hdw free unlink urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:31 +0000 (15:34 +0100)]
usb: pvrusb2-hdw free unlink urb cleanup

- usb_free_urb() cleanup
- usb_unlink_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: ttusb_dec free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:27 +0000 (15:34 +0100)]
usb: ttusb_dec free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: cinergyT2 free kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:22 +0000 (15:34 +0100)]
usb: cinergyT2 free kill urb cleanup

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: usb-gigaset free kill urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:17 +0000 (15:34 +0100)]
usb: usb-gigaset free kill urb cleanup

- usb_free_urb() cleanup
- usb_kill_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: iforce-usb free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:09 +0000 (15:34 +0100)]
usb: iforce-usb free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: pcwd_usb free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:34:02 +0000 (15:34 +0100)]
usb: pcwd_usb free urb cleanup

- usb_free_urb() cleanup

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: writing_usb_driver free urb cleanup
Mariusz Kozlowski [Wed, 8 Nov 2006 14:33:38 +0000 (15:33 +0100)]
usb: writing_usb_driver free urb cleanup

Allright. As Greg KH suggested I split this big patch into smaller ones to
make the changes easier to review. Having no better idea how to split that I
split it on a 'patch per file' basis. All those patches clean redundant 'if' before
usb_unlink/free/kill_urb():

if (urb)
usb_free_urb(urb); /* unlink / free / kill */

I decided not to touch bigger 'if's like

if (urb) {
usb_kill_urb(urb);
usb_free_urb(urb);
urb = NULL;
}

as that would be probably too intrusive. One of patches also fixes
drivers/usb/misc/auerswald.c memleak I found when digging the code. All those
patches are against 2.6.19-rc4.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: pwc-if loop fix
Mariusz Kozlowski [Thu, 16 Nov 2006 15:38:57 +0000 (16:38 +0100)]
USB: pwc-if loop fix

We should free urbs starting at [i-1] not [i].

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb-serial: ti_usb, TI ez430 development tool ID
Oleg Verych [Fri, 17 Nov 2006 08:21:27 +0000 (08:21 +0000)]
usb-serial: ti_usb, TI ez430 development tool ID

usb-serial: ti_usb, TI ez430 development tool ID

Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: airprime: New device ID
daniel@centurion.net.nz [Sat, 11 Nov 2006 02:47:52 +0000 (15:47 +1300)]
USB: airprime: New device ID

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: make drivers/usb/input/wacom_sys.c:wacom_sys_irq() static
Adrian Bunk [Mon, 20 Nov 2006 02:23:58 +0000 (03:23 +0100)]
USB: make drivers/usb/input/wacom_sys.c:wacom_sys_irq() static

This patch makes the needlessly global wacom_sys_irq() static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: resume_device symbol conflict
Stephen Hemminger [Tue, 14 Nov 2006 18:06:17 +0000 (10:06 -0800)]
USB: resume_device symbol conflict

Several functions in USB core overlap with global functions.
The linker appears to do the right thing, but it is bad practice and makes
debugging harder.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb/gadget/ether.c minor manycast tweaks
David Brownell [Mon, 13 Nov 2006 02:09:44 +0000 (18:09 -0800)]
usb/gadget/ether.c minor manycast tweaks

Minor cleanup/clarification in the ethernet gadget driver, using standard
calls to test for Ethernet multicast and broadcast addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Move private hub declarations out of public header file
Alan Stern [Mon, 6 Nov 2006 16:56:13 +0000 (11:56 -0500)]
USB: Move private hub declarations out of public header file

This patch (as809b) moves the declaration of the hub driver's private
data structure from hub.h into the hub.c source file.  Lots of other
files import hub.h; they have no need to know about the details of the
hub driver's private data.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: net1080: Fix && typos
Jean Delvare [Thu, 9 Nov 2006 21:02:37 +0000 (22:02 +0100)]
USB: net1080: Fix && typos

Fix STATUS_PACKETS_* macros, where "&&" was mistakenly used where
"&" should have.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: expand autosuspend/autoresume API
Alan Stern [Mon, 30 Oct 2006 22:07:51 +0000 (17:07 -0500)]
USB: expand autosuspend/autoresume API

This patch (as814) adds usb_autopm_set_interface() to the autosuspend
API.  It also provides convenient wrapper routines,
usb_autopm_enable() and usb_autopm_disable(), for drivers that want
to specify directly whether autosuspend should be allowed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: autosuspend code consolidation
Alan Stern [Mon, 30 Oct 2006 22:06:45 +0000 (17:06 -0500)]
USB: autosuspend code consolidation

This patch (as813) gathers together common code for USB interface
autosuspend/autoresume.

It also adds some simple checking at the time an autosuspend request
is made, to see whether the request will fail.  This way we don't
add a workqueue entry when it would end up doing nothing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: makes usb_endpoint_* functions inline.
Luiz Fernando N. Capitulino [Mon, 30 Oct 2006 17:53:03 +0000 (14:53 -0300)]
USB: makes usb_endpoint_* functions inline.

We have no benefits of having the usb_endpoint_* functions as functions,
but making them inline saves text and data segment sizes:

text    data     bss     dec     hex filename
14893634 3108770 1108840 19111244 1239d4c vmlinux.func
14893185 3108566 1108840 19110591 1239abf vmlinux.inline

 This is the result of a 2.6.19-rc3 kernel compiled with GCC 4.1.1 without
CONFIG_MODULES, CONFIG_CC_OPTIMIZE_FOR_SIZE, CONFIG_REGPARM options set.
USB support is fully enabled (while most of the other drivers are not),
and that kernel has most of the USB code ported to use the endpoint
functions.

That happens because a call to those functions are expensive (in terms
of bytes), while the function's size is smaller or have the same 'size' of
the call.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: yealink: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:03:04 +0000 (13:03 -0300)]
USB: yealink: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: storage: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:03:03 +0000 (13:03 -0300)]
USB: storage: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usbtest: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:03:02 +0000 (13:03 -0300)]
USB: usbtest: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usbnet: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:03:01 +0000 (13:03 -0300)]
USB: usbnet: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usbmouse: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:03:00 +0000 (13:03 -0300)]
USB: usbmouse: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usbkbd: Use usb_endpoint_* functions
Luiz Fernando N. Capitulino [Thu, 26 Oct 2006 16:02:59 +0000 (13:02 -0300)]
USB: usbkbd: Use usb_endpoint_* functions

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>