diff options
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 45a32dadb406..7c0555548ac8 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/log2.h> | 6 | #include <linux/log2.h> |
7 | #include <linux/usb.h> | 7 | #include <linux/usb.h> |
8 | #include <linux/wait.h> | 8 | #include <linux/wait.h> |
9 | #include "hcd.h" | 9 | #include <linux/usb/hcd.h> |
10 | 10 | ||
11 | #define to_urb(d) container_of(d, struct urb, kref) | 11 | #define to_urb(d) container_of(d, struct urb, kref) |
12 | 12 | ||
@@ -308,8 +308,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
308 | * will be required to set urb->ep directly and we will eliminate | 308 | * will be required to set urb->ep directly and we will eliminate |
309 | * urb->pipe. | 309 | * urb->pipe. |
310 | */ | 310 | */ |
311 | ep = (usb_pipein(urb->pipe) ? dev->ep_in : dev->ep_out) | 311 | ep = usb_pipe_endpoint(dev, urb->pipe); |
312 | [usb_pipeendpoint(urb->pipe)]; | ||
313 | if (!ep) | 312 | if (!ep) |
314 | return -ENOENT; | 313 | return -ENOENT; |
315 | 314 | ||
@@ -333,9 +332,12 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
333 | is_out = usb_endpoint_dir_out(&ep->desc); | 332 | is_out = usb_endpoint_dir_out(&ep->desc); |
334 | } | 333 | } |
335 | 334 | ||
336 | /* Cache the direction for later use */ | 335 | /* Clear the internal flags and cache the direction for later use */ |
337 | urb->transfer_flags = (urb->transfer_flags & ~URB_DIR_MASK) | | 336 | urb->transfer_flags &= ~(URB_DIR_MASK | URB_DMA_MAP_SINGLE | |
338 | (is_out ? URB_DIR_OUT : URB_DIR_IN); | 337 | URB_DMA_MAP_PAGE | URB_DMA_MAP_SG | URB_MAP_LOCAL | |
338 | URB_SETUP_MAP_SINGLE | URB_SETUP_MAP_LOCAL | | ||
339 | URB_DMA_SG_COMBINED); | ||
340 | urb->transfer_flags |= (is_out ? URB_DIR_OUT : URB_DIR_IN); | ||
339 | 341 | ||
340 | if (xfertype != USB_ENDPOINT_XFER_CONTROL && | 342 | if (xfertype != USB_ENDPOINT_XFER_CONTROL && |
341 | dev->state < USB_STATE_CONFIGURED) | 343 | dev->state < USB_STATE_CONFIGURED) |
@@ -396,8 +398,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
396 | return -EPIPE; /* The most suitable error code :-) */ | 398 | return -EPIPE; /* The most suitable error code :-) */ |
397 | 399 | ||
398 | /* enforce simple/standard policy */ | 400 | /* enforce simple/standard policy */ |
399 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP | | 401 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | |
400 | URB_NO_INTERRUPT | URB_DIR_MASK | URB_FREE_BUFFER); | 402 | URB_FREE_BUFFER); |
401 | switch (xfertype) { | 403 | switch (xfertype) { |
402 | case USB_ENDPOINT_XFER_BULK: | 404 | case USB_ENDPOINT_XFER_BULK: |
403 | if (is_out) | 405 | if (is_out) |