diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-30 19:34:00 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-30 19:34:00 -0400 |
| commit | 9f8e35fc0c1d96e5383eca5f0c7c963a9fadef57 (patch) | |
| tree | 86a0f4606209b21a1ba2c33c61472127a9bfe170 | |
| parent | 970e2dfa672b5b26967b0983e24b8d92f972c907 (diff) | |
| parent | a9475226977917afd5a85621f8a3d7f380a9da31 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: "sparse" cleanups for usb gadgets
usb-serial: Fix edgeport regression on non-EPiC devices
USB: more pxa2xx_udc dead code removal
USB: NIKON D50 is an unusual device
USB: drivers/usb/serial/sierra.c: make 3 functions static
USB: fix BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0
USB: mct_u232: Convert to proper speed handling API
digi_acceleport: Drag the driver kicking and screaming into coding style
cp2101: Remove broken termios optimisation, use proper speed API
USB: Fix a bug in usb_start_wait_urb
USB: fix scatterlist PIO case (IOMMU)
USB: fix usb_serial_suspend(): buggy code
USB: yet another quirky device
USB: Add CanonScan LiDE30 to the quirk list
USB: even more quirks
USB: usb.h kernel-doc additions
USB: more quirky devices
USB: Don't let usb-storage steal Blackberry Pearl
USB: devices misc: Trivial patch to build the IOWARRIOR when it is selected in Kconfig
| -rw-r--r-- | drivers/usb/Makefile | 1 | ||||
| -rw-r--r-- | drivers/usb/core/message.c | 41 | ||||
| -rw-r--r-- | drivers/usb/core/quirks.c | 22 | ||||
| -rw-r--r-- | drivers/usb/gadget/config.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/epautoconf.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/ether.c | 3 | ||||
| -rw-r--r-- | drivers/usb/gadget/inode.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/m66592-udc.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.c | 30 | ||||
| -rw-r--r-- | drivers/usb/gadget/zero.c | 6 | ||||
| -rw-r--r-- | drivers/usb/serial/cp2101.c | 69 | ||||
| -rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 970 | ||||
| -rw-r--r-- | drivers/usb/serial/io_edgeport.c | 19 | ||||
| -rw-r--r-- | drivers/usb/serial/mct_u232.c | 54 | ||||
| -rw-r--r-- | drivers/usb/serial/mct_u232.h | 2 | ||||
| -rw-r--r-- | drivers/usb/serial/sierra.c | 7 | ||||
| -rw-r--r-- | drivers/usb/serial/usb-serial.c | 32 | ||||
| -rw-r--r-- | drivers/usb/storage/unusual_devs.h | 21 | ||||
| -rw-r--r-- | include/linux/usb.h | 2 |
19 files changed, 577 insertions, 712 deletions
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index befff5f9d58c..ac49b15fa768 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile | |||
| @@ -48,6 +48,7 @@ obj-$(CONFIG_USB_SISUSBVGA) += misc/ | |||
| 48 | obj-$(CONFIG_USB_TEST) += misc/ | 48 | obj-$(CONFIG_USB_TEST) += misc/ |
| 49 | obj-$(CONFIG_USB_TRANCEVIBRATOR)+= misc/ | 49 | obj-$(CONFIG_USB_TRANCEVIBRATOR)+= misc/ |
| 50 | obj-$(CONFIG_USB_USS720) += misc/ | 50 | obj-$(CONFIG_USB_USS720) += misc/ |
| 51 | obj-$(CONFIG_USB_IOWARRIOR) += misc/ | ||
| 51 | 52 | ||
| 52 | obj-$(CONFIG_USB_ATM) += atm/ | 53 | obj-$(CONFIG_USB_ATM) += atm/ |
| 53 | obj-$(CONFIG_USB_SPEEDTOUCH) += atm/ | 54 | obj-$(CONFIG_USB_SPEEDTOUCH) += atm/ |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 25f63f1096b4..b6bd05e3d439 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -18,9 +18,17 @@ | |||
| 18 | #include "hcd.h" /* for usbcore internals */ | 18 | #include "hcd.h" /* for usbcore internals */ |
| 19 | #include "usb.h" | 19 | #include "usb.h" |
| 20 | 20 | ||
| 21 | struct api_context { | ||
| 22 | struct completion done; | ||
| 23 | int status; | ||
| 24 | }; | ||
| 25 | |||
| 21 | static void usb_api_blocking_completion(struct urb *urb) | 26 | static void usb_api_blocking_completion(struct urb *urb) |
| 22 | { | 27 | { |
| 23 | complete((struct completion *)urb->context); | 28 | struct api_context *ctx = urb->context; |
| 29 | |||
| 30 | ctx->status = urb->status; | ||
| 31 | complete(&ctx->done); | ||
| 24 | } | 32 | } |
| 25 | 33 | ||
| 26 | 34 | ||
| @@ -32,20 +40,21 @@ static void usb_api_blocking_completion(struct urb *urb) | |||
| 32 | */ | 40 | */ |
| 33 | static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length) | 41 | static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length) |
| 34 | { | 42 | { |
| 35 | struct completion done; | 43 | struct api_context ctx; |
| 36 | unsigned long expire; | 44 | unsigned long expire; |
| 37 | int retval; | 45 | int retval; |
| 38 | int status = urb->status; | ||
| 39 | 46 | ||
| 40 | init_completion(&done); | 47 | init_completion(&ctx.done); |
| 41 | urb->context = &done; | 48 | urb->context = &ctx; |
| 42 | urb->actual_length = 0; | 49 | urb->actual_length = 0; |
| 43 | retval = usb_submit_urb(urb, GFP_NOIO); | 50 | retval = usb_submit_urb(urb, GFP_NOIO); |
| 44 | if (unlikely(retval)) | 51 | if (unlikely(retval)) |
| 45 | goto out; | 52 | goto out; |
| 46 | 53 | ||
| 47 | expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT; | 54 | expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT; |
| 48 | if (!wait_for_completion_timeout(&done, expire)) { | 55 | if (!wait_for_completion_timeout(&ctx.done, expire)) { |
| 56 | usb_kill_urb(urb); | ||
| 57 | retval = (ctx.status == -ENOENT ? -ETIMEDOUT : ctx.status); | ||
| 49 | 58 | ||
| 50 | dev_dbg(&urb->dev->dev, | 59 | dev_dbg(&urb->dev->dev, |
| 51 | "%s timed out on ep%d%s len=%d/%d\n", | 60 | "%s timed out on ep%d%s len=%d/%d\n", |
| @@ -54,11 +63,8 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length) | |||
| 54 | usb_pipein(urb->pipe) ? "in" : "out", | 63 | usb_pipein(urb->pipe) ? "in" : "out", |
| 55 | urb->actual_length, | 64 | urb->actual_length, |
| 56 | urb->transfer_buffer_length); | 65 | urb->transfer_buffer_length); |
| 57 | |||
| 58 | usb_kill_urb(urb); | ||
| 59 | retval = status == -ENOENT ? -ETIMEDOUT : status; | ||
| 60 | } else | 66 | } else |
| 61 | retval = status; | 67 | retval = ctx.status; |
| 62 | out: | 68 | out: |
| 63 | if (actual_length) | 69 | if (actual_length) |
| 64 | *actual_length = urb->actual_length; | 70 | *actual_length = urb->actual_length; |
| @@ -411,15 +417,22 @@ int usb_sg_init ( | |||
| 411 | * Some systems need to revert to PIO when DMA is temporarily | 417 | * Some systems need to revert to PIO when DMA is temporarily |
| 412 | * unavailable. For their sakes, both transfer_buffer and | 418 | * unavailable. For their sakes, both transfer_buffer and |
| 413 | * transfer_dma are set when possible. However this can only | 419 | * transfer_dma are set when possible. However this can only |
| 414 | * work on systems without HIGHMEM, since DMA buffers located | 420 | * work on systems without: |
| 415 | * in high memory are not directly addressable by the CPU for | 421 | * |
| 416 | * PIO ... so when HIGHMEM is in use, transfer_buffer is NULL | 422 | * - HIGHMEM, since DMA buffers located in high memory are |
| 423 | * not directly addressable by the CPU for PIO; | ||
| 424 | * | ||
| 425 | * - IOMMU, since dma_map_sg() is allowed to use an IOMMU to | ||
| 426 | * make virtually discontiguous buffers be "dma-contiguous" | ||
| 427 | * so that PIO and DMA need diferent numbers of URBs. | ||
| 428 | * | ||
| 429 | * So when HIGHMEM or IOMMU are in use, transfer_buffer is NULL | ||
| 417 | * to prevent stale pointers and to help spot bugs. | 430 | * to prevent stale pointers and to help spot bugs. |
| 418 | */ | 431 | */ |
| 419 | if (dma) { | 432 | if (dma) { |
| 420 | io->urbs [i]->transfer_dma = sg_dma_address (sg + i); | 433 | io->urbs [i]->transfer_dma = sg_dma_address (sg + i); |
| 421 | len = sg_dma_len (sg + i); | 434 | len = sg_dma_len (sg + i); |
| 422 | #ifdef CONFIG_HIGHMEM | 435 | #if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU) |
| 423 | io->urbs[i]->transfer_buffer = NULL; | 436 | io->urbs[i]->transfer_buffer = NULL; |
| 424 | #else | 437 | #else |
| 425 | io->urbs[i]->transfer_buffer = | 438 | io->urbs[i]->transfer_buffer = |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index aa21b38a31ce..b7917c5a3c6f 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
| @@ -30,18 +30,40 @@ | |||
| 30 | static const struct usb_device_id usb_quirk_list[] = { | 30 | static const struct usb_device_id usb_quirk_list[] = { |
| 31 | /* HP 5300/5370C scanner */ | 31 | /* HP 5300/5370C scanner */ |
| 32 | { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, | 32 | { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, |
| 33 | /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ | ||
| 34 | { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 33 | /* Benq S2W 3300U */ | 35 | /* Benq S2W 3300U */ |
| 34 | { USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 36 | { USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
| 37 | /* Canon, Inc. CanoScan N1240U/LiDE30 */ | ||
| 38 | { USB_DEVICE(0x04a9, 0x220e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 39 | /* Canon, Inc. CanoScan N650U/N656U */ | ||
| 40 | { USB_DEVICE(0x04a9, 0x2206), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 41 | /* Canon, Inc. CanoScan 1220U */ | ||
| 42 | { USB_DEVICE(0x04a9, 0x2207), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 43 | /* Canon, Inc. CanoScan N670U/N676U/LiDE 20 */ | ||
| 44 | { USB_DEVICE(0x04a9, 0x220d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 45 | /* old Cannon scanner */ | ||
| 46 | { USB_DEVICE(0x04a9, 0x2220), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 35 | /* Seiko Epson Corp. Perfection 1200 */ | 47 | /* Seiko Epson Corp. Perfection 1200 */ |
| 36 | { USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 48 | { USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
| 49 | /* Seiko Epson Corp. Perfection 660 */ | ||
| 50 | { USB_DEVICE(0x04b8, 0x0114), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 51 | /* Epson Perfection 1260 Photo */ | ||
| 52 | { USB_DEVICE(0x04b8, 0x011d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 37 | /* Seiko Epson Corp - Perfection 1670 */ | 53 | /* Seiko Epson Corp - Perfection 1670 */ |
| 38 | { USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 54 | { USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
| 55 | /* EPSON Perfection 2480 */ | ||
| 56 | { USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 57 | /* Seiko Epson Corp.*/ | ||
| 58 | { USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
| 39 | /* Samsung ML-2510 Series printer */ | 59 | /* Samsung ML-2510 Series printer */ |
| 40 | { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 60 | { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
