Commit 294a39e7 authored by David Vrabel's avatar David Vrabel Committed by Greg Kroah-Hartman

USB: whci-hcd: support urbs with scatter-gather lists

Support urbs with scatter-gather lists by trying to fit sg list elements
into page lists in one or more qTDs.  qTDs must end on a wMaxPacketSize
boundary so if this isn't possible the urb's sg list must be copied into
bounce buffers.
Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4c1bd3d7
...@@ -250,6 +250,7 @@ static int whc_probe(struct umc_dev *umc) ...@@ -250,6 +250,7 @@ static int whc_probe(struct umc_dev *umc)
} }
usb_hcd->wireless = 1; usb_hcd->wireless = 1;
usb_hcd->self.sg_tablesize = 2048; /* somewhat arbitrary */
wusbhc = usb_hcd_to_wusbhc(usb_hcd); wusbhc = usb_hcd_to_wusbhc(usb_hcd);
whc = wusbhc_to_whc(wusbhc); whc = wusbhc_to_whc(wusbhc);
......
This diff is collapsed.
...@@ -84,6 +84,11 @@ struct whc { ...@@ -84,6 +84,11 @@ struct whc {
* @len: the length of data in the associated TD. * @len: the length of data in the associated TD.
* @ntds_remaining: number of TDs (starting from this one) in this transfer. * @ntds_remaining: number of TDs (starting from this one) in this transfer.
* *
* @bounce_buf: a bounce buffer if the std was from an urb with a sg
* list that could not be mapped to qTDs directly.
* @bounce_sg: the first scatterlist element bounce_buf is for.
* @bounce_offset: the offset into bounce_sg for the start of bounce_buf.
*
* Queued URBs may require more TDs than are available in a qset so we * Queued URBs may require more TDs than are available in a qset so we
* use a list of these "software TDs" (sTDs) to hold per-TD data. * use a list of these "software TDs" (sTDs) to hold per-TD data.
*/ */
...@@ -97,6 +102,10 @@ struct whc_std { ...@@ -97,6 +102,10 @@ struct whc_std {
int num_pointers; int num_pointers;
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct whc_page_list_entry *pl_virt; struct whc_page_list_entry *pl_virt;
void *bounce_buf;
struct scatterlist *bounce_sg;
unsigned bounce_offset;
}; };
/** /**
......
...@@ -267,8 +267,9 @@ struct whc_qset { ...@@ -267,8 +267,9 @@ struct whc_qset {
unsigned reset:1; unsigned reset:1;
struct urb *pause_after_urb; struct urb *pause_after_urb;
struct completion remove_complete; struct completion remove_complete;
int max_burst; uint16_t max_packet;
int max_seq; uint8_t max_burst;
uint8_t max_seq;
}; };
static inline void whc_qset_set_link_ptr(u64 *ptr, u64 target) static inline void whc_qset_set_link_ptr(u64 *ptr, u64 target)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment