summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorMing Lei2013-08-08 15:48:22 +0200
committerGreg Kroah-Hartman2013-08-12 20:56:16 +0200
commitbcc48f1a7a0d40ae2e5a26aff72c2b674fd8b596 (patch)
tree887e24d1dc2f7701dae13ec2d071ee71cdddccdc /drivers/usb/core
parentUSB: EHCI: support running URB giveback in tasklet context (diff)
downloadkernel-qcow2-linux-bcc48f1a7a0d40ae2e5a26aff72c2b674fd8b596.tar.gz
kernel-qcow2-linux-bcc48f1a7a0d40ae2e5a26aff72c2b674fd8b596.tar.xz
kernel-qcow2-linux-bcc48f1a7a0d40ae2e5a26aff72c2b674fd8b596.zip
USB: introduce usb_device_no_sg_constraint() helper
Some host controllers(such as xHCI) can support building packet from discontinuous buffers, so introduce one flag and helper for this kind of host controllers, then the feature can help some applications(such as usbnet) by supporting arbitrary length of sg buffers. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/urb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 4e7a311ff6d7..c12bc790a6a7 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -416,7 +416,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
urb->iso_frame_desc[n].status = -EXDEV;
urb->iso_frame_desc[n].actual_length = 0;
}
- } else if (dev->speed != USB_SPEED_WIRELESS && urb->num_sgs) {
+ } else if (urb->num_sgs && !urb->dev->bus->no_sg_constraint &&
+ dev->speed != USB_SPEED_WIRELESS) {
struct scatterlist *sg;
int i;