Skip to content

Commit

Permalink
usb: dwc2: host: Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT
Browse files Browse the repository at this point in the history
Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT as it stores value of
host DMA descriptor transfer bytes' limit. Values are different in case
of gadget DMA descriptors.

Signed-off-by: Vahram Aharonyan <vahrama@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Vahram Aharonyan authored and Felipe Balbi committed Nov 18, 2016
1 parent 0f6b80c commit 3a1ec35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/dwc2/hcd_ddma.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ static void dwc2_fill_host_dma_desc(struct dwc2_hsotg *hsotg,
struct dwc2_dma_desc *dma_desc = &qh->desc_list[n_desc];
int len = chan->xfer_len;

if (len > MAX_DMA_DESC_SIZE - (chan->max_packet - 1))
len = MAX_DMA_DESC_SIZE - (chan->max_packet - 1);
if (len > HOST_DMA_NBYTES_LIMIT - (chan->max_packet - 1))
len = HOST_DMA_NBYTES_LIMIT - (chan->max_packet - 1);

if (chan->ep_is_in) {
int num_packets;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc2/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ struct dwc2_dma_desc {
#define HOST_DMA_ISOC_NBYTES_SHIFT 0
#define HOST_DMA_NBYTES_MASK (0x1ffff << 0)
#define HOST_DMA_NBYTES_SHIFT 0
#define HOST_DMA_NBYTES_LIMIT 131071

/* Device Mode DMA descriptor status quadlet */

Expand Down Expand Up @@ -856,7 +857,6 @@ struct dwc2_dma_desc {
#define DEV_DMA_NBYTES_SHIFT 0
#define DEV_DMA_NBYTES_LIMIT 0xffff

#define MAX_DMA_DESC_SIZE 131071
#define MAX_DMA_DESC_NUM_GENERIC 64
#define MAX_DMA_DESC_NUM_HS_ISOC 256

Expand Down

0 comments on commit 3a1ec35

Please sign in to comment.