usb: dwc2: host: Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT
authorVahram Aharonyan <vahrama@synopsys.com>
Thu, 10 Nov 2016 03:27:58 +0000 (19:27 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:19 +0000 (13:54 +0200)
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>
drivers/usb/dwc2/hcd_ddma.c
drivers/usb/dwc2/hw.h

index 70851b99417f0d9986733955bde06d3db6efe8b8..cf0367768cb39b023ef4308c451953877945b6f0 100644 (file)
@@ -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;
index 5fad5a1a1a29af5042f6c16b52e597a034953a05..0e5bfb38b2dfa1cb34999798d8199fbf90a364e1 100644 (file)
@@ -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 */
 
@@ -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