diff options
-rw-r--r-- | drivers/usb/core/hcd.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ehci-q.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/uhci-q.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/whci/qset.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 4 | ||||
-rw-r--r-- | include/linux/usb.h | 1 |
6 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 43a89e4ba92..2cec49d1773 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1398,11 +1398,10 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, | |||
1398 | ret = -EAGAIN; | 1398 | ret = -EAGAIN; |
1399 | else | 1399 | else |
1400 | urb->transfer_flags |= URB_DMA_MAP_SG; | 1400 | urb->transfer_flags |= URB_DMA_MAP_SG; |
1401 | if (n != urb->num_sgs) { | 1401 | urb->num_mapped_sgs = n; |
1402 | urb->num_sgs = n; | 1402 | if (n != urb->num_sgs) |
1403 | urb->transfer_flags |= | 1403 | urb->transfer_flags |= |
1404 | URB_DMA_SG_COMBINED; | 1404 | URB_DMA_SG_COMBINED; |
1405 | } | ||
1406 | } else if (urb->sg) { | 1405 | } else if (urb->sg) { |
1407 | struct scatterlist *sg = urb->sg; | 1406 | struct scatterlist *sg = urb->sg; |
1408 | urb->transfer_dma = dma_map_page( | 1407 | urb->transfer_dma = dma_map_page( |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index f136f7f1c4f..36ca5077cdf 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -658,7 +658,7 @@ qh_urb_transaction ( | |||
658 | /* | 658 | /* |
659 | * data transfer stage: buffer setup | 659 | * data transfer stage: buffer setup |
660 | */ | 660 | */ |
661 | i = urb->num_sgs; | 661 | i = urb->num_mapped_sgs; |
662 | if (len > 0 && i > 0) { | 662 | if (len > 0 && i > 0) { |
663 | sg = urb->sg; | 663 | sg = urb->sg; |
664 | buf = sg_dma_address(sg); | 664 | buf = sg_dma_address(sg); |
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index f6ca80ee4ce..d2c6f5ac462 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -943,7 +943,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, | |||
943 | if (usb_pipein(urb->pipe)) | 943 | if (usb_pipein(urb->pipe)) |
944 | status |= TD_CTRL_SPD; | 944 | status |= TD_CTRL_SPD; |
945 | 945 | ||
946 | i = urb->num_sgs; | 946 | i = urb->num_mapped_sgs; |
947 | if (len > 0 && i > 0) { | 947 | if (len > 0 && i > 0) { |
948 | sg = urb->sg; | 948 | sg = urb->sg; |
949 | data = sg_dma_address(sg); | 949 | data = sg_dma_address(sg); |
diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c index d6e17542861..a91712c8bff 100644 --- a/drivers/usb/host/whci/qset.c +++ b/drivers/usb/host/whci/qset.c | |||
@@ -443,7 +443,7 @@ static int qset_add_urb_sg(struct whc *whc, struct whc_qset *qset, struct urb *u | |||
443 | 443 | ||
444 | remaining = urb->transfer_buffer_length; | 444 | remaining = urb->transfer_buffer_length; |
445 | 445 | ||
446 | for_each_sg(urb->sg, sg, urb->num_sgs, i) { | 446 | for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) { |
447 | dma_addr_t dma_addr; | 447 | dma_addr_t dma_addr; |
448 | size_t dma_remaining; | 448 | size_t dma_remaining; |
449 | dma_addr_t sp, ep; | 449 | dma_addr_t sp, ep; |
@@ -561,7 +561,7 @@ static int qset_add_urb_sg_linearize(struct whc *whc, struct whc_qset *qset, | |||
561 | 561 | ||
562 | remaining = urb->transfer_buffer_length; | 562 | remaining = urb->transfer_buffer_length; |
563 | 563 | ||
564 | for_each_sg(urb->sg, sg, urb->num_sgs, i) { | 564 | for_each_sg(urb->sg, sg, urb->num_mapped_sgs, i) { |
565 | size_t len; | 565 | size_t len; |
566 | size_t sg_remaining; | 566 | size_t sg_remaining; |
567 | void *orig; | 567 | void *orig; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 133ce302c86..d030f0b2bfa 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2551,7 +2551,7 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) | |||
2551 | struct scatterlist *sg; | 2551 | struct scatterlist *sg; |
2552 | 2552 | ||
2553 | sg = NULL; | 2553 | sg = NULL; |
2554 | num_sgs = urb->num_sgs; | 2554 | num_sgs = urb->num_mapped_sgs; |
2555 | temp = urb->transfer_buffer_length; | 2555 | temp = urb->transfer_buffer_length; |
2556 | 2556 | ||
2557 | xhci_dbg(xhci, "count sg list trbs: \n"); | 2557 | xhci_dbg(xhci, "count sg list trbs: \n"); |
@@ -2735,7 +2735,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2735 | return -EINVAL; | 2735 | return -EINVAL; |
2736 | 2736 | ||
2737 | num_trbs = count_sg_trbs_needed(xhci, urb); | 2737 | num_trbs = count_sg_trbs_needed(xhci, urb); |
2738 | num_sgs = urb->num_sgs; | 2738 | num_sgs = urb->num_mapped_sgs; |
2739 | total_packet_count = roundup(urb->transfer_buffer_length, | 2739 | total_packet_count = roundup(urb->transfer_buffer_length, |
2740 | usb_endpoint_maxp(&urb->ep->desc)); | 2740 | usb_endpoint_maxp(&urb->ep->desc)); |
2741 | 2741 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 2f05a7fa1ec..4269c3f8814 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1221,6 +1221,7 @@ struct urb { | |||
1221 | void *transfer_buffer; /* (in) associated data buffer */ | 1221 | void *transfer_buffer; /* (in) associated data buffer */ |
1222 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1222 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
1223 | struct scatterlist *sg; /* (in) scatter gather buffer list */ | 1223 | struct scatterlist *sg; /* (in) scatter gather buffer list */ |
1224 | int num_mapped_sgs; /* (internal) mapped sg entries */ | ||
1224 | int num_sgs; /* (in) number of entries in the sg list */ | 1225 | int num_sgs; /* (in) number of entries in the sg list */ |
1225 | u32 transfer_buffer_length; /* (in) data buffer length */ | 1226 | u32 transfer_buffer_length; /* (in) data buffer length */ |
1226 | u32 actual_length; /* (return) actual transfer length */ | 1227 | u32 actual_length; /* (return) actual transfer length */ |