linux-2.6
18 years agoUSB: usb serial gadget smp related bug
Eugeny S. Mints [Sat, 2 Sep 2006 10:59:19 +0000 (03:59 -0700)] 
USB: usb serial gadget smp related bug

Adjust dev->dev_lock spinlock lock/unlock calls to be safe for SMP case.
Otherwise the following sequence may lead to a deadlock in SMP case:

gs_send()->usb_ep_queue()
->(in case a request is satisfied immediatly) gs_write_complete()

for ex for pxa2xx_udc.c:
usb_ep_queue()->pxa2xx_ep_queue()->write_fifo()->done()->gs_write_complete()
(through req.complete pointer)

Signed-off-by: Eugeny S. Mints <emints@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: replace kernel_thread() with kthread_run() in libusual.c
Matthew Dharm [Thu, 31 Aug 2006 20:37:29 +0000 (13:37 -0700)] 
USB: replace kernel_thread() with kthread_run() in libusual.c

Replaced kernel_thread() with kthread_run() since kernel_thread() is
deprecated in drivers/modules.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agogadgetfs patch for ep0out
Skip Hansen [Fri, 1 Sep 2006 22:26:27 +0000 (15:26 -0700)] 
gadgetfs patch for ep0out

For ep0out transfers (rare), be sure to copy the right data to userspace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: EHCI whitespace fixes (cosmetic)
David Brownell [Wed, 30 Aug 2006 21:50:06 +0000 (14:50 -0700)] 
USB: EHCI whitespace fixes (cosmetic)

[ ... when you have an editor set to remind you of whitespace bugs ... ]

Cosmetic EHCI changes: remove end-of-line whitespace, spaces before tabs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ethernet gadget avoids zlps for musb_hdrc
David Brownell [Wed, 30 Aug 2006 20:24:56 +0000 (13:24 -0700)] 
USB: ethernet gadget avoids zlps for musb_hdrc

For systems using the Mentor HDRC controllers we get better TX DMA throughput
if we can avoid falling back to PIO to write zero length packets ... so tell
the driver to avoid ZLPs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbmon: don't call mon_dmapeek if DMA isn't being used
Alan Stern [Wed, 30 Aug 2006 15:35:21 +0000 (11:35 -0400)] 
usbmon: don't call mon_dmapeek if DMA isn't being used

This patch (as755b) fixes a bug in usbmon.  Rather than assuming all
USB host controllers use DMA, the code will check the usb_bus data
structure.  If DMA isn't used, we don't want to try peeking into a
non-existent DMA buffer!

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: trim down usb_bus structure
Alan Stern [Wed, 30 Aug 2006 15:32:52 +0000 (11:32 -0400)] 
usbcore: trim down usb_bus structure

As part of the ongoing program to flatten out the HCD bus-glue layer,
this patch (as771b) eliminates the hcpriv, release, and kref fields
from struct usb_bus.  hcpriv and release were not being used for
anything worthwhile, and kref has been moved into the enclosing
usb_hcd structure.

Along with those changes, the patch gets rid of usb_bus_get and
usb_bus_put, replacing them with usb_get_hcd and usb_put_hcd.

The one interesting aspect is that the dev_set_drvdata call was
removed from usb_put_hcd, where it clearly doesn't belong.  This means
the driver private data won't get reset to NULL.  It shouldn't cause
any problems, since the private data is undefined when no driver is
bound.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: Add flag for whether a host controller uses DMA
Alan Stern [Wed, 30 Aug 2006 15:29:56 +0000 (11:29 -0400)] 
usbcore: Add flag for whether a host controller uses DMA

This patch (as770b) introduces a new field to usb_bus: a flag
indicating whether or not the host controller uses DMA.  This serves
to encapsulate the computation.  It also means we will have only one
spot to update if the DMA API changes.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: remove struct usb_operations
Alan Stern [Wed, 30 Aug 2006 15:27:36 +0000 (11:27 -0400)] 
USB: remove struct usb_operations

All of the currently-supported USB host controller drivers use the HCD
bus-glue framework.  As part of the program for flattening out the glue
layer, this patch (as769) removes the usb_operations structure.  All
function calls now go directly to the HCD routines (slightly renamed
to remain within the "usb_" namespace).

The patch also removes usb_alloc_bus(), because it's not useful in the
HCD framework and it wasn't referenced anywhere.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usb-hub-driver-improve-use-of-ifdef fix
Andrew Morton [Tue, 15 Aug 2006 06:11:02 +0000 (23:11 -0700)] 
USB: usb-hub-driver-improve-use-of-ifdef fix

Fix CONFIG_PM=n build.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Turn usb_resume_both() into static inline
Alexey Dobriyan [Sun, 20 Aug 2006 14:58:42 +0000 (18:58 +0400)] 
USB: Turn usb_resume_both() into static inline

drivers/usb/core/hub.c: In function `hub_events':
drivers/usb/core/hub.c:2591: warning: statement with no effect

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: help drivers to change device configs
Alan Stern [Mon, 21 Aug 2006 16:08:19 +0000 (12:08 -0400)] 
usbcore: help drivers to change device configs

It's generally a bad idea for USB interface drivers to try to change a
device's configuration, and usbcore doesn't provide any way for them
to do it.  However in a few exceptional circumstances it can make
sense.  This patch (as767) adds a roundabout mechanism to help drivers
that may need it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousb-storage: fix for UFI LUN detection
Alan Stern [Mon, 21 Aug 2006 16:00:53 +0000 (12:00 -0400)] 
usb-storage: fix for UFI LUN detection

The UFI specification doesn't permit devices to indicate non-existent
LUNs in the manner prescribed by the SCSI spec.  This patch (as773)
sets a special flag so that the SCSI scanner will recognize these
devices and treat them specially.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: fix typo in drivers/usb/gadget/Kconfig
Jules Villard [Tue, 22 Aug 2006 20:40:15 +0000 (22:40 +0200)] 
USB: fix typo in drivers/usb/gadget/Kconfig

This tiny patch fixes a typo in drivers/usb/gadget/Kconfig. The typo
is present in 2.6.18-rc4 and in the corresponding -mm tree (and AFAIK,
FYI and FWIW was present in previous kernel versions as well).

From: Jules Villard <jvillard@ens-lyon.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: fix signedness issue in drivers/usb/gadget/ether.c
Eric Sesterhenn [Mon, 21 Aug 2006 22:31:05 +0000 (15:31 -0700)] 
USB: fix signedness issue in drivers/usb/gadget/ether.c

another gcc 4.1 signdness warning:

drivers/usb/gadget/ether.c:2028: warning: comparison of unsigned expression < 0 is always false

length is assigned the value of usb_ep_queue() which returns an int.
Directly after this it is checked for < 0, which can never be true.  Making
length an int makes the error check work again.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB core: Use const where possible.
Luiz Fernando N. Capitulino [Sun, 27 Aug 2006 02:48:11 +0000 (23:48 -0300)] 
USB core: Use const where possible.

This patch marks some USB core's functions parameters as const. This
improves the design (we're saying to the caller that its parameter is
not going to be modified) and may help in compiler's optimisation work.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agowusb: pretty print new wireless USB devices when they connect
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:31 +0000 (19:35 -0700)] 
wusb: pretty print new wireless USB devices when they connect

New code being pushed to linuxuwb.org requires this patch to connect
WUSB devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agowusb: handle wusb device ep0 speed settings
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:30 +0000 (19:35 -0700)] 
wusb: handle wusb device ep0 speed settings

This patch teaches the USB stack handling of WUSB devices (those whose
speed is USB_SPEED_VARIABLE). For these devices, we need to set ep0's
maxpacketsize to 512 (even though the device descriptor reports it as
0xff).

New code being pushed to linuxuwb.org requires this patch to connect WUSB
devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agowusb: hub code recognizes wusb ports
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:29 +0000 (19:35 -0700)] 
wusb: hub code recognizes wusb ports

This patch enables the USB stack to recognize WUSB devices (from a
WUSB HCD) and assigns them the proper speed setting
(USB_SPEED_VARIABLE).

1. Introduce usb_hcd->wireless to mark a host controller instance as
   being wireless, and thus having wireless 'fake' ports.

   [discarded previous model of using a reserved bit in the port_stat
   struct to do this; thanks to Alan Stern for indicating the
   proper way to do it].

2. Introduce hub.c:hub_is_wusb() that tests if a hub is a WUSB root
   hub (WUSB doesn't have non-root hubs).

New code being pushed to linuxuwb.org requires this patch to connect WUSB
devices.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousb: deal with broken config descriptors
Inaky Perez-Gonzalez [Sat, 26 Aug 2006 02:35:28 +0000 (19:35 -0700)] 
usb: deal with broken config descriptors

Change usb_get_configuration() so that it is more tolerant to devices
with bad configuration descriptors (it'll make it ignore
configurations that fail to load).

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB Storage: add rio karma eject support
Matthew Dharm [Mon, 14 Aug 2006 00:30:14 +0000 (17:30 -0700)] 
USB Storage: add rio karma eject support

This changeset from Keith Bennett (via Bob Copeland) moves the Karma
initializer to its own file and adds trapping of the START_STOP command to
enable eject of the device.

Signed-off-by: Keith Bennett <keith@mcs.st-and.ac.uk>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousb-skeleton: small update
Luiz Fernando N. Capitulino [Tue, 15 Aug 2006 01:44:29 +0000 (22:44 -0300)] 
usb-skeleton: small update

o CodingStyle fixes
o Removes trailing spaces
o Do not make not needed initialiation of automatic variables
o Use usb_endpoint_* functions
o If we get an error in the write URB callback print an error message instead
  of a debug one

(Pretty unrelated changes, but spliting this up doesn't pay off as our main
changes are just CodingStyle fixes).

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: khubd and busy-port handling
Alan Stern [Fri, 11 Aug 2006 20:52:39 +0000 (16:52 -0400)] 
usbcore: khubd and busy-port handling

We don't want khubd to start interfering in the device-resume process
merely because the PORT_STATUS_C_SUSPEND feature happens to be set.
Ports need to be marked as busy while a resume is taking place.

In addition, so long as ports are marked as busy, khubd won't be able to
clear their various status-change features.  On an interrupt-driven root
hub this could lead to an interrupt storm.  Root hub IRQs should not be
re-enabled until the busy_bits value is equal to 0.

This patch (as765) fixes these two potential problems.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: make hcd_endpoint_disable wait for queue to drain
Alan Stern [Fri, 11 Aug 2006 20:01:45 +0000 (16:01 -0400)] 
usbcore: make hcd_endpoint_disable wait for queue to drain

The inconsistent lock state problem in usbcore (the one that shows up
when an HCD is unloaded) comes down to two inter-related problems:

usb_rh_urb_dequeue() isn't set up to be called with interrupts
disabled.

hcd_endpoint_disable() doesn't wait for all URBs on the
endpoint's queue to complete.

The two problems are related because the one type of URB that isn't
likely to be complete when hcd_endpoint_disable() returns is a root-hub
URB.  Right now usb_rh_urb_dequeue() waits for them to complete, and it
assumes interrupts are enabled so it can wait.  But
hcd_endpoint_disable() calls it with interrupts disabled.

Now, it should be legal to unlink root-hub URBs with interrupts
disabled.  The solution is to move the waiting into
hcd_endpoint_disable(), where it belongs.  This patch (as754) does that.

It turns out to be completely safe to replace the del_timer_sync() with
a simple del_timer().  It doesn't matter if the timer routine is
running; hcd_root_hub_lock will synchronize the two threads and the
status URB will complete with an unlink error, as it should.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUHCI: increase Resume-Detect-off delay
Alan Stern [Fri, 11 Aug 2006 15:33:58 +0000 (11:33 -0400)] 
UHCI: increase Resume-Detect-off delay

The UHCI controller in my laptop takes longer to turn off the
Resume-Detect bit than the 4 us allowed by uhci-hcd.  Presumably other
computers will have the same problem.

This patch (as752) increases the maximum delay to 10 us, which should be
plenty, and uses polling to avoid penalizing systems which can turn the
bit off more quickly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Properly unregister reboot notifier in case of failure in ehci hcd
Aleksey Gorelov [Wed, 9 Aug 2006 00:24:08 +0000 (17:24 -0700)] 
USB: Properly unregister reboot notifier in case of failure in ehci hcd

If some problem occurs during ehci startup, for instance, request_irq fails,
echi hcd driver tries it best to cleanup, but fails to unregister reboot
notifier, which in turn leads to crash on reboot/poweroff.

The following patch resolves this problem by not using reboot notifiers
anymore, but instead making ehci/ohci driver get its own shutdown method.  For
PCI, it is done through pci glue, for everything else through platform driver
glue.

One downside: sa1111 does not use platform driver stuff, and does not have its
own shutdown hook, so no 'shutdown' is called for it now.  I'm not sure if it
is really necessary on that platform, though.

Signed-off-by: Aleks Gorelov <dared1st@yahoo.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB gadget: gadgetfs dont try to lock before free
Milan Svoboda [Wed, 9 Aug 2006 05:14:43 +0000 (22:14 -0700)] 
USB gadget: gadgetfs dont try to lock before free

I spotted this during my tests with -rt on arm. The -rt patch contains
some better tools
to diagnose problems with locks and some other things...

Original code tries to take semaphore in BUG_ON and then free the memory
with this semaphore.

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>
18 years agoUSB: add poll to gadgetfs's endpoint zero
Milan Svoboda [Wed, 9 Aug 2006 05:23:12 +0000 (22:23 -0700)] 
USB: add poll to gadgetfs's endpoint zero

Add poll() support to gadgetfs ep0

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>
18 years agoUSB: net1080 inherent pad length
dave rientjes [Wed, 19 Jul 2006 06:23:02 +0000 (23:23 -0700)] 
USB: net1080 inherent pad length

The size of struct nc_trailer is inherently the newtailroom pad.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ldusb: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:54 +0000 (11:58 -0700)] 
USB: ldusb: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usblcd: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:54 +0000 (11:58 -0700)] 
USB: usblcd: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usb-serial: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: usb-serial: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: powermate: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: powermate: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: keyspan_remote: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: keyspan_remote: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ati_remote: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: ati_remote: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: acecad: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: acecad: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: appletouch: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: appletouch: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: hub: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: hub: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usblp: Use usb_endpoint_* functions.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: usblp: Use usb_endpoint_* functions.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: New functions to check endpoints info.
Luiz Fernando N. Capitulino [Wed, 27 Sep 2006 18:58:53 +0000 (11:58 -0700)] 
USB: New functions to check endpoints info.

These functions makes USB driver's code simpler when dealing with endpoints
by avoiding them from accessing the endpoint's descriptor structure directly
when they only need to know the endpoint's transfer type and/or
direction.

Please, read each functions' documentation in order to know how to use
them.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: making the kernel -Wshadow clean - USB & completion
Jesper Juhl [Sun, 30 Jul 2006 16:43:43 +0000 (18:43 +0200)] 
USB: making the kernel -Wshadow clean - USB & completion

include/linux/usb.h causes a lot of -Wshadow warnings - fix them.

  include/linux/usb.h:901: warning: declaration of 'complete' shadows a global declaration
  include/linux/completion.h:52: warning: shadowed declaration is here
  include/linux/usb.h:932: warning: declaration of 'complete' shadows a global declaration
  include/linux/completion.h:52: warning: shadowed declaration is here
  include/linux/usb.h:967: warning: declaration of 'complete' shadows a global declaration
  include/linux/completion.h:52: warning: shadowed declaration is here

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Make file operations structs in drivers/usb const.
Luiz Fernando N. Capitulino [Sat, 5 Aug 2006 23:37:11 +0000 (20:37 -0300)] 
USB: Make file operations structs in drivers/usb const.

Making structs const prevents accidental bugs and with the proper debug
options they're protected against corruption.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: gmidi: New USB MIDI Gadget class driver.
Ben Williamson [Tue, 1 Aug 2006 01:28:16 +0000 (11:28 +1000)] 
USB: gmidi: New USB MIDI Gadget class driver.

This driver is glue between the USB gadget interface
and the ALSA MIDI interface. It allows us to appear
as a MIDI Streaming device to a host system on the
other end of a USB cable.

This includes linux/usb/audio.h and linux/usb/midi.h
containing definitions from the relevant USB specifications
for USB audio and USB MIDI devices.

The following changes have been made since the first RFC
posting:

* Bug fixes to endpoint handling.
* Workaround for USB_REQ_SET_CONFIGURATION handling,
  not understood yet.
* Added SND and SND_RAWMIDI dependencies in Kconfig.
* Moved usb_audio.h and usb_midi.h to usb/*.h
* Added module parameters for ALSA card index and id.
* Added module parameters for USB descriptor IDs and strings.
* Removed some unneeded stuff inherited from zero.c, more to go.
* Provide DECLARE_* macros for the variable-length structs.
* Use kmalloc instead of usb_ep_alloc_buffer.
* Limit source to 80 columns.
* Return actual error code instead of -ENOMEM in a few places.

Signed-off-by: Ben Williamson <ben.williamson@greyinnovation.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: gadgetfs: protect ep_release with lock
Milan Svoboda [Mon, 26 Jun 2006 14:48:00 +0000 (07:48 -0700)] 
USB: gadgetfs: protect ep_release with lock

This patch adds mutex protection to ep_release.

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>
18 years agoUSB: fix ep_config to return correct value
Milan Svoboda [Mon, 26 Jun 2006 14:19:00 +0000 (07:19 -0700)] 
USB: fix ep_config to return correct value

This patch fixes ep_config to return correct value. Without patch
ep_config returns submitted lenght minus 4 on succes. With this
patch applied, whole submitted lenght is returned.

ep_config parses submitted data and if buffer starts with (int) 1
it is parsed, otherwise error is reported. Problem is that ep_config
returns size of buffer minus 4 on success. I think that size of buffer
should be returned instead, because there were no problems and
all data were processed.

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>
18 years agoUSB: correct locking in gadgetfs_disconnect
Milan Svoboda [Mon, 26 Jun 2006 14:46:00 +0000 (07:46 -0700)] 
USB: correct locking in gadgetfs_disconnect

This patch moves spin_lock (&dev->lock) before first use of dev.
I think that test to the state of device should be protected with
this spin_lock...

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>
18 years agoUSB: onetouch - handle errors from input_register_device()
Dmitry Torokhov [Wed, 2 Aug 2006 02:45:28 +0000 (22:45 -0400)] 
USB: onetouch - handle errors from input_register_device()

Onetouch: handle errors from input_register_device()

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: build fixes: ohci-omap
David Brownell [Mon, 31 Jul 2006 14:29:39 +0000 (07:29 -0700)] 
USB: build fixes: ohci-omap

The ohci-omap code has diverged from the working version in the linux-omap
tree; this syncs up the versions:

  - Another clock is needed in various cases
  - The omap-1510 iommu code needs to be #ifdeffed out on newer parts
  - Saner use of the HCD framework
  - Various other changes, e.g. a Nokia 770 quirk

And some minor dead-whitespace removal.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: garmin_gps support for new generation of gps receivers
Hermann Kneissel [Tue, 11 Jul 2006 17:41:33 +0000 (19:41 +0200)] 
USB: garmin_gps support for new generation of gps receivers

The attached patch adds support for the new generation of gps receivers (eg.
GPSmap 60Cx) to garmin_gps.c.

Signed-off-by: Hermann Kneissel <herkne@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: wacom tablet driver reorganization
Ping Cheng [Fri, 14 Jul 2006 01:01:36 +0000 (18:01 -0700)] 
USB: wacom tablet driver reorganization

- split wacom.c into 4 files: wacom.h, wacom_wac.h, wacom_sys.c, and wacom_wac.c
- where wacom_sys.c deals with system specific code,
- and wacom_wac.c deals with Wacom specific code

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usbcore get rid of the timer in usb_start_wait_urb()
Franck Bui-Huu [Wed, 12 Jul 2006 08:09:41 +0000 (10:09 +0200)] 
USB: usbcore get rid of the timer in usb_start_wait_urb()

This patch uses completion timeout instead of a timer to implement
a timeout when submitting an URB in usb_start_wait_urb().

It also fixes a small issue. With the previous code, if no timeout
happened and the URB's status was set to ECONNRESET value, the code
assumed wrongly that a timeout had occured.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ipaq: minor ipaq_open() cleanup.
Luiz Fernando N. Capitulino [Thu, 27 Jul 2006 13:30:43 +0000 (10:30 -0300)] 
USB: ipaq: minor ipaq_open() cleanup.

 Commit b512504e5671f83638be0ddr085c4b1832f623d3 made ipaq_open() a bit
messy by moving the read urb submission far from its usb_fill_bulk_urb()
call and the comment explaining what it does.

 This patch put they together again. Although only compiled tested, should
not break the fix introduced by b512504e5671f83638be0ddr085c4b1832f623d3,
of course.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbnet: printk format warning
Randy Dunlap [Mon, 7 Aug 2006 22:56:40 +0000 (15:56 -0700)] 
usbnet: printk format warning

Fix printk format warning(s):
drivers/usb/net/usbnet.c:654: warning: int format, different type arg (arg 3)

The fact that rx_urb_size happens to be a size_t has propagated all the way
back to this printk.  It's fragile to be using %z in this case - let's just
typecast the args instead.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: asix - Add AX88178 support and many other changes
David Hollis [Sat, 29 Jul 2006 14:12:50 +0000 (10:12 -0400)] 
USB: asix - Add AX88178 support and many other changes

* More generi-fication of function/macro names where appropriate:
     ax88772_xx() -> asix_xx()

* Reorder functions to provide more logical grouping

* AX88178 device support

* Support DLink DUB-E100 Rev B Support

* Hopefully resolve all endian-ness issues

* Use more defines for bitmask values

* Change a number of devdbg() calls to deverr() so that if DEBUG is not
  defined, the error messages still get through as necessary

Signed-off-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: usbnet - Add unlink_rx_urbs() call to allow for Jumbo Frames
Jamie Painter [Thu, 27 Jul 2006 18:17:28 +0000 (14:17 -0400)] 
USB: usbnet - Add unlink_rx_urbs() call to allow for Jumbo Frames

Add usbnet_unlink_rx_urbs() which can be called by mini-drivers when
they change their MTU such as for Jumbo Frame support.

Signed-off-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pl2303: cosmetic changes to quirk
Thiago Galesi [Sat, 29 Jul 2006 13:47:12 +0000 (10:47 -0300)] 
USB: pl2303: cosmetic changes to quirk

Cosmetic changes to quirk in pl2303_update_line_status

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pl2303: reduce number of prototypes
Thiago Galesi [Sat, 29 Jul 2006 13:46:37 +0000 (10:46 -0300)] 
USB: pl2303: reduce number of prototypes

Reduce number of needed prototypes in Prolific pl2303 driver

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pl2303: cosmetic changes to pl2303_buf_{clear, data_avail}
Thiago Galesi [Sat, 29 Jul 2006 13:45:43 +0000 (10:45 -0300)] 
USB: pl2303: cosmetic changes to pl2303_buf_{clear, data_avail}

Changes the functions pl2303_buf_clear and pl2303_buf_data_avail for
the purpose of keeping them under the 80 column limit, making them
more similar to similar functions and making then simpler.

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pl2303: remove 80-columns limit violations in pl2303 driver
Thiago Galesi [Mon, 31 Jul 2006 18:39:27 +0000 (15:39 -0300)] 
USB: pl2303: remove 80-columns limit violations in pl2303 driver

Fixes several lines that overrun 80 columns in Prolific pl2303 driver
and cleans up some space usages in the function calls.

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pl2303: Removes unneeded goto.
Luiz Fernando N. Capitulino [Tue, 25 Jul 2006 19:58:30 +0000 (16:58 -0300)] 
USB: pl2303: Removes unneeded goto.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbtouchscreen: version 0.4
Daniel Ritz [Mon, 31 Jul 2006 19:43:24 +0000 (21:43 +0200)] 
usbtouchscreen: version 0.4

changes over 0.3:
- some more eGalax device IDs (from eGalax driver/spec)
- return the error code in probe()
- 3M/MTouch init fixes, tested by Don Alexander
- eGalax fixes for bugs in multi-packet handling, spottet by Pieter Grimmerink
- support for some eTurboTouch devices, mostly by Pieter Grimmerink
- support for Gunze AHL61 controller (untested, but simple enough)

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Pieter Grimmerink <p.grimmerink@inepro.com>
Cc: Don Alexander <debug@roosoft.ltd.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agohub driver: improve use of #ifdef
Alan Stern [Sun, 2 Jul 2006 02:14:24 +0000 (22:14 -0400)] 
hub driver: improve use of #ifdef

This patch (as736) makes the hub driver more readable by improving the
usage of "#ifdef CONFIG_PM" and "#ifdef CONFIG_USB_SUSPEND".

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: suspending devices with no driver
Alan Stern [Sun, 2 Jul 2006 02:13:50 +0000 (22:13 -0400)] 
usbcore: suspending devices with no driver

Since usb_generic can be unbound from a USB device, we need to be able
to handle the possibility that a suspend or resume request arrives for a
device with no driver.  This patch (as735) arranges things so that
resume requests will fail and suspend requests will use the standard USB
port-suspend code.  Attempts to suspend or resume an unbound interface
are handled similarly (although the error caused by trying to resume an
unbound interface is dropped by the calling routine).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: fix up device and power state tests
Alan Stern [Sun, 2 Jul 2006 02:13:04 +0000 (22:13 -0400)] 
usbcore: fix up device and power state tests

This patch (as734) rationalizes the various tests of device state and
power states.  There are duplications and mistaken tests in several
places.

Perhaps the most interesting challenge is where the hub driver tests to
see that all the child devices are suspended before allowing itself to
be suspended.  When CONFIG_USB_SUSPEND is set the test is
straightforward, since we expect that the children _will_ be suspended.
But when CONFIG_USB_SUSPEND isn't set, it's not so clear what should be
done.  The code compromises by checking the child's
power.power_state.event field.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: set device and power states properly
Alan Stern [Sun, 2 Jul 2006 02:12:19 +0000 (22:12 -0400)] 
usbcore: set device and power states properly

This patch (as733) fixes up the places where device states and power
states are set in usbcore.  Right now things are duplicated or missing;
this should straighten things out.

The idea is that udev->state is USB_STATE_SUSPENDED exactly when the
device's upstream port has been suspended, whereas
udev->dev.power.power_state.event reflects the result of the last call
to the suspend/resume routines (which might not actually change the
device state, especially if CONFIG_USB_SUSPEND isn't set).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: track whether interfaces are suspended
Alan Stern [Sun, 2 Jul 2006 02:11:44 +0000 (22:11 -0400)] 
usbcore: track whether interfaces are suspended

Currently we rely on intf->dev.power.power_state.event for tracking
whether intf is suspended.  This is not a reliable technique because
that value is owned by the PM core, not by usbcore.  This patch (as718b)
adds a new flag so that we can accurately tell which interfaces are
suspended and which aren't.

At first one might think these flags aren't needed, since interfaces
will be suspended along with their devices.  It turns out there are a
couple of intermediate situations where that's not quite true, such as
while processing a remote-wakeup request.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: resume device resume recursion
Alan Stern [Sun, 2 Jul 2006 02:11:02 +0000 (22:11 -0400)] 
usbcore: resume device resume recursion

This patch (as717b) removes the existing recursion in hub resume code:
Resuming a hub will no longer automatically resume the devices attached
to the hub.

At the same time, it adds one level of recursion: Suspending a USB
device will automatically suspend all the device's interfaces.  Failure
at an intermediate stage will cause all the already-suspended interfaces
to be resumed. Attempts to suspend or resume an interface by itself will
do nothing, although they won't return an error.  Thus the regular
system-suspend and system-resume procedures should continue to work as
before; only runtime PM will be affected.

The patch also removes the code that tests state of the interfaces
before suspending a device.  It's no longer needed, since everything
gets suspended together.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: split suspend/resume for device and interfaces
Alan Stern [Sun, 2 Jul 2006 02:10:15 +0000 (22:10 -0400)] 
usbcore: split suspend/resume for device and interfaces

This patch (as716b) splits up the core suspend and resume routines into
two parts each: one for handling devices and one for handling
interfaces.  The behavior of the parts should be the same as in the old
unified code.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: make usb_generic a usb_device_driver
Alan Stern [Sun, 2 Jul 2006 02:09:35 +0000 (22:09 -0400)] 
usbcore: make usb_generic a usb_device_driver

This patch (as714b) makes usb_generic into a usb_device_driver capable
of being probed and unbound, just like other drivers.  A fair amount of
the work that used to get done during discovery or removal of a USB
device have been moved to the probe and disconnect methods of
usb_generic: creating the sysfs attributes and selecting an initial
configuration.  However the normal behavior should continue to be the
same as before.

We will now have the possibility of creating other USB device drivers,
They will assist with exporting devices to remote systems
(USB-over-TCPIP) or to paravirtual guest operating systems.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: add usb_device_driver definition
Alan Stern [Sun, 2 Jul 2006 02:08:49 +0000 (22:08 -0400)] 
usbcore: add usb_device_driver definition

This patch (as732) adds a usb_device_driver structure, for representing
drivers that manage an entire USB device as opposed to just an
interface.  Support routines like usb_register_device_driver,
usb_deregister_device_driver, usb_probe_device, and usb_unbind_device
are also added.

Unlike an earlier version of this patch, the new code is type-safe.  To
accomplish this, the existing struct driver embedded in struct
usb_driver had to be wrapped in an intermediate wrapper.  This enables
the core to tell at runtime whether a particular struct driver belongs
to a device driver or to an interface driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: move code among source files
Alan Stern [Sun, 2 Jul 2006 02:08:06 +0000 (22:08 -0400)] 
usbcore: move code among source files

This revised patch (as713b) moves a few routines among source files in
usbcore.  Some driver-related code in usb.c (claiming interfaces and
matching IDs) is moved to driver.c, where it belongs.  Also the
usb_generic stuff in driver.c is moved to a new source file: generic.c.
(That's the reason for revising the patch.)  Although not very big now,
it will get bigger in a later patch.

None of the code has been changed; it has only been re-arranged.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: rename usb_suspend_device to usb_port_suspend
Alan Stern [Sun, 2 Jul 2006 02:07:21 +0000 (22:07 -0400)] 
usbcore: rename usb_suspend_device to usb_port_suspend

This revised patch (as715b) renames usb_suspend_device to
usb_port_suspend, usb_resume_device to usb_port_resume, and
finish_device_resume to finish_port_resume.  There was no objection to
the original version of the patch so this should be okay to apply.

The revision was needed only because I have re-arranged the order of the
earlier patches.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousb-skeleton: don't submit URBs after disconnection
Alan Stern [Sun, 2 Jul 2006 02:06:36 +0000 (22:06 -0400)] 
usb-skeleton: don't submit URBs after disconnection

This patch (as712b) is a slight revision of one submitted earlier.  It
fixes the usb-skeleton example driver so that it won't try to submit
URBs after skel_disconnect() has returned.  This could cause errors, if
the driver was unbound and then a different driver was bound to the
device.  It also fixes a couple of small bugs in the skel_write()
routine.

The revised patch uses a slightly different test, suggested by Dave
Brownell, for determining whether to free a transfer buffer.  It's a
little clearer than the earlier version.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbfs: detect device unregistration
Alan Stern [Sun, 2 Jul 2006 02:05:56 +0000 (22:05 -0400)] 
usbfs: detect device unregistration

This patch (as711b) is a revised version of an earlier submission.  It
modifies the usbfs code to detect when a device has been unregistered from
usbfs, even if the device is still connected.  Although this can't happen
now, it will be able to happen after the upcoming changes to usb_generic.

Nobody objected to this patch when it was submitted before, so it should
be okay to apply this version.  The revision is merely to take into
account the changes introduced by as723, which touches the same driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbfs: private mutex for open, release, and remove
Alan Stern [Sun, 2 Jul 2006 02:05:01 +0000 (22:05 -0400)] 
usbfs: private mutex for open, release, and remove

The usbfs code doesn't provide sufficient mutual exclusion among open,
release, and remove.  Release vs. remove is okay because they both
acquire the device lock, but open is not exclusive with either one.  All
three routines modify the udev->filelist linked list, so they must not
run concurrently.

Apparently someone gave this a minimum amount of thought in the past by
explicitly acquiring the BKL at the start of the usbdev_open routine.
Oddly enough, there's a comment pointing out that locking is unnecessary
because chrdev_open already has acquired the BKL.

But this ignores the point that the files in /proc/bus/usb/* are not
char device files; they are regular files and so they don't get any
special locking.  Furthermore it's necessary to acquire the same lock in
the release and remove routines, which the code does not do.

Yet another problem arises because the same file_operations structure is
accessible through both the /proc/bus/usb/* and /dev/usb/usbdev* file
nodes.  Even when one of them has been removed, it's still possible for
userspace to open the other.  So simple locking around the individual
remove routines is insufficient; we need to lock the entire
usb_notify_remove_device notifier chain.

Rather than rely on the BKL, this patch (as723) introduces a new private
mutex for the purpose.  Holding the BKL while invoking a notifier chain
doesn't seem like a good idea.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Phidgets should check create_device_file() return value
Sean Young [Fri, 11 Aug 2006 09:28:28 +0000 (09:28 +0000)] 
USB: Phidgets should check create_device_file() return value

device_create_file() could fail, add proper error paths for this condition.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Put phidgets driver in a sysfs class
Sean Young [Mon, 10 Jul 2006 09:56:25 +0000 (09:56 +0000)] 
USB: Put phidgets driver in a sysfs class

This patch creates a device class phidget and add the phidget drivers to
them.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Add driver for PhidgetMotorControl
Sean Young [Sun, 9 Jul 2006 13:01:02 +0000 (13:01 +0000)] 
USB: Add driver for PhidgetMotorControl

This driver add support for the Phidgets Inc., MotorControl via sysfs. Also
some minor fixes for the InterfaceKit.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agousbcore: add configuration_string to attribute group
Alan Stern [Thu, 6 Jul 2006 19:37:42 +0000 (15:37 -0400)] 
usbcore: add configuration_string to attribute group

This patch (as737b) does a very small cleanup of core/sysfs.c by adding
the configuration_string attribute file to the existing attribute group
instead of treating it separately.  It doesn't need this separate
treatment because unlike the other device string attributes, it changes
along with the active configuration.

The patch also fixes a simple typo (which, oddly enough, doesn't seem to
bother the compiler).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Make usb_buffer_free() NULL-safe
Dmitry Torokhov [Wed, 2 Aug 2006 02:33:34 +0000 (22:33 -0400)] 
USB: Make usb_buffer_free() NULL-safe

kfree() handles NULL arguments which is handy in error handling paths as one
does need to  insert bunch of ifs. How about making usb_buffer_free() do the
same?

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ark3116: Formatting cleanups
Werner Lemberg [Tue, 18 Jul 2006 15:00:22 +0000 (17:00 +0200)] 
USB: ark3116: Formatting cleanups

Formatting only.

Signed-off-by: Werner Lemberg <wl@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.
Werner Lemberg [Tue, 18 Jul 2006 15:00:52 +0000 (17:00 +0200)] 
USB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.

Add (dummy?) support for TIOCGSERIAL and TIOCSSERIAL ioctl calls to the USB
serial driver file `ark3116.c'.  This is sufficient for me to run wvdial
successfully, receive my email, and do webbrowsing with firefox.  On the
other hand, running the cvs program to update archives seems not to work,
and the traceroute command sometimes says

  send failed: No buffer space available

Looks like a buffering problem...  My knowledge of serial device drivers is
zero, so I can't fix this -- I just did a cut'n'paste from other USB serial
drivers...

Signed-off-by: Werner Lemberg <wl@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: Allow compile in g_ether, fix typo
Tony Lindgren [Fri, 30 Jun 2006 05:27:36 +0000 (22:27 -0700)] 
USB: Allow compile in g_ether, fix typo

Allows compiling g_ether in and fixes a typo with MUSB_HDRC

Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: pxa2xx_udc understands GPIO based VBUS sensing
David Brownell [Thu, 29 Jun 2006 19:25:39 +0000 (12:25 -0700)] 
USB: pxa2xx_udc understands GPIO based VBUS sensing

This updates the PXA 25x UDC board-independent infrastructure for VBUS sensing
and the D+ pullup.  The original code evolved from rather bizarre support on
Intel's "Lubbock" reference hardware, so that on more sensible hardware it
doesn't work as well as it could/should.

The change is just to teach the UDC driver how to use built-in PXA GPIO pins
directly.  This reduces the amount of board-specfic object code needed, and
enables the use of a VBUS sensing IRQ on boards (like Gumstix) that have one.
With VBUS sensing, the UDC is unclocked until a host is actually connected.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: move <linux/usb_otg.h> to <linux/usb/otg.h>
David Brownell [Thu, 29 Jun 2006 19:27:23 +0000 (12:27 -0700)] 
USB: move <linux/usb_otg.h> to <linux/usb/otg.h>

Move <linux/usb_otg.h> to <linux/usb/otg.h>.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: kill usb kconfig warning
Andrew Morton [Fri, 7 Jul 2006 07:11:45 +0000 (00:11 -0700)] 
USB: kill usb kconfig warning

drivers/usb/host/Kconfig:87:warning: 'select' used by config symbol 'USB_OHCI_HCD' refer to undefined symbol 'I2C_PNX'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB OHCI controller support for PNX4008
Vitaly Wool [Thu, 29 Jun 2006 14:28:18 +0000 (18:28 +0400)] 
USB OHCI controller support for PNX4008

inlined is the patch that adds basic support for USB OHCI controller
support for PNX4008 Philips PNX4008 ARM board. Due to HW design, it
depends on I2C driver for PNX4008 which I've recetnly posted to LKML and
i2c at lm-sensors.

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: ohci-s3c2410.c: clock now usb-bus-host
Ben Dooks [Mon, 26 Jun 2006 22:36:07 +0000 (23:36 +0100)] 
USB: ohci-s3c2410.c: clock now usb-bus-host

With the newer Samsung S3C2412 and S3C2413 SoC devices,
the 48MHz USB clock has been given an individual gate
into the USB OHCI and gadget blocks.

This clock is called usb-bus-clock, and we need to
replace the old use of the USB PLL (upll) directly
with the new usb-bus-host.

The S3C2410 clock driver has been updated already to
provide a virtual clock which is a child of the UPLL
to maintain compatibility. The S3C2412 clock driver
correctly enables the PLL when either usb-bus clock
is active.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: OHCI avoids root hub timer polling
David Brownell [Fri, 4 Aug 2006 18:31:55 +0000 (11:31 -0700)] 
USB: OHCI avoids root hub timer polling

This teaches OHCI to use the root hub status change (RHSC) IRQ, bypassing
root hub timers most of the time and switching over to the "new" root hub
polling scheme.  It's complicated by the fact that implementations of OHCI
trigger and ack that IRQ differently (the spec is vague there).

Avoiding root hub timers helps mechanisms like "dynamic tick" leave the
CPU in lowpower modes for longer intervals.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB doc patch 2
Sam Bishop [Mon, 28 Aug 2006 22:52:15 +0000 (16:52 -0600)] 
USB doc patch 2

A little more detail on how and when to poll() /proc/bus/usb/devices.

Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: doc patch 1
Sam Bishop [Mon, 28 Aug 2006 22:42:10 +0000 (16:42 -0600)] 
USB: doc patch 1

Grammar, spelling, and stylistic edits.

Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: unusual_dev entry for Sony P990i
Phil Dibowitz [Mon, 11 Sep 2006 07:27:40 +0000 (00:27 -0700)] 
USB: unusual_dev entry for Sony P990i

This patch is a re-diffed version of one originally sent by Jan Mate
<mate@fiit.stuba.sk>.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoUSB: unusual_devs entry for Lacie DVD+-RW
Alan Stern [Thu, 14 Sep 2006 19:18:54 +0000 (15:18 -0400)] 
USB: unusual_devs entry for Lacie DVD+-RW

This patch (as781) adds an entry to unusual_devs.h for the Lacie DVD+-RW
drive.  Apparently its USB interface has requirements similar to the
Genesys Logic interface; it doesn't like data to be sent too soon after
a command.

This fixes Bugzilla #6817.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Wed, 27 Sep 2006 17:53:30 +0000 (10:53 -0700)] 
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] minor reformatting to vmlinux.lds.S
  [IA64] CMC/CPE: Reverse the order of fetching log and checking poll threshold
  [IA64] PAL calls need physical mode, stacked
  [IA64] ar.fpsr not set on MCA/INIT kernel entry
  [IA64] printing support for MCA/INIT
  [IA64] trim output of show_mem()
  [IA64] show_mem() printk levels
  [IA64] Make gp value point to Region 5 in mca handler
  Revert "[IA64] Unwire set/get_robust_list"
  [IA64] Implement futex primitives
  [IA64-SGI] Do not request DMA memory for BTE
  [IA64] Move perfmon tables from thread_struct to pfm_context
  [IA64] Add interface so modules can discover whether multithreading is on.
  [IA64] kprobes: fixup the pagefault exception caused by probehandlers
  [IA64] kprobe opcode 16 bytes alignment on IA64
  [IA64] esi-support
  [IA64] Add "model name" to /proc/cpuinfo

18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Wed, 27 Sep 2006 15:49:07 +0000 (08:49 -0700)] 
Merge /pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (108 commits)
  sh: Fix occasional flush_cache_4096() stack corruption.
  sh: Calculate shm alignment at runtime.
  sh: dma-mapping compile fixes.
  sh: Initial vsyscall page support.
  sh: Clean up PAGE_SIZE definition for assembly use.
  sh: Selective flush_cache_mm() flushing.
  sh: More intelligent entry_mask/way_size calculation.
  sh: Support for L2 cache on newer SH-4A CPUs.
  sh: Update kexec support for API changes.
  sh: Optimized readsl()/writesl() support.
  sh: Report movli.l/movco.l capabilities.
  sh: CPU flags in AT_HWCAP in ELF auxvt.
  sh: Add support for 4K stacks.
  sh: Enable /proc/kcore support.
  sh: stack debugging support.
  sh: select CONFIG_EMBEDDED.
  sh: machvec rework.
  sh: Solution Engine SH7343 board support.
  sh: SH7710VoIPGW board support.
  sh: Enable verbose BUG() support.
  ...

18 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Wed, 27 Sep 2006 15:32:01 +0000 (08:32 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Kill bogus check from bootmem_init().
  [SPARC64]: Update defconfig.

18 years ago[PATCH] x86: use probe_kernel_address in handle_BUG()
Andrew Morton [Wed, 27 Sep 2006 08:51:15 +0000 (01:51 -0700)] 
[PATCH] x86: use probe_kernel_address in handle_BUG()

Avoid possible deadlock on a BUG() inside down_write(mmap_sem).  The deadlock
can only occur if something has gone horridly wrong, because a fault here
shouldn't happen.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] add probe_kernel_address()
Andrew Morton [Wed, 27 Sep 2006 08:51:14 +0000 (01:51 -0700)] 
[PATCH] add probe_kernel_address()

Add a version of __get_user() which is safe to call inside mmap_sem.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] de_thread: Use tsk not current
Eric W. Biederman [Wed, 27 Sep 2006 08:51:13 +0000 (01:51 -0700)] 
[PATCH] de_thread: Use tsk not current

Ingo Oeser pointed out that because current expands to an inline function
it is more space efficient and somewhat faster to simply keep a cached copy
of current in another variable.  This patch implements that for the
de_thread function.

(akpm: saves nearly 100 bytes of text on x86)

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] fs/nfs/: make code static
Adrian Bunk [Wed, 27 Sep 2006 08:51:13 +0000 (01:51 -0700)] 
[PATCH] fs/nfs/: make code static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>