From: Vahram Aharonyan <vahr...@synopsys.com>

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 <vahr...@synopsys.com>
Signed-off-by: John Youn <johny...@synopsys.com>
---
 drivers/usb/dwc2/hcd_ddma.c | 4 ++--
 drivers/usb/dwc2/hw.h       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index 70851b9..cf03677 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -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;
diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h
index e9b4eb6..4186c57 100644
--- a/drivers/usb/dwc2/hw.h
+++ b/drivers/usb/dwc2/hw.h
@@ -821,6 +821,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 */
 
@@ -857,7 +858,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
 
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to