aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2010-05-01 14:20:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:41 -0400
commit910f8d0cede74beff1eee93cf9cf2a28d7600e66 (patch)
tree663cd91c3d4ca2a71937b0dcaad51b02cae3c9c6 /drivers/usb/host
parent1e429018b646bdf903554e92ead1cda96cc552dc (diff)
USB: Change the scatterlist type in struct urb
Change the type of the URB's 'sg' pointer from a usb_sg_request to a scatterlist. This allows drivers to submit scatter-gather lists without using the usb_sg_wait() interface. It has the added benefit of removing the typecasts that were added as part of patch as1368 (and slightly decreasing the number of pointer dereferences). Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-q.c2
-rw-r--r--drivers/usb/host/whci/qset.c4
-rw-r--r--drivers/usb/host/xhci-ring.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 89521775c567..11a79c4f4a9d 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -663,7 +663,7 @@ qh_urb_transaction (
663 */ 663 */
664 i = urb->num_sgs; 664 i = urb->num_sgs;
665 if (len > 0 && i > 0) { 665 if (len > 0 && i > 0) {
666 sg = urb->sg->sg; 666 sg = urb->sg;
667 buf = sg_dma_address(sg); 667 buf = sg_dma_address(sg);
668 668
669 /* urb->transfer_buffer_length may be smaller than the 669 /* urb->transfer_buffer_length may be smaller than the
diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c
index b388dd1fb4c4..ab5a14fbfeeb 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, sg, urb->num_sgs, i) { 446 for_each_sg(urb->sg, sg, urb->num_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, sg, urb->sg->nents, i) { 564 for_each_sg(urb->sg, sg, urb->num_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 9e27eb0c7004..a67caef265b1 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1788,7 +1788,7 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb)
1788 1788
1789 xhci_dbg(xhci, "count sg list trbs: \n"); 1789 xhci_dbg(xhci, "count sg list trbs: \n");
1790 num_trbs = 0; 1790 num_trbs = 0;
1791 for_each_sg(urb->sg->sg, sg, num_sgs, i) { 1791 for_each_sg(urb->sg, sg, num_sgs, i) {
1792 unsigned int previous_total_trbs = num_trbs; 1792 unsigned int previous_total_trbs = num_trbs;
1793 unsigned int len = sg_dma_len(sg); 1793 unsigned int len = sg_dma_len(sg);
1794 1794
@@ -1951,7 +1951,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1951 * the amount of memory allocated for this scatter-gather list. 1951 * the amount of memory allocated for this scatter-gather list.
1952 * 3. TRBs buffers can't cross 64KB boundaries. 1952 * 3. TRBs buffers can't cross 64KB boundaries.
1953 */ 1953 */
1954 sg = urb->sg->sg; 1954 sg = urb->sg;
1955 addr = (u64) sg_dma_address(sg); 1955 addr = (u64) sg_dma_address(sg);
1956 this_sg_len = sg_dma_len(sg); 1956 this_sg_len = sg_dma_len(sg);
1957 trb_buff_len = TRB_MAX_BUFF_SIZE - 1957 trb_buff_len = TRB_MAX_BUFF_SIZE -