Commit graph

41414 commits

Author SHA1 Message Date
Alan Stern 1bb5f66bb3 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>
2006-12-01 14:23:30 -08:00
Jean Delvare b4ee4a2309 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>
2006-12-01 14:23:30 -08:00
Alan Stern 692a186c9d 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>
2006-12-01 14:23:30 -08:00
Alan Stern af4f76066d 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 0c1ac4f25f 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 6f7cd44162 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 0472074748 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 4d823dd21d 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino fc6e2544bd 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 30f36ef922 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino a20c314412 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>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino c5dd1f9424 USB: speedtch: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino a742e5a7fc USB: phidgetmotorcontrol: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:29 -08:00
Luiz Fernando N. Capitulino 8419404949 USB: phidgetkit: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 66722a194e USB: onetouch: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 240661c556 USB: legousbtower: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 4f1f1ddd73 USB: kobil_sct: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino a7dc218b8f USB: idmouse: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 0f12aa0397 USB: hid-core: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 2ae7745bea USB: ftdi-elan: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 87ad46c94e USB: devices: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino 45aea704d1 USB: cdc-acm: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:28 -08:00
Luiz Fernando N. Capitulino b333d5bfd7 USB: cdc_ether: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Luiz Fernando N. Capitulino 16f9637617 USB: appledisplay: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Luiz Fernando N. Capitulino 377f13bf95 USB: aircable: Use usb_endpoint_* functions
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Alan Stern 565402baee USB: OHCI: remove stale testing code from root-hub resume
This patch (as811) removes some stale testing code from the root-hub
resume routine in ohci-hcd.  It also adds a spin_lock_irq() call that
inadvertently got left out of an error pathway.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Eric Sesterhenn 5d7efe5b37 USB: kmemdup() cleanup in drivers/usb/
replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Alan Stern 052ac01aeb USB: OHCI: disable RHSC inside interrupt handler
This patch (as808b) moves the Root Hub Status Change interrupt-disable
code in ohci-hcd back into the interrupt handler proper, to avoid the
chance of adverse interactions with mediocre hardware implementations.

It also deletes the root-hub status timer from within the interrupt-enable
routine.  There's no need to poll for status any more once interrupts are
re-enabled.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Alan Stern b1878440d4 USB: ohci-hcd: fix compiler warning
This patch (as806) fixes a compiler warning when ohci-hcd is built
with CONFIG_PM turned off.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Alan Stern 93c8bf45e0 USB core: don't match interface descriptors for vendor-specific devices
This patch (as804) makes USB driver matching ignore the interface
class, subclass, and protocol if the device class is Vendor Specific.
Drivers can override this policy by specifying a Vendor ID as part
of the match; then vendor-specific matches are allowed.

Linus Walleij has reported a problem this patch fixes.  When a
particular mass-storage device is switched from mass-storage mode to
Media Transfer Protocol, the interface class remains set to mass-storage
and usb-storage binds to it erroneously, even though the device class
changes to Vendor-Specific.

This may cause a problem for some drivers until their match records can
be updated to include Vendor IDs.  But if it does, then those records
were broken to begin with.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
Alan Stern 6d8fc4d28d USB HID: Handle STALL on interrupt endpoint
The USB HID driver doesn't include any code to handle a STALL on the
interrupt endpoint.  While this may be uncommon, it does happen
sometimes.  This patch (as805) adds a fix.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:27 -08:00
inaky@linux.intel.com 88fafff9d7 usb hub: fix root hub code so it takes more than 15 devices per root hub
Wireless USB Host Controllers accept a large number of devices per
host, which shows up as a large number of ports in its root hub.

When the number of ports in a hub device goes over 16, the activation
of the hub fails with the cryptic message in klogd.

hub 2-0:1.0: activate --> -22

Following this further, it was seen that:

hub_probe()
  hub_configure()
    generates pipe number

    pseudo allocates buffer 'maxp' bytes in size using usb_maxpacket()

      The endpoint descriptor for a root hub interrupt endpoint is
      declared in
      drivers/usb/core/hcd.c:hs_rh_config_descriptor and declares it
      to be size two (supporting 15 devices max).

    hub_activate()
      usb_hcd_submit_urb()
        rh_urb_enqueue()
          urb->pipe is neither int nor ctl, so it errors out
            rh_queue_status()
              Returns -EINVAL because the buffer length is smaller
              than the minimum needed to report all the hub port
              bits as in accordance with USB2.0[11.12.3]. There has
              to be trunc((PORTS + 1 + 7) / 8) bytes of space at
              least.

Alan Stern confirmed that the reason for reading maxpktsize and not
the right amount is because some hubs are known to return more data
and thus cause overflow. 

So this patch simply changes the code to make the interrupt endpoint's
max packet size be at least the minimum required by USB_MAXCHILDREN
(instead of a fixed magic number) and add documentation for that. This
way we are always ahead of the limit.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:26 -08:00
inaky@linux.intel.com 4370525167 usb/hub: allow hubs up to 31 children
Current Wireless USB host hardware (Intel i1480 for example) allows up
to 22 devices to connect, thus bringing up the max number of children
in the WUSB Host Controller to 22 'fake' ports. Upcoming hardware
might raise that limit.

Makes almost no difference to go to 31, as the bit arrays are
byte-aligned (plus an extra bit in general), so 22 bits fit in 4 bytes
as 31 do.

As well, the only other array that depends on USB_MAXCHILDREN is
'struct usb_hub->indicator'. By declaring it 'u8' instead of 'enum
hub_led_mode', we reduce the size of each entry from 4 bytes (in i386)
to 1, which will add as we when are doubling USB_MAXCHILDREN
(with 16 the size of that array is 64 bytes, with 31 would be 128; by
using u8 that goes down to 31 bytes).

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01 14:23:26 -08:00
Jens Axboe bb37b94c68 [BLOCK] Cleanup unused variable passing
- ->init_queue() does not need the elevator passed in
- ->put_request() is a hot path and need not have the queue passed in
- cfq_update_io_seektime() does not need cfqd passed in

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2006-12-01 10:42:33 +01:00
Mike Christie 0e75f9063f [PATCH] block: support larger block pc requests
This patch modifies blk_rq_map/unmap_user() and the cdrom and scsi_ioctl.c
users so that it supports requests larger than bio by chaining them together.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2006-12-01 10:40:55 +01:00
Mike Christie ad2d722570 [PATCH] block: kill length alignment test in bio_map_user()
The target mode support is mapping in bios using bio_map_user. The
current targets do not need their len to be aligned with a queue limit
so this check is causing some problems. Note: pointers passed into the
kernel are properly aligned by usersapace tgt code so the uaddr check
in bio_map_user is ok.

The major user, blk_bio_map_user checks for the len before mapping
so it is not affected by this patch.

And the semi-newly added user blk_rq_map_user_iov has been failing
out when the len is not aligned properly so maybe people have been
good and not sending misaligned lens or that path is not used very
often and this change will not be very dangerous. st and sg do not
check the length and we have not seen any problem reports from those
wider used paths so this patch should be fairly safe - for mm
and wider testing at least.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2006-12-01 10:40:20 +01:00
Olaf Kirch be1c63411a [PATCH] blktrace: add timestamp message
This adds a new timestamp message to blktrace, giving the timeofday when
we starting tracing. This helps user space correlate block trace events
with eg an application strace.

This requires a (compatible) update to blkparse. The changed blkparse
is still able to process traces generated by older kernels, and older
versions of blkparse should silently ignore the new records (because
they have a pid of 0).

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2006-12-01 10:39:12 +01:00
Wim Van Sebroeck bdbf77d670 Merge ../linux-2.6-watchdog-mm 2006-11-30 20:22:09 +01:00
Jeff Garzik a17259a726 Merge branch 'tj-upstream-fixes' of git://htj.dyndns.org/libata-tj into tmp 2006-11-30 05:20:49 -05:00
Jan Engelhardt 6b44d4e69c Fix typos in drivers/isdn/hisax/isdnl2.c
Changes persistant -> persistent in actual C code. (part 1 changed
docs/comments).

Compile-tested.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:33:40 +01:00
Jan Engelhardt 03a67a46af Fix typos in doc and comments
Changes persistant -> persistent. www.dictionary.com does not know
persistant (with an A), but should it be one of those things you can
spell in more than one correct way, let me know.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:32:19 +01:00
Eric Sesterhenn 93e06b4140 BUG_ON conversion for fs/aio.c
This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:29:23 +01:00
Eric Sesterhenn d99c590985 BUG_ON conversion for drivers/mmc/omap.c
This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:27:38 +01:00
Eric Sesterhenn 5d9a276a3e BUG_ON conversion for drivers/media/video/pwc/pwc-if.c
This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:26:46 +01:00
Matt LaPlante 0779bf2d2e Fix misc .c/.h comment typos
Fix various .c/.h typos in comments (no code changes).

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:24:39 +01:00
Matt LaPlante 3cb2fccc5f Fix misc Kconfig typos
Fix various Kconfig typos.

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:22:59 +01:00
Matt LaPlante 5d3f083d8f Fix typos in /Documentation : Misc
This patch fixes typos in various Documentation txts. The patch addresses some
misc words.

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:21:10 +01:00
Matt LaPlante 4ae0edc21b Fix typos in /Documentation : 'U-Z'
This patch fixes typos in various Documentation txts. The patch addresses some
+words starting with the letters 'U-Z'.

Looks like I made it through the alphabet...just in time to start over again
+too!  Maybe I can fit more profound fixes into the next round...?  Time will
+tell. :)

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 04:58:40 +01:00
Matt LaPlante fa00e7e152 Fix typos in /Documentation : 'T''
This patch fixes typos in various Documentation txts. The patch addresses some
+words starting with the letter 'T'.

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 04:55:36 +01:00
Chase Venters 98c4f0c336 Fix jiffies.h comment
jiffies.h includes a comment informing that jiffies_64 must be read with the
assistance of the xtime_lock seqlock. The comment text, however, calls
jiffies_64 "not volatile", which should probably read "not atomic".

Signed-off-by: Chase Venters <chase.venters@clientec.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 04:53:49 +01:00